From 67cb713c0fcd65f9f842c589c7e1c08f9af597f0 Mon Sep 17 00:00:00 2001 From: David Athay Date: Wed, 13 Aug 2008 15:31:48 +0000 Subject: Added permission levels to guilds, and operator permissions to channels. --- src/chat-server/guildmanager.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/chat-server/guildmanager.cpp') diff --git a/src/chat-server/guildmanager.cpp b/src/chat-server/guildmanager.cpp index 1cc3a4b6..4976eca5 100644 --- a/src/chat-server/guildmanager.cpp +++ b/src/chat-server/guildmanager.cpp @@ -155,3 +155,22 @@ void GuildManager::disconnectPlayer(ChatClient *player) GUILD_EVENT_OFFLINE_PLAYER); } } + +int GuildManager::changeMemberLevel(ChatClient *player, Guild *guild, + const std::string &name, int level) +{ + if (guild->checkInGuild(player->characterName) && guild->checkInGuild(name)) + { + int playerLevel = guild->getUserPermissions(player->characterName); + + if (playerLevel == GuildMember::LEADER) + { + // player can modify anyones permissions + guild->setUserPermissions(name, level); + return 0; + } + } + + return -1; +} + -- cgit v1.2.3-70-g09d2