pcfinder.h

来自「天之炼狱1服务器端源文件游戏服务端不完整」· C头文件 代码 · 共 76 行

H
76
字号
//////////////////////////////////////////////////////////////////////////////// Filename    : PCFinder.h// Written By  : Reiot// Description ://////////////////////////////////////////////////////////////////////////////#ifndef __PC_FINDER_H__#define __PC_FINDER_H__#include "Types.h"#include "Exception.h"#include "Creature.h"#include "NPC.h"#include "Mutex.h"#include <hash_map>//////////////////////////////////////////////////////////////////////////////// class PCFinder;// 霸烙 辑滚狼 臂肺国 概聪历 按眉肺, PC 捞抚阑 荤侩秦辑 PC按眉俊 立辟且 荐 乐档废// 秦霖促. 郴何利栏肺 hash_map 阑 荤侩秦辑, 八祸 加档甫 氢惑矫挪促.//////////////////////////////////////////////////////////////////////////////class PCFinder {public:	PCFinder() throw();	~PCFinder() throw();public:	// add creature to hash_map	// execute just once at PC's login	void addCreature(Creature* pCreature) throw(DuplicatedException, Error);	// delete creature from hash_map	// execute just once at PC's logout	void deleteCreature(const string & name) throw();//NoSuchElementException, Error);	// get creature with PC-name	Creature* getCreature(const string & name) const throw(); //NoSuchElementException, Error);	// get creature with PC-name	Creature* getCreature_LOCKED(const string & name) const throw(); //NoSuchElementException, Error);	// PlayerID. for BillingServer. by sigi. 2002.11.18	Creature* getCreatureByID(const string & ID) const throw(); //NoSuchElementException, Error);	Creature* getCreatureByID_LOCKED(const string & ID) const throw(); //NoSuchElementException, Error);	// add NPC to hash_map	void addNPC(NPC *npc) throw(DuplicatedException, Error);		// delete NPC from hash_map	void deleteNPC(const string & name) throw();	// get NPC 	NPC* getNPC(const string & name) const throw();	NPC* getNPC_LOCKED(const string & name) const throw();	// get creature's IP address	IP_t getIP(const string & name) const throw(NoSuchElementException, Error);	void lock() throw(Error) { m_Mutex.lock(); }	void unlock() throw(Error) { m_Mutex.unlock(); }private:	hash_map< string, Creature* > 	m_PCs;	hash_map< string, Creature* > 	m_IDs;	// PlayerID. for BillingServer. by sigi. 2002.11.18	hash_map< string, NPC* > 		m_NPCs;	// NPCs.. for NPC trace ;; by DEW  2003. 04. 16	mutable Mutex m_Mutex;};// global variable declarationextern PCFinder* g_pPCFinder;#endif

⌨️ 快捷键说明

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