summaryrefslogtreecommitdiff
path: root/src/net/manaserv/chatserver
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/manaserv/chatserver')
-rw-r--r--src/net/manaserv/chatserver/chatserver.cpp57
-rw-r--r--src/net/manaserv/chatserver/chatserver.h44
-rw-r--r--src/net/manaserv/chatserver/guild.cpp16
-rw-r--r--src/net/manaserv/chatserver/internal.cpp32
-rw-r--r--src/net/manaserv/chatserver/internal.h35
-rw-r--r--src/net/manaserv/chatserver/party.cpp83
-rw-r--r--src/net/manaserv/chatserver/party.h61
7 files changed, 8 insertions, 320 deletions
diff --git a/src/net/manaserv/chatserver/chatserver.cpp b/src/net/manaserv/chatserver/chatserver.cpp
deleted file mode 100644
index 23eee3e6..00000000
--- a/src/net/manaserv/chatserver/chatserver.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * The Mana World
- * Copyright (C) 2004 The Mana World Development Team
- *
- * This file is part of The Mana World.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "chatserver.h"
-
-#include "internal.h"
-
-#include "net/manaserv/connection.h"
-#include "net/manaserv/messageout.h"
-#include "net/manaserv/protocol.h"
-
-namespace ManaServ {
-
-using ChatServer::connection;
-
-void ChatServer::connect(Connection *connection,
- const std::string &token)
-{
- ChatServer::connection = connection;
-
- MessageOut msg(PCMSG_CONNECT);
- msg.writeString(token, 32);
- connection->send(msg);
-}
-
-void ChatServer::logout()
-{
- MessageOut msg(PCMSG_DISCONNECT);
- connection->send(msg);
-}
-
-void ChatServer::announce(const std::string &text)
-{
- MessageOut msg(PCMSG_ANNOUNCE);
- msg.writeString(text);
- connection->send(msg);
-}
-
-}
diff --git a/src/net/manaserv/chatserver/chatserver.h b/src/net/manaserv/chatserver/chatserver.h
deleted file mode 100644
index 18cd5960..00000000
--- a/src/net/manaserv/chatserver/chatserver.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * The Mana World
- * Copyright (C) 2004 The Mana World Development Team
- *
- * This file is part of The Mana World.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef NET_MANASERV_CHATSERVER_CHATSERVER_H
-#define NET_MANASERV_CHATSERVER_CHATSERVER_H
-
-#include <iosfwd>
-
-namespace ManaServ
-{
- class Connection;
-
- namespace ChatServer
- {
- void connect(Connection *connection, const std::string &token);
-
- void logout();
-
- void announce(const std::string &text);
-
- void kickUser(short channel, const std::string &user);
-
- }
-}
-
-#endif // NET_MANASERV_CHATSERVER_CHATSERVER_H
diff --git a/src/net/manaserv/chatserver/guild.cpp b/src/net/manaserv/chatserver/guild.cpp
index e34b3bc4..1f0990b1 100644
--- a/src/net/manaserv/chatserver/guild.cpp
+++ b/src/net/manaserv/chatserver/guild.cpp
@@ -21,8 +21,6 @@
#include "guild.h"
-#include "internal.h"
-
#include "net/manaserv/connection.h"
#include "net/manaserv/messageout.h"
#include "net/manaserv/protocol.h"
@@ -32,6 +30,8 @@
namespace ManaServ
{
+extern Connection *chatServerConnection;
+
void ChatServer::Guild::createGuild(const std::string &name)
{
logger->log("Sending PCMSG_GUILD_CREATE");
@@ -39,7 +39,7 @@ void ChatServer::Guild::createGuild(const std::string &name)
msg.writeString(name);
- ChatServer::connection->send(msg);
+ chatServerConnection->send(msg);
}
void ChatServer::Guild::invitePlayer(const std::string &name, short guildId)
@@ -50,7 +50,7 @@ void ChatServer::Guild::invitePlayer(const std::string &name, short guildId)
msg.writeInt16(guildId);
msg.writeString(name);
- ChatServer::connection->send(msg);
+ chatServerConnection->send(msg);
}
void ChatServer::Guild::acceptInvite(const std::string &name)
@@ -60,7 +60,7 @@ void ChatServer::Guild::acceptInvite(const std::string &name)
msg.writeString(name);
- ChatServer::connection->send(msg);
+ chatServerConnection->send(msg);
}
void ChatServer::Guild::getGuildMembers(short guildId)
@@ -70,7 +70,7 @@ void ChatServer::Guild::getGuildMembers(short guildId)
msg.writeInt16(guildId);
- ChatServer::connection->send(msg);
+ chatServerConnection->send(msg);
}
void ChatServer::Guild::promoteMember(const std::string &name,
@@ -83,7 +83,7 @@ void ChatServer::Guild::promoteMember(const std::string &name,
msg.writeString(name);
msg.writeInt8(level);
- ChatServer::connection->send(msg);
+ chatServerConnection->send(msg);
}
void ChatServer::Guild::quitGuild(short guildId)
@@ -93,7 +93,7 @@ void ChatServer::Guild::quitGuild(short guildId)
msg.writeInt16(guildId);
- ChatServer::connection->send(msg);
+ chatServerConnection->send(msg);
}
}
diff --git a/src/net/manaserv/chatserver/internal.cpp b/src/net/manaserv/chatserver/internal.cpp
deleted file mode 100644
index 890cb1f1..00000000
--- a/src/net/manaserv/chatserver/internal.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * The Mana World
- * Copyright (C) 2004 The Mana World Development Team
- *
- * This file is part of The Mana World.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "internal.h"
-
-namespace ManaServ
-{
- class Connection;
-
- namespace ChatServer
- {
- Connection *connection = 0;
- }
-}
diff --git a/src/net/manaserv/chatserver/internal.h b/src/net/manaserv/chatserver/internal.h
deleted file mode 100644
index 6807f147..00000000
--- a/src/net/manaserv/chatserver/internal.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * The Mana World
- * Copyright (C) 2004 The Mana World Development Team
- *
- * This file is part of The Mana World.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef NET_MANASERV_CHATSERVER_INTERNAL_H
-#define NET_MANASERV_CHATSERVER_INTERNAL_H
-
-namespace ManaServ
-{
- class Connection;
-
- namespace ChatServer
- {
- extern Connection *connection;
- }
-}
-
-#endif // NET_MANASERV_CHATSERVER_INTERNAL_H
diff --git a/src/net/manaserv/chatserver/party.cpp b/src/net/manaserv/chatserver/party.cpp
deleted file mode 100644
index fdefc59d..00000000
--- a/src/net/manaserv/chatserver/party.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * The Mana World
- * Copyright (C) 2008 The Mana World Development Team
- *
- * This file is part of The Mana World.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "party.h"
-
-#include "internal.h"
-
-#include "net/manaserv/connection.h"
-#include "net/manaserv/messageout.h"
-#include "net/manaserv/protocol.h"
-
-#include "log.h"
-
-namespace ManaServ
-{
-
-void ChatServer::Party::invitePlayer(const std::string &name)
-{
- logger->log("Sending PCMSG_PARTY_INVITE");
- MessageOut msg(PCMSG_PARTY_INVITE);
-
- msg.writeString(name);
-
- ChatServer::connection->send(msg);
-}
-
-void ChatServer::Party::acceptInvite(const std::string &name)
-{
- logger->log("Sending PCMSG_PARTY_ACCEPT_INVITE");
- MessageOut msg(PCMSG_PARTY_ACCEPT_INVITE);
-
- msg.writeString(name);
-
- ChatServer::connection->send(msg);
-}
-
-void ChatServer::Party::rejectInvite(const std::string &name)
-{
- logger->log("Sending PCMSG_PARTY_REJECT_INVITE");
- MessageOut msg(PCMSG_PARTY_REJECT_INVITE);
-
- msg.writeString(name);
-
- ChatServer::connection->send(msg);
-}
-
-void ChatServer::Party::getPartyMembers()
-{
- logger->log("Sending PCMSG_PARTY_GET_MEMBERS");
-// MessageOut msg(PCMSG_GUILD_GET_MEMBERS);
-
-// msg.writeInt16(guildId);
-
-// ChatServer::connection->send(msg);
-}
-
-void ChatServer::Party::quitParty()
-{
- logger->log("Sending PCMSG_PARTY_QUIT");
- MessageOut msg(PCMSG_PARTY_QUIT);
-
- ChatServer::connection->send(msg);
-}
-
-}
diff --git a/src/net/manaserv/chatserver/party.h b/src/net/manaserv/chatserver/party.h
deleted file mode 100644
index 34f308f7..00000000
--- a/src/net/manaserv/chatserver/party.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * The Mana World
- * Copyright (C) 2008 The Mana World Development Team
- *
- * This file is part of The Mana World.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef NET_MANASERV_CHATSERVER_PARTY_H
-#define NET_MANASERV_CHATSERVER_PARTY_H
-
-#include <iosfwd>
-
-namespace ManaServ
-{
- namespace ChatServer
- {
- namespace Party
- {
- /**
- * Invite a player to the party.
- */
- void invitePlayer(const std::string &name);
-
- /**
- * Accept an invite another player has sent to join their party
- */
- void acceptInvite(const std::string &name);
-
- /**
- * Reject an invite from another player to join their party
- */
- void rejectInvite(const std::string &name);
-
- /**
- * Get a list of party members
- */
- void getPartyMembers();
-
- /**
- * Leave party
- */
- void quitParty();
- }
- }
-}
-
-#endif // NET_MANASERV_CHATSERVER_PARTY_H