diff options
Diffstat (limited to 'src/net/manaserv/chatserver')
-rw-r--r-- | src/net/manaserv/chatserver/chatserver.cpp | 15 | ||||
-rw-r--r-- | src/net/manaserv/chatserver/chatserver.h | 10 | ||||
-rw-r--r-- | src/net/manaserv/chatserver/guild.cpp | 32 | ||||
-rw-r--r-- | src/net/manaserv/chatserver/guild.h | 8 | ||||
-rw-r--r-- | src/net/manaserv/chatserver/internal.cpp | 2 | ||||
-rw-r--r-- | src/net/manaserv/chatserver/internal.h | 8 | ||||
-rw-r--r-- | src/net/manaserv/chatserver/party.cpp | 28 | ||||
-rw-r--r-- | src/net/manaserv/chatserver/party.h | 8 |
8 files changed, 61 insertions, 50 deletions
diff --git a/src/net/manaserv/chatserver/chatserver.cpp b/src/net/manaserv/chatserver/chatserver.cpp index f0f5faf2..23eee3e6 100644 --- a/src/net/manaserv/chatserver/chatserver.cpp +++ b/src/net/manaserv/chatserver/chatserver.cpp @@ -24,31 +24,34 @@ #include "internal.h" #include "net/manaserv/connection.h" +#include "net/manaserv/messageout.h" #include "net/manaserv/protocol.h" -#include "net/messageout.h" +namespace ManaServ { -using Net::ChatServer::connection; +using ChatServer::connection; -void Net::ChatServer::connect(Net::Connection *connection, +void ChatServer::connect(Connection *connection, const std::string &token) { - Net::ChatServer::connection = connection; + ChatServer::connection = connection; MessageOut msg(PCMSG_CONNECT); msg.writeString(token, 32); connection->send(msg); } -void Net::ChatServer::logout() +void ChatServer::logout() { MessageOut msg(PCMSG_DISCONNECT); connection->send(msg); } -void Net::ChatServer::announce(const std::string &text) +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 index 18859a2c..18cd5960 100644 --- a/src/net/manaserv/chatserver/chatserver.h +++ b/src/net/manaserv/chatserver/chatserver.h @@ -19,18 +19,18 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef NET_CHATSERVER_CHATSERVER_H -#define NET_CHATSERVER_CHATSERVER_H +#ifndef NET_MANASERV_CHATSERVER_CHATSERVER_H +#define NET_MANASERV_CHATSERVER_CHATSERVER_H #include <iosfwd> -namespace Net +namespace ManaServ { class Connection; namespace ChatServer { - void connect(Net::Connection *connection, const std::string &token); + void connect(Connection *connection, const std::string &token); void logout(); @@ -41,4 +41,4 @@ namespace Net } } -#endif +#endif // NET_MANASERV_CHATSERVER_CHATSERVER_H diff --git a/src/net/manaserv/chatserver/guild.cpp b/src/net/manaserv/chatserver/guild.cpp index 5973077e..e34b3bc4 100644 --- a/src/net/manaserv/chatserver/guild.cpp +++ b/src/net/manaserv/chatserver/guild.cpp @@ -24,23 +24,25 @@ #include "internal.h" #include "net/manaserv/connection.h" +#include "net/manaserv/messageout.h" #include "net/manaserv/protocol.h" -#include "net/messageout.h" - #include "log.h" -void Net::ChatServer::Guild::createGuild(const std::string &name) +namespace ManaServ +{ + +void ChatServer::Guild::createGuild(const std::string &name) { logger->log("Sending PCMSG_GUILD_CREATE"); MessageOut msg(PCMSG_GUILD_CREATE); msg.writeString(name); - Net::ChatServer::connection->send(msg); + ChatServer::connection->send(msg); } -void Net::ChatServer::Guild::invitePlayer(const std::string &name, short guildId) +void ChatServer::Guild::invitePlayer(const std::string &name, short guildId) { logger->log("Sending PCMSG_GUILD_INVITE"); MessageOut msg(PCMSG_GUILD_INVITE); @@ -48,30 +50,30 @@ void Net::ChatServer::Guild::invitePlayer(const std::string &name, short guildId msg.writeInt16(guildId); msg.writeString(name); - Net::ChatServer::connection->send(msg); + ChatServer::connection->send(msg); } -void Net::ChatServer::Guild::acceptInvite(const std::string &name) +void ChatServer::Guild::acceptInvite(const std::string &name) { logger->log("Sending PCMSG_GUILD_ACCEPT"); MessageOut msg(PCMSG_GUILD_ACCEPT); msg.writeString(name); - Net::ChatServer::connection->send(msg); + ChatServer::connection->send(msg); } -void Net::ChatServer::Guild::getGuildMembers(short guildId) +void ChatServer::Guild::getGuildMembers(short guildId) { logger->log("Sending PCMSG_GUILD_GET_MEMBERS"); MessageOut msg(PCMSG_GUILD_GET_MEMBERS); msg.writeInt16(guildId); - Net::ChatServer::connection->send(msg); + ChatServer::connection->send(msg); } -void Net::ChatServer::Guild::promoteMember(const std::string &name, +void ChatServer::Guild::promoteMember(const std::string &name, short guildId, short level) { logger->log("Sending PCMSG_GUILD_PROMOTE_MEMBER"); @@ -81,15 +83,17 @@ void Net::ChatServer::Guild::promoteMember(const std::string &name, msg.writeString(name); msg.writeInt8(level); - Net::ChatServer::connection->send(msg); + ChatServer::connection->send(msg); } -void Net::ChatServer::Guild::quitGuild(short guildId) +void ChatServer::Guild::quitGuild(short guildId) { logger->log("Sending PCMSG_GUILD_QUIT"); MessageOut msg(PCMSG_GUILD_QUIT); msg.writeInt16(guildId); - Net::ChatServer::connection->send(msg); + ChatServer::connection->send(msg); +} + } diff --git a/src/net/manaserv/chatserver/guild.h b/src/net/manaserv/chatserver/guild.h index 2e9cf9a6..7b9aef04 100644 --- a/src/net/manaserv/chatserver/guild.h +++ b/src/net/manaserv/chatserver/guild.h @@ -19,12 +19,12 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef NET_CHATSERVER_GUILD_H -#define NET_CHATSERVER_GUILD_H +#ifndef NET_MANASERV_CHATSERVER_GUILD_H +#define NET_MANASERV_CHATSERVER_GUILD_H #include <iosfwd> -namespace Net +namespace ManaServ { namespace ChatServer { @@ -64,4 +64,4 @@ namespace Net } } -#endif +#endif // NET_MANASERV_CHATSERVER_GUILD_H diff --git a/src/net/manaserv/chatserver/internal.cpp b/src/net/manaserv/chatserver/internal.cpp index 52744804..890cb1f1 100644 --- a/src/net/manaserv/chatserver/internal.cpp +++ b/src/net/manaserv/chatserver/internal.cpp @@ -21,7 +21,7 @@ #include "internal.h" -namespace Net +namespace ManaServ { class Connection; diff --git a/src/net/manaserv/chatserver/internal.h b/src/net/manaserv/chatserver/internal.h index 162d54fb..6807f147 100644 --- a/src/net/manaserv/chatserver/internal.h +++ b/src/net/manaserv/chatserver/internal.h @@ -19,10 +19,10 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef NET_CHATSERVER_INTERNAL_H -#define NET_CHATSERVER_INTERNAL_H +#ifndef NET_MANASERV_CHATSERVER_INTERNAL_H +#define NET_MANASERV_CHATSERVER_INTERNAL_H -namespace Net +namespace ManaServ { class Connection; @@ -32,4 +32,4 @@ namespace Net } } -#endif +#endif // NET_MANASERV_CHATSERVER_INTERNAL_H diff --git a/src/net/manaserv/chatserver/party.cpp b/src/net/manaserv/chatserver/party.cpp index 26b45346..fdefc59d 100644 --- a/src/net/manaserv/chatserver/party.cpp +++ b/src/net/manaserv/chatserver/party.cpp @@ -24,56 +24,60 @@ #include "internal.h" #include "net/manaserv/connection.h" +#include "net/manaserv/messageout.h" #include "net/manaserv/protocol.h" -#include "net/messageout.h" - #include "log.h" -void Net::ChatServer::Party::invitePlayer(const std::string &name) +namespace ManaServ +{ + +void ChatServer::Party::invitePlayer(const std::string &name) { logger->log("Sending PCMSG_PARTY_INVITE"); MessageOut msg(PCMSG_PARTY_INVITE); msg.writeString(name); - Net::ChatServer::connection->send(msg); + ChatServer::connection->send(msg); } -void Net::ChatServer::Party::acceptInvite(const std::string &name) +void ChatServer::Party::acceptInvite(const std::string &name) { logger->log("Sending PCMSG_PARTY_ACCEPT_INVITE"); MessageOut msg(PCMSG_PARTY_ACCEPT_INVITE); msg.writeString(name); - Net::ChatServer::connection->send(msg); + ChatServer::connection->send(msg); } -void Net::ChatServer::Party::rejectInvite(const std::string &name) +void ChatServer::Party::rejectInvite(const std::string &name) { logger->log("Sending PCMSG_PARTY_REJECT_INVITE"); MessageOut msg(PCMSG_PARTY_REJECT_INVITE); msg.writeString(name); - Net::ChatServer::connection->send(msg); + ChatServer::connection->send(msg); } -void Net::ChatServer::Party::getPartyMembers() +void ChatServer::Party::getPartyMembers() { logger->log("Sending PCMSG_PARTY_GET_MEMBERS"); // MessageOut msg(PCMSG_GUILD_GET_MEMBERS); // msg.writeInt16(guildId); -// Net::ChatServer::connection->send(msg); +// ChatServer::connection->send(msg); } -void Net::ChatServer::Party::quitParty() +void ChatServer::Party::quitParty() { logger->log("Sending PCMSG_PARTY_QUIT"); MessageOut msg(PCMSG_PARTY_QUIT); - Net::ChatServer::connection->send(msg); + ChatServer::connection->send(msg); +} + } diff --git a/src/net/manaserv/chatserver/party.h b/src/net/manaserv/chatserver/party.h index 3850c283..34f308f7 100644 --- a/src/net/manaserv/chatserver/party.h +++ b/src/net/manaserv/chatserver/party.h @@ -19,12 +19,12 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef NET_CHATSERVER_PARTY_H -#define NET_CHATSERVER_PARTY_H +#ifndef NET_MANASERV_CHATSERVER_PARTY_H +#define NET_MANASERV_CHATSERVER_PARTY_H #include <iosfwd> -namespace Net +namespace ManaServ { namespace ChatServer { @@ -58,4 +58,4 @@ namespace Net } } -#endif +#endif // NET_MANASERV_CHATSERVER_PARTY_H |