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>
113 lines
2.5 KiB
C++
113 lines
2.5 KiB
C++
|
|
#include <RYL_AdminManagerServer.h>
|
|
#include <Parser/ServerInfo.h>
|
|
#include <Utility/ServerAppFrameWork/ConsoleWindow/ConsoleCMDFactory.h>
|
|
#include <Log/ServerLog.h>
|
|
|
|
#include "RYL_AgentServerTable.h"
|
|
|
|
// 로그 출력 "flush"
|
|
class CCMDFlush : public CConsoleCMDSingleton<CCMDFlush>
|
|
{
|
|
protected:
|
|
virtual bool DoProcess()
|
|
{
|
|
SERLOG0(g_Log, "Execute console command: flush");
|
|
|
|
g_Log.Flush();
|
|
|
|
CRylAdminManagerServer::GetInstance().PrintOutput("Log flush complete", 0);
|
|
|
|
return true;
|
|
}
|
|
};
|
|
|
|
// 스크립트 파일 다시 로드하기 "reload_script"
|
|
class CCMDReload : public CConsoleCMDSingleton<CCMDReload>
|
|
{
|
|
virtual bool DoProcess()
|
|
{
|
|
SERLOG0(g_Log, "Execute console command: reload_script");
|
|
|
|
if(!CServerInfo::GetInstance().Reload())
|
|
{
|
|
CRylAdminManagerServer::GetInstance().PrintOutput("Script load failed", 0);
|
|
return false;
|
|
}
|
|
|
|
CRylAdminManagerServer::GetInstance().PrintOutput("Script load success", 0);
|
|
|
|
return true;
|
|
}
|
|
};
|
|
|
|
// 서버군 전부 다시 재접속시도 "connect_all"
|
|
class CCMDConnectAll : public CConsoleCMDSingleton<CCMDConnectAll>
|
|
{
|
|
virtual bool DoProcess()
|
|
{
|
|
SERLOG0(g_Log, "Execute console command: connect all");
|
|
|
|
CAgentServerTable::GetInstance().InitAgentServerTable(
|
|
*CRylAdminManagerServer::GetInstance().GetIOCPNet());
|
|
|
|
CRylAdminManagerServer::GetInstance().PrintOutput("Execute command: connect all", 0);
|
|
|
|
return true;
|
|
}
|
|
};
|
|
|
|
// 특정 서버군 접속 시도 커맨드 "connect_index %d"
|
|
class CCMDConnect : public CConsoleCommand
|
|
{
|
|
protected:
|
|
virtual CConsoleCommand* Clone(const TCHAR* szCommand, size_t nCommandLength)
|
|
{
|
|
CCMDConnect* lpCommand = new CCMDConnect;
|
|
|
|
if(0 != lpCommand)
|
|
{
|
|
lpCommand->m_dwServerGroupID = 0;
|
|
|
|
const int MAX_COMMAND = 1024;
|
|
char szLocalCommand[MAX_COMMAND];
|
|
|
|
_snprintf(szLocalCommand, MAX_COMMAND - 1, "%s", szCommand);
|
|
szLocalCommand[MAX_COMMAND - 1] = 0;
|
|
|
|
char* token = strtok(szLocalCommand, "\r\n\t ");
|
|
if(0 != token)
|
|
{
|
|
token = strtok(0, "\r\n\t ");
|
|
if(0 != token)
|
|
{
|
|
lpCommand->m_dwServerGroupID = atol(token);
|
|
}
|
|
}
|
|
}
|
|
return lpCommand;
|
|
}
|
|
|
|
virtual bool DoProcess()
|
|
{
|
|
SERLOG1(g_Log, "Execute command: connect_index %d", m_dwServerGroupID);
|
|
|
|
CAgentServerTable::GetInstance().ConnectToAgentServer(
|
|
*CRylAdminManagerServer::GetInstance().GetIOCPNet(), m_dwServerGroupID);
|
|
|
|
const char* szText = "Execute command: connect_index";
|
|
CRylAdminManagerServer::GetInstance().PrintOutput(
|
|
szText, static_cast<int>(strlen(szText)));
|
|
|
|
return true;
|
|
}
|
|
|
|
virtual bool Destroy()
|
|
{
|
|
delete this;
|
|
return true;
|
|
}
|
|
|
|
private:
|
|
unsigned long m_dwServerGroupID;
|
|
}; |