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

📄 zonegroup.h

📁 天之炼狱1服务器端源文件游戏服务端不完整
💻 H
字号:
////////////////////////////////////////////////////////////////////////// Filename    : ZoneGroup.h// Written By  : reiot@ewestsoft.com// Description :////////////////////////////////////////////////////////////////////////#ifndef __ZONE_GROUP_H__#define __ZONE_GROUP_H__// include files#include "Types.h"#include "Exception.h"#include <hash_map>#include "Zone.h"#include "GameTime.h"#include "Gpackets/GMServerInfo.h"// forward declarationclass ZoneThread;class ZonePlayerManager;// type redefinition//typedef hash_map<ZoneID_t,Zone*> ZONE_HASHMAP;////////////////////////////////////////////////////////////////////////// class ZoneGroup;////////////////////////////////////////////////////////////////////////class ZoneGroup {		// friend declaration	friend class ZoneThread;public:		// constructor	ZoneGroup(ZoneGroupID_t zoneGroupID) throw();		// destructor	~ZoneGroup() throw();	public:		// initialize zone group	void init() throw(Error);		// load sub zones from database	void load() throw(Error);		// save sub zones to database	void save() throw(Error);	//	void processPlayers() throw(Error);	void heartbeat() throw(Error);		public:	// add zone to zone group	void addZone(Zone* pZone) throw(Error);		// delete zone from zone group	void deleteZone(ZoneID_t zoneID) throw(NoSuchElementException);	Zone* removeZone(ZoneID_t zoneID) throw(NoSuchElementException);		// get zone from zone group	Zone* getZone(ZoneID_t zoneID) const throw(NoSuchElementException);//#ifdef __NO_COMBAT__	Zone* getCombatZone(ZoneID_t zoneID) const throw(Error); // getZone苞 鞍篮 老阑 荐青窍唱 NULL阑 府畔窍绰 巴捞 啊瓷, 辫版籍//#endif//--------------------------------------------------// get/set methods//--------------------------------------------------public:	// get/set zone group id	ZoneGroupID_t getZoneGroupID() const throw() { return m_ZoneGroupID; }	void setZoneGroupID(ZoneGroupID_t zoneGroupID) throw() { m_ZoneGroupID = zoneGroupID; }	// get zone player manager	ZonePlayerManager* getZonePlayerManager() throw() { return m_pZonePlayerManager; }	void setZonePlayerManager(ZonePlayerManager* pZonePlayerManager) throw() { m_pZonePlayerManager = pZonePlayerManager; }	// get/set game time	GameTime getGameTime() const throw() { return m_GameTime; }	void setGameTime(const GameTime & gameTime) throw() { m_GameTime = gameTime; }	void makeZoneUserInfo ( GMServerInfo & gmServerInfo ) throw(Error);	const hash_map< ZoneID_t, Zone* >& getZones() const { return m_Zones; }	// get debug string	string toString() const throw();public :	void 	lock() throw (Error)		{ m_Mutex.lock(); }	void 	unlock() throw (Error)		{ m_Mutex.unlock(); }	  void   initLoadValue();      DWORD  getLoadValue() const;//--------------------------------------------------// data members//--------------------------------------------------private:	// zone group id	ZoneGroupID_t m_ZoneGroupID;		// zone 狼 秦浆甘	hash_map< ZoneID_t, Zone* > m_Zones;	// zone player manager	ZonePlayerManager* m_pZonePlayerManager;	// game time	GameTime m_GameTime;	// Tick Time	Timeval m_TickTime;	DWORD	m_LoadValue;	mutable Mutex  m_Mutex;};#endif

⌨️ 快捷键说明

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