📄 pcfinder.h
字号:
//////////////////////////////////////////////////////////////////////////////// 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -