⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 party.h

📁 天之炼狱1服务器端源文件游戏服务端不完整
💻 H
字号:
//////////////////////////////////////////////////////////////////////////////// Filename    : Party.h// Written by  : excel96// Description ://////////////////////////////////////////////////////////////////////////////#ifndef __PARTY_H__#define __PARTY_H__#include "Creature.h"#include "Mutex.h"#include "ModifyInfo.h"#include "Mutex.h"#include <hash_map>#include <list>// 颇萍狼 弥措 农扁const int PARTY_MAX_SIZE = 6;//////////////////////////////////////////////////////////////////////////////// forward declaration//////////////////////////////////////////////////////////////////////////////class Packet;class GCPartyJoined;class Creature;//////////////////////////////////////////////////////////////////////////////// class PartyInviteInfo//////////////////////////////////////////////////////////////////////////////class PartyInviteInfo{public:	PartyInviteInfo() { m_HostName = ""; m_GuestName = ""; }	~PartyInviteInfo() {}public:	string getHostName(void) const { return m_HostName; }	void setHostName(const string& name) { m_HostName = name; }	string getGuestName(void) const { return m_GuestName; }	void setGuestName(const string& name) { m_GuestName = name; }public:	string toString(void) const throw();protected:	string m_HostName;	string m_GuestName;};//////////////////////////////////////////////////////////////////////////////// class PartyInviteInfoManager//////////////////////////////////////////////////////////////////////////////class PartyInviteInfoManager{public:	PartyInviteInfoManager() throw();	~PartyInviteInfoManager() throw();public:	bool hasInviteInfo(const string& HostName) throw (Error);	bool canInvite(Creature* pHost, Creature* pGuest) throw (Error);	bool isInviting(Creature* pHost, Creature* pGuest) throw (Error);	void initInviteInfo(Creature* pHost, Creature* pGuest) throw (Error);	void cancelInvite(Creature* pHost, Creature* pGuest) throw (Error);	void cancelInvite(Creature* pCreature) throw (Error);public:	bool addInviteInfo(PartyInviteInfo* pInfo) throw (Error);	void deleteInviteInfo(const string& HostName) throw (NoSuchElementException, Error);	PartyInviteInfo* getInviteInfo(const string& HostName) throw (NoSuchElementException, Error);protected:	hash_map<string, PartyInviteInfo*> m_InfoMap;	Mutex m_Mutex;};//////////////////////////////////////////////////////////////////////////////// class Party//////////////////////////////////////////////////////////////////////////////class Party{public:	Party(Creature::CreatureClass CClass) throw();	~Party() throw();public:	int getID(void) const { return m_ID; }	void setID(int ID) { m_ID = ID; }	Creature::CreatureClass getCreatureClass(void) const { return m_CreatureClass; }public:	Creature* getMember(const string& name) const throw (NoSuchElementException, Error);	void addMember(Creature* pCreature) throw (DuplicatedException, Error);	void deleteMember(const string& name) throw (NoSuchElementException, Error);	bool hasMember(const string& name) const throw();	// 臂肺国 颇萍 概聪历俊辑父 荤侩茄促.	// 颇萍甫 秦眉窍扁 傈俊 颇萍 糕滚甸狼 颇萍 ID甫 0栏肺 父甸绊,	// 肺拿 颇萍 概聪历俊辑 秦寸 ID甫 啊柳 颇萍甫 昏力茄促.	void destroyParty(void) throw();public:	// 颇萍 糕滚甸俊霸 菩哦阑 朝赴促.	void broadcastPacket(Packet* pPacket, Creature* pOwner=NULL) throw (ProtocolException, Error);	// 货肺款 颇萍盔捞 眠啊登菌阑 锭 颇萍盔甸俊霸 朝酒啊绰	// GCPartyJoined 菩哦阑 备己茄促.	void makeGCPartyJoined(GCPartyJoined* pGCPartyJoined) const throw();public:	int getSize(void) const throw();	hash_map<string, Creature*> getMemberMap(void) throw();	// 辟立茄 芭府(8鸥老) 郴俊 乐绰 糕滚甸狼 箭磊甫 府畔茄促.	int getAdjacentMemberSize(Creature* pLeader) const throw();	int getAdjacentMemberSize_LOCKED(Creature* pLeader) const throw();	// 版氰摹甫 何钱妨辑 唱传促.	int shareAttrExp(Creature* pLeader, int amount, int STRMultiplier, int DEXMultiplier, int INTMultiplier, ModifyInfo& LeaderModifyInfo) const throw();	int shareVampireExp(Creature* pLeader, int amount, ModifyInfo& LeaderModifyInfo) const throw();	int shareOustersExp(Creature* pLeader, int amount, ModifyInfo& LeaderModifyInfo) const throw();public:	void shareRevealer(Creature* pCaster, int Duration) throw (Error);	void shareDetectHidden(Creature* pCaster, int Duration) throw (Error);	void shareDetectInvisibility(Creature* pCaster, int Duration) throw (Error);	void shareExpansion(Creature* pCaster, int Duration, int percent) throw (Error);	void shareActivation(Creature* pCaster, int Duration) throw (Error);	void shareGnomesWhisper(Creature* pCaster, int Duration, int SkillLevel) throw (Error);	void shareHolyArmor(Creature* pCaster, int DefBonus, int SkillLevel) throw (Error);	bool shareWaterElementalHeal(Creature* pCaster, int HealPoint) throw (Error);	void shareRankExp(Creature* pLeader, int amount) throw ();public:	bool isFamilyPay() const { return m_bFamilyPay; }	void refreshFamilyPay();public:	string toString(void) const throw();protected:	int                          m_ID;            // 颇萍 ID	Creature::CreatureClass      m_CreatureClass; // 颇萍狼 辆幅	hash_map<string, Creature*>  m_MemberMap;     // 颇萍 糕滚	mutable Mutex                m_Mutex;         // 郴何俊辑 静绰 遏	bool						 m_bFamilyPay;	  // 菩剐府 夸陛力 利侩 颇萍牢啊?};//////////////////////////////////////////////////////////////////////////////// class PartyManager//////////////////////////////////////////////////////////////////////////////class PartyManager{public:	PartyManager() throw();	virtual ~PartyManager() throw();public:	virtual bool createParty(int ID, Creature::CreatureClass) throw (DuplicatedException, Error);	virtual bool addPartyMember(int ID, Creature* pCreature) throw (NoSuchElementException, DuplicatedException, Error);	virtual bool deletePartyMember(int ID, Creature* pCreature) throw (NoSuchElementException, Error);	virtual Party* getParty(int ID) throw (NoSuchElementException, Error);public:	virtual string toString(void) const throw() = 0;protected:	hash_map<int, Party*> m_PartyMap; // 颇萍 笼钦	mutable Mutex m_Mutex;};//////////////////////////////////////////////////////////////////////////////// class LocalPartyManager//////////////////////////////////////////////////////////////////////////////class LocalPartyManager : public PartyManager{public:	LocalPartyManager() throw();	virtual ~LocalPartyManager() throw();public:	void heartbeat(void) throw (Error);	int getAdjacentMemberSize(int PartyID, Creature* pLeader) const throw();	int shareAttrExp(int PartyID, Creature* pLeader, int amount, int STRMultiplier, int DEXMultiplier, int INTMultiplier, ModifyInfo& LeaderModifyInfo) const throw();	int shareVampireExp(int PartyID, Creature* pLeader, int amount, ModifyInfo& LeaderModifyInfo) const throw();	int shareOustersExp(int PartyID, Creature* pLeader, int amount, ModifyInfo& LeaderModifyInfo) const throw();	void shareRevealer(int PartyID, Creature* pCaster, int Duration) throw (Error);	void shareDetectHidden(int PartyID, Creature* pCaster, int Duration) throw (Error);	void shareDetectInvisibility(int PartyID, Creature* pCaster, int Duration) throw (Error);	void shareExpansion(int PartyID, Creature* pCaster, int Duration, int Percent) throw (Error);	void shareActivation(int PartyID, Creature* pCaster, int Duration) throw (Error);	void shareGnomesWhisper(int PartyID, Creature* pCaster, int Duration, int SkillLevel) throw (Error);	void shareHolyArmor(int PartyID, Creature* pCaster, int DefBonus, int SkillLevel) throw (Error);	bool shareWaterElementalHeal(int PartyID, Creature* pCaster, int HealPoint) throw (Error);		int shareRankExp(int PartyID, Creature* pLeader, int amount) const throw();public:	virtual string toString(void) const throw();};//////////////////////////////////////////////////////////////////////////////// class GlobalPartyManager//////////////////////////////////////////////////////////////////////////////class GlobalPartyManager : public PartyManager{public:	GlobalPartyManager() throw();	virtual ~GlobalPartyManager() throw();public:	bool canAddMember(int ID) throw (NoSuchElementException, Error);	virtual bool addPartyMember(int ID, Creature* pCreature) throw (NoSuchElementException, DuplicatedException, Error);	virtual bool deletePartyMember(int ID, Creature* pCreature) throw (NoSuchElementException, Error);	virtual bool expelPartyMember(int ID, Creature* pExpeller, const string& ExpelleeName) throw (NoSuchElementException, Error);	int registerParty(void) throw (Error);	void refreshFamilyPay(int ID);public:	virtual string toString(void) const throw();protected:	int m_PartyIDRegistry; // 颇萍 ID 积己磊};extern GlobalPartyManager* g_pGlobalPartyManager;//////////////////////////////////////////////////////////////////////////////// 祈狼甫 困茄 傈开 窃荐甸...//////////////////////////////////////////////////////////////////////////////void deleteAllPartyInfo(Creature* pCreature) throw();#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -