Files
Client/Server/AdminTool/AdminToolServer/RYL_AgentServerTable.h
LGram16 dd97ddec92 Restructure repository to include all source folders
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>
2025-11-29 20:17:20 +09:00

86 lines
2.6 KiB
C++

#ifndef _RYL_AGENTSERVER_TABLE_H_
#define _RYL_AGENTSERVER_TABLE_H_
#include <Pattern/Singleton.h>
#include <Network/Session/SessionPolicy.h>
class CSession;
class CRylAgentServerDispatch;
class CBuffer;
class CPacketDispatch;
class CGameDB;
class CServerRequestKeeper;
class CIOCPNet;
class CBillingDB;
class CAuthDB;
/*!
\class CAgentServerTable
운영서버와 연결중인 중계서버 연결 세션 테이블(과금DB, 인증DB, 게임DB도 관리)
*/
class CAgentServerTable : public CStaticSingleton<CAgentServerTable>
{
public:
enum SIZE
{
MAX_AGENT_SERVER = 10,
MAX_BUFFER = 256
};
struct DBAgentServerInfo
{
char szServerName[MAX_BUFFER];
char szServerAddress[MAX_BUFFER];
char szDBServer[MAX_BUFFER];
char szDBName[MAX_BUFFER];
char szDBAccount[MAX_BUFFER];
char szDBPass[MAX_BUFFER];
};
CAgentServerTable();
~CAgentServerTable();
void Destroy();
void InitAgentServerTable(CIOCPNet& IOCPNetwork);
void ConnectToAgentServer(CIOCPNet& IOCPNetwork, unsigned long dwGroupIndex);
void SetNULL(unsigned long dwServerGroup); // BaseLibrary 업데이트 이후 필요없음;
void PrintServerState(char* szText, int length);
void RemoveAllModifyCharacter(CPacketDispatch* lpPacketDispatch); // 해당 Dispatch의 캐릭터들을 목록에서 전부 삭제
void RemoveAllDepositLock(CPacketDispatch* lpPacketDispatch); // 해당 Dispatch의 창고정보를 목록에서 전부 삭제
void Disconnected(unsigned long dwIP); // 임의 접속 끊기
unsigned long GetGroupFromDBAgentIP(unsigned long dwIP);
CServerRequestKeeper& GetRequestKeeper(unsigned long dwServerGroup);// RequestKeeper 얻기
CRylAgentServerDispatch* GetDispatch(unsigned long dwServerID); // 중계서버 디스패치 얻기
CSession* GetSession(unsigned long dwServerID); // 중계서버 세션 얻기
CGameDB* GetGameDB(unsigned long dwServerID); // 게임 DB 얻기
CBillingDB* GetBillingDB() { return m_lpBillingDB; } // 과금 DB 얻기
CBillingDB* GetBillingLogDB() { return m_lpBillingLogDB; } // 과금 Log DB 얻기
CAuthDB* GetAuthDB() { return m_lpAuthDB; } // 인증 DB 얻기
private:
CSessionPolicy* m_lpSessionPolicy;
typedef std::map<unsigned long, unsigned long> IPtoServerID;
IPtoServerID m_IPtoServerID;
CGameDB* m_lpGameDB[MAX_AGENT_SERVER];
CBillingDB* m_lpBillingDB;
CBillingDB* m_lpBillingLogDB;
CAuthDB* m_lpAuthDB;
char m_szNation[MAX_BUFFER];
void ConnectToAllAgentServerz(CIOCPNet& IOCPNetwork); // 스크립트의 중계서버 리스트로 연결
void ConnectToBillingDB(); // 과금 DB 연결
void ConnectToBillingLogDB(); // 과금 Log DB 연결
void ConnectToAuthDB(); // 인증 DB 연결
bool GetAgentServerInfo(unsigned long dwGroupIndex, DBAgentServerInfo& stAgentServerInfo);
};
#endif