diff options
author | David Athay <ko2fan@gmail.com> | 2008-08-13 15:28:07 +0000 |
---|---|---|
committer | David Athay <ko2fan@gmail.com> | 2008-08-13 15:28:07 +0000 |
commit | b9d9ae443874efd4968a6efcf5ce050f213c497b (patch) | |
tree | 453d80d3e1d251efb60968c36023413cb4faf452 /src/net/chatserver | |
parent | 47247ac4e2f0860a34106f4b69049d91003ced29 (diff) | |
download | mana-client-b9d9ae443874efd4968a6efcf5ce050f213c497b.tar.gz mana-client-b9d9ae443874efd4968a6efcf5ce050f213c497b.tar.bz2 mana-client-b9d9ae443874efd4968a6efcf5ce050f213c497b.tar.xz mana-client-b9d9ae443874efd4968a6efcf5ce050f213c497b.zip |
Added permission levels to guilds, and operator permissions to channels.
Diffstat (limited to 'src/net/chatserver')
-rw-r--r-- | src/net/chatserver/chatserver.cpp | 22 | ||||
-rw-r--r-- | src/net/chatserver/chatserver.h | 4 | ||||
-rw-r--r-- | src/net/chatserver/guild.cpp | 13 | ||||
-rw-r--r-- | src/net/chatserver/guild.h | 6 |
4 files changed, 45 insertions, 0 deletions
diff --git a/src/net/chatserver/chatserver.cpp b/src/net/chatserver/chatserver.cpp index a2dbefbb..f302a0ef 100644 --- a/src/net/chatserver/chatserver.cpp +++ b/src/net/chatserver/chatserver.cpp @@ -124,3 +124,25 @@ void Net::ChatServer::setChannelTopic(short channel, const std::string &topic) connection->send(msg); } + +void Net::ChatServer::setUserMode(short channel, const std::string &user, + unsigned char mode) +{ + MessageOut msg(PCMSG_USER_MODE); + + msg.writeInt16(channel); + msg.writeString(user); + msg.writeInt8(mode); + + connection->send(msg); +} + +void Net::ChatServer::kickUser(short channel, const std::string &user) +{ + MessageOut msg(PCMSG_KICK_USER); + + msg.writeInt16(channel); + msg.writeString(user); + + connection->send(msg); +} diff --git a/src/net/chatserver/chatserver.h b/src/net/chatserver/chatserver.h index 56ad46ca..10de1213 100644 --- a/src/net/chatserver/chatserver.h +++ b/src/net/chatserver/chatserver.h @@ -52,6 +52,10 @@ namespace Net void setChannelTopic(short channel, const std::string &topic); + void setUserMode(short channel, const std::string &user, unsigned char mode); + + void kickUser(short channel, const std::string &user); + } } diff --git a/src/net/chatserver/guild.cpp b/src/net/chatserver/guild.cpp index c1114065..fb400d5d 100644 --- a/src/net/chatserver/guild.cpp +++ b/src/net/chatserver/guild.cpp @@ -73,6 +73,19 @@ void Net::ChatServer::Guild::getGuildMembers(short guildId) Net::ChatServer::connection->send(msg); } +void Net::ChatServer::Guild::promoteMember(const std::string &name, + short guildId, short level) +{ + logger->log("Sending PCMSG_GUILD_PROMOTE_MEMBER"); + MessageOut msg(PCMSG_GUILD_PROMOTE_MEMBER); + + msg.writeInt16(guildId); + msg.writeString(name); + msg.writeInt8(level); + + Net::ChatServer::connection->send(msg); +} + void Net::ChatServer::Guild::quitGuild(short guildId) { logger->log("Sending PCMSG_GUILD_QUIT"); diff --git a/src/net/chatserver/guild.h b/src/net/chatserver/guild.h index 5800c738..354ecd82 100644 --- a/src/net/chatserver/guild.h +++ b/src/net/chatserver/guild.h @@ -54,6 +54,12 @@ namespace Net void getGuildMembers(short guildId); /** + * Promote guild member + */ + void promoteMember(const std::string &name, short guildId, + short level); + + /** * Quit guild. */ void quitGuild(short guildId); |