/* ==================================================================== * ÆÄ ÀÏ : LogDemon.h * ¸ñ Àû : ¾ÆÀ̸®½º ·Î±×µ¥¸ó Ŭ·¡½º * ÀÛ ¼º ÀÚ : °ûöÁß * ÀÛ ¼º ÀÏ : 06/12/21 * ÁÖÀÇ»çÇ× : * =================================================================== */ #ifndef __LOG_DEMON_H__ #define __LOG_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 "wsastartup.h" enum REQUEST_DEFAULT_TYPE { DEFAULT_SQL_LOG = 0x1000, // SQL Log Request default type DEFAULT_LOG_RECVER = 0x2000, // Log Recver " }; #include "sqllog.h" #include "logsender.h" #include "logrecver.h" class cLogDemon : public cWSAStartup { private: // ¼­ºñ½º ¹× °ø¿ë ȯ°æº¯¼ö. SERVICE_STATUS_HANDLE mServiceStatusHandle; SERVICE_STATUS mServiceStatus; TCHAR* mUserName; bool mRunService; bool mEndService; volatile bool mClose; WORD mVersion; private: // ȯ°æº¯¼ö. TCHAR mServerBroadcastSend[MAX_PATH]; TCHAR mServerBroadcastRecv[MAX_PATH]; private: // Ŭ·¡½º º¯¼ö. cLogSender* mLogSender; cSQLLog* mSqlLog; cLogRecver* mLogRecver; private: // ¼­ºñ½º Á¦¾î ¸Þ¼Òµå. bool InstallService ( LPCTSTR binaryPathName, DWORD startType = SERVICE_DEMAND_START ); bool UninstallService ( void ); private: // ÀÀ¿ëÇÁ·Î±×·¥ Á¦¾î ¸Þ¼Òµå. DWORD Initialization ( DWORD argc, LPTSTR* argv, DWORD* error ); void Destroy ( void ); void Run ( void ); public: // Ŭ·¡½º »ý¼º ¹× °ø¿ë ¸Þ¼Òµå. cLogDemon(void); BOOL ConsolCtrlHandler ( DWORD opcode ); void ConsoleRun ( DWORD argc, LPTSTR* argv ); void ServiceCtrlHandler ( DWORD opcode ); void ServiceRun ( DWORD argc, LPTSTR* argv ); void Close ( ); public: // Ŭ·¡½º °øÀ¯ ¸Þ¼Òµå. cLogSender* GetLogSender ( ) { return mLogSender; } cSQLLog* GetSQLLog ( ) { return mSqlLog; } cLogRecver* GetLogRecver ( ) { return mLogRecver; } public: // Ŭ·¡½º ÆÄ±« ¸Þ¼Òµå. virtual ~cLogDemon(void); }; DWORD ErrorCode2String ( VOID** msgBuf, DWORD lastError = GetLastError(), WORD priLangId = LANG_NEUTRAL, WORD subLangId = SUBLANG_DEFAULT ); // Àü¿ªº¯¼ö ¼±¾ð(ÂüÁ¶) extern cLogDemon* g_logDemon; extern bool g_verbose; extern bool g_fps; extern bool g_packet; extern bool g_udp; extern bool g_udpPacket; extern bool g_udpFrom; extern u_short g_loginPort; extern u_short g_gamePort; extern u_short g_logPort; extern TCHAR g_serviceName[MAX_PATH]; #endif // __LOG_DEMON_H__