Files
Sun1602/Tools/SunUpdateManager/SunUpdateServer/World.h
T
2022-10-26 12:25:11 +08:00

61 lines
1.8 KiB
C++

#pragma once
#include <SolarHashTable.h>
#include <MemoryPoolFactory.h>
class Channel; class UnitServer;
typedef util::SolarHashTable<Channel *> CHANNEL_HASH;
typedef CHANNEL_HASH::iterator CHANNEL_HASH_ITR;
class World
{
enum { DEFAULT_CHANNEL_POOL_SIZE = 5 };
friend class WorldManager;
public:
World();
~World();
VOID Init( BYTE byWorldKey );
VOID Release();
BYTE GetKey() { return m_byWorldKey; }
Channel * AllocChannel( BYTE byChannelKey );
VOID FreeChannel( Channel *pChannel );
// 서버 구동, 종료, 패치
VOID ExecuteStart( DWORD dwUserKey );
VOID ExecuteEnd( DWORD dwUserKey );
BOOL ExecutePatch( DWORD dwUserKey );
VOID ExecuteForceDisconnect( DWORD dwUserKey );
VOID SetServerStatus( eSERVER_STATUS status );
BOOL CheckServerStatus( eSERVER_STATUS CheckStatus );
BOOL CheckPatching();
VOID SerializeServerInfoStream( SERVER_TOTAL_INFO & OUT rServerTotInfo );
VOID SerializeServerInfoStreamForUser( SERVER_TOTAL_INFO & OUT rServerTotInfo, DWORD dwUserGUID );
VOID SerializeFtpInfoStreamForUser( FTP_TOTAL_INFO & OUT rFtpTotInfo, DWORD dwUserGUID );
#ifdef __20080312__SOLARAUTH_SERVER_PATCH
VOID SerializeScriptFolderInfoStream( SCRIPTFOLDER_TOTAL_INFO& OUT rSCFolderTotInfo, DWORD dwUserGUID );
#endif
Channel * FindChannel( BYTE byChannelKey ) { return m_ChannelHash.GetData( byChannelKey ); }
UnitServer * FindUnitServer( DWORD dwAgentKey, BYTE byServerType );
UnitServer* FindSunServer();
#ifdef _NA_006543_20130318_HEARTBEAT
//AgentKey 하나로 그 Agent에 속한 채널,서버들을 알기 위한 함수들
UnitServer * FindFirstUnitServerByAgentKey(DWORD dwAgentKey); // 해당 agentkey를 가진 서버를 리턴
#endif
private:
BYTE m_byWorldKey;
CHANNEL_HASH m_ChannelHash;
CMemoryPoolFactory<Channel> * m_pChannelPool;
};