00001 /* 00002 * The Mana World Server 00003 * Copyright 2004 The Mana World Development Team 00004 * 00005 * This file is part of The Mana World. 00006 * 00007 * The Mana World is free software; you can redistribute it and/or modify it 00008 * under the terms of the GNU General Public License as published by the Free 00009 * Software Foundation; either version 2 of the License, or any later version. 00010 * 00011 * The Mana World is distributed in the hope that it will be useful, but 00012 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 00013 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 00014 * more details. 00015 * 00016 * You should have received a copy of the GNU General Public License along 00017 * with The Mana World; if not, write to the Free Software Foundation, Inc., 00018 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 */ 00020 00021 #ifndef TMW_CHATSERVER_GUILDMANAGER_H 00022 #define TMW_CHATSERVER_GUILDMANAGER_H 00023 00024 #include <list> 00025 #include <string> 00026 #include <vector> 00027 00028 class Guild; 00029 class ChatClient; 00030 00034 class GuildManager 00035 { 00036 public: 00040 GuildManager(); 00041 00045 ~GuildManager(); 00046 00050 Guild* createGuild(const std::string &name, int playerId); 00051 00055 void removeGuild(Guild *guild); 00056 00060 void addGuildMember(Guild *guild, int playerId); 00061 00065 void removeGuildMember(Guild *guild, int playerId); 00066 00076 Guild *findById(short id); 00077 00083 Guild *findByName(const std::string &name); 00084 00088 bool doesExist(const std::string &name); 00089 00093 std::vector<Guild*> getGuildsForPlayer(int playerId); 00094 00098 void disconnectPlayer(ChatClient* player); 00099 00106 int changeMemberLevel(ChatClient *player, Guild *guild, 00107 int playerId, int level); 00108 00112 bool alreadyOwner(int playerId); 00113 00117 void setUserRights(Guild *guild, int playerId, int rights); 00118 00119 private: 00120 std::list<Guild*> mGuilds; 00121 std::list<int> mOwners; 00122 }; 00123 00124 extern GuildManager *guildManager; 00125 00126 #endif