// AlphaServer.cpp : ÄÜ¼Ö ÀÀ¿ë ÇÁ·Î±×·¥¿¡ ´ëÇÑ ÁøÀÔÁ¡À» Á¤ÀÇÇÕ´Ï´Ù. // #include "Global.h" #include #include #include #include "ServerCtrl.h" #include "resource.h" #include int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { Nave::NFLog::SetLogLimit(Nave::NFLog::Warning); // Nave::NFLog::SetLogDetail(true); WCHAR strCmd[512]; _tcscpy(strCmd, Nave::ToString(lpCmdLine).c_str()); g_Server = new ServerCtrl(); if(!g_Server) { return 0; } Nave::NFIni ini; ini.Open(L"./Config.ini"); DWORD width, height; WCHAR szTitle[128]; DWORD len = 128; ini.GetValue(L"WINDOWS", L"TITLE", szTitle, len); ini.GetValue(L"WINDOWS", L"WIDTH", &width); ini.GetValue(L"WINDOWS", L"HEIGHT", &height); WCHAR szAllowIP[128]; WCHAR szBlockIP[128]; WCHAR szenableIPSec[128]; BOOL enableIPSec; ini.GetValue(L"IPSEC", L"ALLOWIP", szAllowIP, len); ini.GetValue(L"IPSEC", L"BLOCKIP", szBlockIP, len); ini.GetValue(L"IPSEC", L"ENABLE", szenableIPSec, len); if(wcscmp(szenableIPSec, L"TRUE") == 0) enableIPSec = TRUE; else enableIPSec = FALSE; ini.Close(); // Å×½ºÆ® IPBAND ipInfo[10]; g_IPSec.LoadAllowIP(szAllowIP); g_IPSec.LoadBlockIP(szBlockIP); g_IPSec.SerializeOut(0, 0, 10, (char*)ipInfo); // g_IPSec.ClearAllowIP(); // g_IPSec.SerializeIn((char*)ipInfo, 10); if(!g_Server->Init(hInstance, nCmdShow, width, height, szTitle, MIS(IDI_ICON1))) return 0; // IPüũ Å×½ºÆ® char szIP[32]; GetLocalIP(szIP, FALSE); if( g_IPSec.IsAliveIP(szIP) ) { LOG_IMPORTANT((L"Alive IP : %s", Nave::ToString(szIP).c_str() )); } else { LOG_IMPORTANT((L"Non Alive IP : %s", Nave::ToString(szIP).c_str() )); } if( g_IPSec.CheckBlockIP(szIP) ) { LOG_IMPORTANT((L"Block IP : %s", Nave::ToString(szIP).c_str() )); } g_Server->StartCommand(); _DELETE(g_Server); // ·Î±×ÆÄÀÏÀ» Á¾·áÇÑ´Ù. Nave::NFLog::CloseLog(); return 0; }