summaryrefslogtreecommitdiff
path: root/src/net/chatserver/guild.cpp
diff options
context:
space:
mode:
authorDavid Athay <ko2fan@gmail.com>2008-03-12 10:44:11 +0000
committerDavid Athay <ko2fan@gmail.com>2008-03-12 10:44:11 +0000
commit3a275cc81fe9aa1cb6736cdf12211e13e93cf2cf (patch)
tree7908381183fea865b53814e591aceae17c7a6cc2 /src/net/chatserver/guild.cpp
parent16e99dc852affbc8b149d35037694dcdd25948e6 (diff)
downloadmana-client-3a275cc81fe9aa1cb6736cdf12211e13e93cf2cf.tar.gz
mana-client-3a275cc81fe9aa1cb6736cdf12211e13e93cf2cf.tar.bz2
mana-client-3a275cc81fe9aa1cb6736cdf12211e13e93cf2cf.tar.xz
mana-client-3a275cc81fe9aa1cb6736cdf12211e13e93cf2cf.zip
Added ability to quit guilds.
Diffstat (limited to 'src/net/chatserver/guild.cpp')
-rw-r--r--src/net/chatserver/guild.cpp26
1 files changed, 18 insertions, 8 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);
}