Files
Client/Server/ManageTool/ManageLibrary/Network/Dispatch/ManageClient/ManageClientDispatch.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

90 lines
2.8 KiB
C++

#ifndef _GM_MANAGE_CLIENT_DISPATCH_H_
#define _GM_MANAGE_CLIENT_DISPATCH_H_
#pragma warning(disable:4800)
#include <map>
#include <set>
#include <boost/pool/pool_alloc.hpp>
#include <Network/Dispatch/RylServerDispatch.h>
#include <Network/Dispatch/SingleDispatchStorage.h>
#include <Network/Packet/ManagePacketCmd.h>
// CManageClientDispatch를 쓰는 클라이언트만 이 라이브러리를 링크함.
#pragma comment(lib, "psapi.lib")
class CManageClientDispatch : public CRylServerDispatch
{
public:
struct RunExtraInfo
{
typedef std::set<std::string> CommandSet;
ServerManage::RunInfo m_RunInfo;
HANDLE m_hProcess;
HWND m_hWnd;
unsigned long m_dwProcessID;
unsigned long m_dwCustomStatus;
unsigned long m_dwLastSetWindowHandleTime;
CommandSet m_CommandSet;
RunExtraInfo();
RunExtraInfo(const ServerManage::RunInfo& runInfo,
HANDLE hProcess, unsigned long dwProcessID);
};
// Key - RunID
typedef std::map<unsigned long, RunExtraInfo, std::less<unsigned long>,
boost::pool_allocator<std::pair<unsigned long, RunExtraInfo> > > RunTable;
static CSingleDispatch& GetDispatchTable();
CManageClientDispatch(CSession& Session);
virtual ~CManageClientDispatch();
void CheckProcessStatus();
bool DoPatchNow() const { return m_bDoPatchNow; }
const TCHAR* GetTempPatchFileName() const { return m_szTempPatchFileName; }
bool SetAppData(unsigned long dwRunID, HWND hWnd,
unsigned long dwPID, unsigned long dwCustomStatus);
bool GetRunIDFromPID(unsigned long dwPID, unsigned long& dwRunID_Out);
bool GetRunIDFromString(const char* szAppName,
const char* szCommandLine, unsigned long& dwRunID_Out);
RunTable& GetRunTable() { return m_RunTable; }
private:
virtual void Connected();
virtual void Disconnected();
virtual bool DispatchPacket(PktBase* lpPktBase);
bool ProcessUpdateRunList(const char* szData, unsigned short usDataLen, unsigned short usFlags);
bool ProcessRunServer(unsigned long dwRunID);
bool ProcessQuitServer(unsigned long dwRunID);
bool ProcessTerminateServer(unsigned long dwRunID);
bool ProcessExecuteConsoleCommand(ServerManage::ManageCommand* lpManageCmd);
bool ProcessRelayCommand(unsigned int nMessage, WPARAM wParam, LPARAM lParam,
const char* szWindowName, const char* lpData, unsigned short usDataLen, unsigned char cFlag);
bool ProcessAutoPatch(const char* lpData, unsigned short usDataLen, unsigned short usFlag);
// Member variable;
HANDLE m_hPatchFile; // 패치 파일 핸들.
TCHAR m_szTempPatchFileName[MAX_PATH]; // 임시 패치 파일 이름.
bool m_bDoPatchNow; // 패치 준비가 되었는지 여부를 알아옴.
RunTable m_RunTable;
};
#endif