📄 guild.h
字号:
//////////////////////////////////////////////////////////////////////////////// Filename : Guild.h// Written by : bezz// Description ://////////////////////////////////////////////////////////////////////////////#ifndef __GUILD_H__#define __GUILD_H__#include "Types.h"#include "Assert.h"#include "Exception.h"#include "Mutex.h"#include <hash_map>#include <list>#include "VSDateTime.h"#ifdef __SHARED_SERVER__class GuildInfo2;#endifclass GuildInfo;class GCGuildMemberList;//////////////////////////////////////////////////////////////////////////////// class GuildMember// 辨靛糕滚俊 包茄 沥焊甫 啊柳促.////////////////////////////////////////////////////////////////////////////////#ifdef __CHINA_SERVER__const Gold_t REQUIRE_SLAYER_MASTER_GOLD = 50000000;const Gold_t REQUIRE_VAMPIRE_MASTER_GOLD = 50000000;const Gold_t REQUIRE_OUSTERS_MASTER_GOLD = 50000000;const Gold_t REQUIRE_SLAYER_SUBMASTER_GOLD = 25000000;const Gold_t REQUIRE_VAMPIRE_SUBMASTER_GOLD = 25000000;const Gold_t REQUIRE_OUSTERS_SUBMASTER_GOLD = 25000000;const Gold_t RETURN_SLAYER_MASTER_GOLD = 0;const Gold_t RETURN_VAMPIRE_MASTER_GOLD = 0;const Gold_t RETURN_OUSTERS_MASTER_GOLD = 0;const Gold_t RETURN_SLAYER_SUBMASTER_GOLD = 0;const Gold_t RETURN_VAMPIRE_SUBMASTER_GOLD = 0;const Gold_t RETURN_OUSTERS_SUBMASTER_GOLD = 0;const Fame_t REQUIRE_SLAYER_MASTER_FAME[SKILL_DOMAIN_ETC] ={ 500000, // SKILL_DOMAIN_BLADE 500000, // SKILL_DOMAIN_SWORD 500000, // SKILL_DOMAIN_GUN 100000, // SKILL_DOMAIN_HEAL 150000 // SKILL_DOMAIN_ENCHANT};const Fame_t REQUIRE_SLAYER_SUBMASTER_FAME[SKILL_DOMAIN_ETC] ={ 400000, // SKILL_DOMAIN_BLADE 400000, // SKILL_DOMAIN_SWORD 400000, // SKILL_DOMAIN_GUN 75000, // SKILL_DOMAIN_HEAL 125000 // SKILL_DOMAIN_ENCHANT};#elseconst Gold_t REQUIRE_SLAYER_MASTER_GOLD = 100000000;const Gold_t REQUIRE_VAMPIRE_MASTER_GOLD = 100000000;const Gold_t REQUIRE_OUSTERS_MASTER_GOLD = 100000000;const Gold_t REQUIRE_SLAYER_SUBMASTER_GOLD = 50000000;const Gold_t REQUIRE_VAMPIRE_SUBMASTER_GOLD = 50000000;const Gold_t REQUIRE_OUSTERS_SUBMASTER_GOLD = 50000000;const Gold_t RETURN_SLAYER_MASTER_GOLD = 90000000;const Gold_t RETURN_VAMPIRE_MASTER_GOLD = 90000000;const Gold_t RETURN_OUSTERS_MASTER_GOLD = 90000000;const Gold_t RETURN_SLAYER_SUBMASTER_GOLD = 45000000;const Gold_t RETURN_VAMPIRE_SUBMASTER_GOLD = 45000000;const Gold_t RETURN_OUSTERS_SUBMASTER_GOLD = 45000000;const Fame_t REQUIRE_SLAYER_MASTER_FAME[SKILL_DOMAIN_ETC] ={ 1000000, // SKILL_DOMAIN_BLADE 1000000, // SKILL_DOMAIN_SWORD 1000000, // SKILL_DOMAIN_GUN 200000, // SKILL_DOMAIN_HEAL 300000 // SKILL_DOMAIN_ENCHANT};const Fame_t REQUIRE_SLAYER_SUBMASTER_FAME[SKILL_DOMAIN_ETC] ={ 800000, // SKILL_DOMAIN_BLADE 800000, // SKILL_DOMAIN_SWORD 800000, // SKILL_DOMAIN_GUN 150000, // SKILL_DOMAIN_HEAL 250000 // SKILL_DOMAIN_ENCHANT};#endifconst SkillLevel_t REQUIRE_SLAYER_MASTER_SKILL_DOMAIN_LEVEL = 50;const Level_t REQUIRE_VAMPIRE_MASTER_LEVEL = 50; const Level_t REQUIRE_OUSTERS_MASTER_LEVEL = 50; const SkillLevel_t REQUIRE_SLAYER_SUBMASTER_SKILL_DOMAIN_LEVEL = 40;const Level_t REQUIRE_VAMPIRE_SUBMASTER_LEVEL = 40; const Level_t REQUIRE_OUSTERS_SUBMASTER_LEVEL = 40; class GuildMember{public: GuildMember() throw();///// Member constants /////public: enum GuildRank { GUILDMEMBER_RANK_NORMAL = 0, // 老馆 糕滚 GUILDMEMBER_RANK_MASTER, // 辨靛 付胶磐 GUILDMEMBER_RANK_SUBMASTER, // 辨靛 辑宏 付胶磐 GUILDMEMBER_RANK_WAIT, // 辨靛 啊涝 措扁 GUILDMEMBER_RANK_DENY, // 眠规/芭何 寸窃 GUILDMEMBER_RANK_LEAVE, // 辨靛 呕硼(胶胶肺) GUILDMEMBER_RANK_MAX }; public: // DB methods void create() throw(); bool load() throw(); void save() throw(); void destroy() throw(); void expire() throw(); void leave() throw(); void saveIntro( const string& intro ) throw(); string getIntro() const throw(); public: // identity methods GuildID_t getGuildID() const throw() { return m_GuildID; } void setGuildID(GuildID_t guildID) throw() { m_GuildID = guildID; } string getName() const throw() { return m_Name; } void setName(const string& name) throw() { m_Name = name; } GuildMemberRank_t getRank() const throw() { return m_Rank; } void setRank(GuildMemberRank_t rank) throw(); // Guild class 俊辑 贸府茄促. bool getLogOn() const throw() { return m_bLogOn; } void setLogOn( bool logOn ) throw() { m_bLogOn = logOn; } string getRequestDateTime() const throw(); void setRequestDateTime( const VSDateTime& vsdatetime ) throw() { m_RequestDateTime = vsdatetime; } void setRequestDateTime( const string& rdatetime ) throw(); bool isRequestDateTimeOut( const VSDateTime& currentDateTime ) const throw();public: // debug string toString() const throw();///// operator overloadgin /////public: GuildMember& operator = ( GuildMember& Member );///// Member data /////protected: GuildID_t m_GuildID; // 辨靛 ID string m_Name; // 糕滚 捞抚 GuildMemberRank_t m_Rank; // 糕滚狼 拌鞭 VSDateTime m_RequestDateTime; // 啊涝 脚没 矫埃 bool m_bLogOn; // 立加 咯何};//////////////////////////////////////////////////////////////////////////////// class Guild// 辨靛俊 包茄 沥焊甫 啊柳促.//// GuildInfo 抛捞喉狼 备炼// ----------------------------------------// GuildID INT// GuildName VARCHAR(20)// GuildType TINYINT// GuildGold INT// ----------------------------------------//////////////////////////////////////////////////////////////////////////////#define MAX_GUILDMEMBER_ACTIVE_COUNT 230#define MAX_GUILDMEMBER_WAIT_COUNT 15typedef hash_map<string, GuildMember*> HashMapGuildMember;typedef HashMapGuildMember::iterator HashMapGuildMemberItor;typedef HashMapGuildMember::const_iterator HashMapGuildMemberConstItor;class Guild{///// Member constants /////public: enum GuildTypes { GUILD_TYPE_NORMAL = 0, // 老馆 辨靛 GUILD_TYPE_JUDGE, // 魄包 辨靛 GUILD_TYPE_ASSASSIN, // 鞠混磊 辨靛 GUILD_TYPE_MAX }; enum GuildState { GUILD_STATE_ACTIVE = 0, // 劝悼 吝牢 辨靛 GUILD_STATE_WAIT, // 殿废 措扁 吝牢 辨靛 GUILD_STATE_CANCEL, // 秒家等 辨靛 GUILD_STATE_BROKEN, // 秦眉等 辨靛 GUILD_STATE_MAX }; enum GuildRace { GUILD_RACE_SLAYER = 0, // 浇饭捞绢 辨靛 GUILD_RACE_VAMPIRE, // 轨颇捞绢 辨靛 GUILD_RACE_OUSTERS, // 酒快胶磐令 辨靛 GUILD_RACE_MAX };public: // constructor & destructor Guild() throw(); virtual ~Guild() throw();public: // DB methods void create() throw(); bool load() throw(); void save() throw(); void destroy() throw(); public: // identity methods GuildID_t getID() const throw() { return m_ID; } void setID(GuildID_t id) throw() { m_ID = id; } string getName() const throw() { return m_Name; } void setName(const string& name) throw() { m_Name = name; } GuildType_t getType() const throw() { return m_Type; } void setType(GuildType_t type) throw() { m_Type = type; } GuildRace_t getRace() const throw() { return m_Race; } void setRace( GuildRace_t race ) throw() { m_Race = race; } GuildState_t getState() const throw() { return m_State; } void setState(GuildState_t state) throw() { m_State = state; } ServerGroupID_t getServerGroupID() const throw() { return m_ServerGroupID; } void setServerGroupID( ServerGroupID_t serverGroupID ) throw() { m_ServerGroupID = serverGroupID; } ZoneID_t getZoneID() const throw() { return m_ZoneID; } void setZoneID( ZoneID_t zoneID ) throw() { m_ZoneID = zoneID; } string getMaster() const throw() { return m_Master; } void setMaster(const string& master) throw() { m_Master = master; } string getDate() const throw() { return m_Date; } void setDate( const string& Date ) throw() { m_Date = Date; } string getIntro() const throw() { return m_Intro; } void setIntro( const string& intro ) throw() { m_Intro = intro; }#ifdef __SHARED_SERVER__ void saveIntro( const string& intro ) throw(); void tinysave( const char* field ) const throw();#endif///// GuildMember get/add/delete/modify ///// GuildMember* getMember( const string& name ) const throw(); GuildMember* getMember_NOLOCKED( const string& name ) const throw(); void addMember( GuildMember* pMember ) throw( DuplicatedException, Error ); void deleteMember( const string& name ) throw(); void modifyMember( GuildMember& Member ) throw(); void modifyMemberRank( const string& name, GuildMemberRank_t rank ) throw(); HashMapGuildMember& getMembers() throw() { return m_Members; } int getActiveMemberCount() const throw() { return m_ActiveMemberCount; } int getWaitMemberCount() const throw() { return m_WaitMemberCount; }#ifdef __GAME_SERVER__ void addCurrentMember( const string& name ) throw( DuplicatedException, Error ); void deleteCurrentMember( const string& name ) throw( NoSuchElementException ); list<string> getCurrentMembers() throw();#endif#ifdef __SHARED_SERVER__ void makeInfo( GuildInfo2* pGulidInfo ) throw();#endif void makeInfo( GuildInfo* pGuildInfo ) throw(); void makeMemberInfo( GCGuildMemberList& gcGuildMemberList ) throw();public: // static static GuildID_t getMaxGuildID() throw() { return m_MaxGuildID; } static void setMaxGuildID(GuildID_t id) throw() { m_MaxGuildID = id; } static ZoneID_t getMaxSlayerZoneID() throw() { return m_MaxSlayerZoneID; } static void setMaxSlayerZoneID( ZoneID_t zoneID ) throw() { m_MaxSlayerZoneID = zoneID; } static ZoneID_t getMaxVampireZoneID() throw() { return m_MaxVampireZoneID; } static void setMaxVampireZoneID( ZoneID_t zoneID ) throw() { m_MaxVampireZoneID = zoneID; } static ZoneID_t getMaxOustersZoneID() throw() { return m_MaxOustersZoneID; } static void setMaxOustersZoneID( ZoneID_t zoneID ) throw() { m_MaxOustersZoneID = zoneID; }public: void expireTimeOutWaitMember( VSDateTime currentDateTime, list<string>& mList ) throw(Error);public: // debug string toString() const throw(); static string correctString( const string& str ) throw();///// Member data /////protected: GuildID_t m_ID; // 辨靛 ID string m_Name; // 辨靛 捞抚 GuildType_t m_Type; // 辨靛 鸥涝 GuildRace_t m_Race; // 辨靛 辆练 GuildState_t m_State; // 辨靛 惑怕 ServerGroupID_t m_ServerGroupID; // 辨靛 粮捞 乐绰 辑滚 弊缝 ID ZoneID_t m_ZoneID; // 辨靛 ZoneID string m_Master; // 辨靛 付胶磐 string m_Date; // 辨靛 Expire, Regist Date string m_Intro; // 辨靛 家俺 HashMapGuildMember m_Members; // 辨靛 糕滚 器牢磐 甘 int m_ActiveMemberCount; // Active Member Count int m_WaitMemberCount; // Wait Member Count static GuildID_t m_MaxGuildID; // 辨靛 酒捞叼 弥措蔼 static ZoneID_t m_MaxSlayerZoneID; // 浇饭捞绢 辨靛 粮 ID 弥措蔼 static ZoneID_t m_MaxVampireZoneID; // 轨颇捞绢 辨靛 粮 ID 弥措蔼 static ZoneID_t m_MaxOustersZoneID; // 酒快胶磐令 辨靛 粮 ID 弥措蔼 mutable Mutex m_Mutex; // Mutex for Guild#ifdef __GAME_SERVER__ list<string> m_CurrentMembers; // 泅犁 立加 吝牢 糕滚#endif};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -