diff options
Diffstat (limited to 'src/net/chatserver')
-rw-r--r-- | src/net/chatserver/guild.cpp | 26 | ||||
-rw-r--r-- | src/net/chatserver/guild.h | 11 |
2 files changed, 26 insertions, 11 deletions
diff --git a/src/net/chatserver/guild.cpp b/src/net/chatserver/guild.cpp index 441a52c2..c1114065 100644 --- a/src/net/chatserver/guild.cpp +++ b/src/net/chatserver/guild.cpp @@ -36,9 +36,9 @@ void Net::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); } @@ -46,10 +46,10 @@ void Net::ChatServer::Guild::invitePlayer(const std::string &name, short guildId { logger->log("Sending PCMSG_GUILD_INVITE"); MessageOut msg(PCMSG_GUILD_INVITE); - + msg.writeInt16(guildId); msg.writeString(name); - + Net::ChatServer::connection->send(msg); } @@ -57,9 +57,9 @@ void Net::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); } @@ -67,8 +67,18 @@ void Net::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); +} + +void Net::ChatServer::Guild::quitGuild(short guildId) +{ + logger->log("Sending PCMSG_GUILD_QUIT"); + MessageOut msg(PCMSG_GUILD_QUIT); + + msg.writeInt16(guildId); + Net::ChatServer::connection->send(msg); } diff --git a/src/net/chatserver/guild.h b/src/net/chatserver/guild.h index 849cd0a4..5800c738 100644 --- a/src/net/chatserver/guild.h +++ b/src/net/chatserver/guild.h @@ -37,21 +37,26 @@ namespace Net * Create guild. */ void createGuild(const std::string &name); - + /** * Invite a player to your guild. */ void invitePlayer(const std::string &name, short guildId); - + /** * Accept an invite another player has sent to join their guild. */ void acceptInvite(const std::string &name); - + /** * Get a list of members in a guild. */ void getGuildMembers(short guildId); + + /** + * Quit guild. + */ + void quitGuild(short guildId); } } } |