/* ==================================================================== * ÆÄ ÀÏ : AgentDemon.h * ¸ñ Àû : ¾ÆÀ̸®½º ¿¡ÀÌÀüÆ®µ¥¸ó Ŭ·¡½º * ÀÛ ¼º ÀÚ : °ûöÁß * ÀÛ ¼º ÀÏ : 09/07/09 * ÁÖÀÇ»çÇ× : * =================================================================== */ #ifndef __AGENT_DEMON_H__ #define __AGENT_DEMON_H__ //#ifndef WINVER //#define WINVER 0x0500 //#endif // //#ifndef _WIN32_WINNT //#define _WIN32_WINNT 0x0500 //#endif #ifndef WSA_STARTUP_VER #define WSA_STARTUP_VER 0x0002 #endif #pragma once // À©¼Ó2 Çì´õ - link "ws2_32.lib" #include // À©µµ¿ìÁî Çì´õ #include #include #include #include #include #include "sqltypes.h" // STL #include "PointerArray.h" #include "wsastartup.h" #include "agentprocess.h" #include "agentudpsend.h" class AgentDemon : public cWSAStartup { private: // ¼­ºñ½º ¹× °ø¿ë ȯ°æº¯¼ö. SERVICE_STATUS_HANDLE mServiceStatusHandle; SERVICE_STATUS mServiceStatus; TCHAR* mUserName; bool mRunService; bool mEndService; WORD mVersion; private: // ȯ°æº¯¼ö. TCHAR mServerAddr[MAX_PATH]; TCHAR mBroadcastAddr[MAX_PATH]; private: // Ŭ·¡½º. AgentProcess* mAgentProcess; AgentUdpSend* mAgentUdpSend; private: // ¼­ºñ½º Á¦¾î ¸Þ¼Òµå. bool InstallService ( LPCTSTR binaryPathName, LPCTSTR serviceName, DWORD startType = SERVICE_DEMAND_START ); bool UninstallService ( LPCTSTR serviceName ); private: // ÀÀ¿ëÇÁ·Î±×·¥ Á¦¾î ¸Þ¼Òµå. DWORD Initialization ( DWORD argc, LPTSTR* argv, DWORD* error ); void Destroy ( void ); void Run ( void ); public: // Ŭ·¡½º »ý¼º ¹× °ø¿ë ¸Þ¼Òµå. AgentDemon(void); BOOL ConsolCtrlHandler ( DWORD opcode ); void ConsoleRun ( DWORD argc, LPTSTR* argv ); void ServiceCtrlHandler ( DWORD opcode ); void ServiceRun ( DWORD argc, LPTSTR* argv ); public: // Ŭ·¡½º °øÀ¯ ¸Þ¼Òµå. TCHAR* GetHostName ( ) { return mFixedInfo->HostName; } AgentUdpSend* GetAgentUdpSend ( ) { return mAgentUdpSend; } AgentProcess* GetAgentProcess ( ) { return mAgentProcess; } public: // Ŭ·¡½º ÆÄ±« ¸Þ¼Òµå. virtual ~AgentDemon(void); }; DWORD ErrorCode2String ( VOID** msgBuf, DWORD lastError = GetLastError(), WORD priLangId = LANG_NEUTRAL, WORD subLangId = SUBLANG_DEFAULT ); // Àü¿ªº¯¼ö ¼±¾ð(ÂüÁ¶) extern AgentDemon* g_agentDemon; extern bool g_verbose; extern bool g_fps; extern bool g_packet; extern u_short g_loginPort; extern u_short g_gamePort; extern u_short g_logPort; extern TCHAR g_serviceName[MAX_PATH]; #endif // __AGENT_DEMON_H__