Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
84 lines
2.1 KiB
C++
84 lines
2.1 KiB
C++
#ifndef _CUSTOM_MANAGE_CLIENT_MANAGER_H_
|
|
#define _CUSTOM_MANAGE_CLIENT_MANAGER_H_
|
|
|
|
#pragma warning(disable:4800)
|
|
|
|
#include <winsock2.h>
|
|
#include <windows.h>
|
|
#include <map>
|
|
#include <boost/pool/pool_alloc.hpp>
|
|
#include <Network/Packet/ManagePacketCmd.h>
|
|
|
|
// forward decl.
|
|
class CSession;
|
|
class CManageServerDB;
|
|
|
|
class CManageClientManager
|
|
{
|
|
public:
|
|
|
|
typedef std::map<unsigned long, ServerManage::RunInfo, std::less<unsigned long>,
|
|
boost::pool_allocator<std::pair<unsigned long, ServerManage::RunInfo> > > RunTable;
|
|
|
|
enum
|
|
{
|
|
MAX_RUNID = 0xFFFFFFFF
|
|
};
|
|
|
|
enum InfoType
|
|
{
|
|
SERVER_INFO,
|
|
RUN_PATH_INFO,
|
|
OPTION_INFO,
|
|
|
|
RUN_INFO
|
|
};
|
|
|
|
static CManageClientManager& GetInstance();
|
|
|
|
static bool SendRunInfo(CSession& Session, const RunTable& runTable);
|
|
|
|
// ----------------------------------------------------------------------------------------------
|
|
// 서버 정보 관련
|
|
bool Add(InfoType eInfoType, const ServerManage::RunInfo& runInfo, unsigned long& dwID_Out);
|
|
bool Modify(InfoType eInfoType, const ServerManage::RunInfo& runInfo);
|
|
bool Remove(InfoType eInfoType, unsigned long dwID, bool bDeleteRelated);
|
|
bool Get(InfoType eInfoType, RunTable& runTable);
|
|
|
|
// ----------------------------------------------------------------------------------------------
|
|
// 실행 정보 얻어오기
|
|
bool GetRunInfo(ServerManage::RunInfo* lpRunInfo_Out, size_t* nArrayNum_InOut);
|
|
bool GetRunInfo(unsigned long dwRunID, ServerManage::RunInfo& runInfo_Out);
|
|
|
|
bool HasRunInfo(unsigned long dwRunID);
|
|
|
|
void GetRunInfoFromIP(unsigned long dwServerIP, RunTable& runTable);
|
|
const RunTable& GetRunInfoTable() const { return m_RunTable; }
|
|
|
|
size_t GetRunInfoNum() { return m_RunTable.size(); }
|
|
|
|
template<typename FnProcess>
|
|
void EnumRunInfo(FnProcess fnProcess)
|
|
{
|
|
RunTable::const_iterator pos = m_RunTable.begin();
|
|
RunTable::const_iterator end = m_RunTable.end();
|
|
|
|
for(;pos != end; ++pos)
|
|
{
|
|
fnProcess(pos->second);
|
|
}
|
|
}
|
|
|
|
bool ReloadRunInfo();
|
|
|
|
private:
|
|
|
|
CManageClientManager(CManageServerDB& manageServerDB);
|
|
~CManageClientManager();
|
|
|
|
CManageServerDB& m_ManageServerDB;
|
|
RunTable m_RunTable;
|
|
};
|
|
|
|
|
|
#endif |