#include "stdafx.h" #include "UserIDTable.h" #include "UIDAgentDispatch.h" #include "SendAgentPacket.h" #include #include #include #include #include #include #ifdef AUTH_MY #include "NFAuthClient/AuthClient.h" #endif // ´ë¸¸ÀÇ °ú±ÝŸÀÔÀº, ¸Å 30ºÐ¸¶´Ù ½Ã°£À» Á¦ÇÏ´Â ¹æ½ÄÀ¸·Î ÁøÇàµÈ´Ù. // ½Ã°£À» Á¦ÇÏ´Â ·çƾÀº, Áß°è¼­¹ö¿¡¼­ ÁøÇàÇÑ´Ù. bool CUIDAgentDispatch::ProcessBillingROWGlobal(PktUUT* lpPktUUT) { unsigned char Cmd = lpPktUUT->m_cCmd; unsigned long ServerID = lpPktUUT->m_dwServerID; unsigned long SessionID = lpPktUUT->m_dwSessionID; unsigned long UserID = lpPktUUT->m_dwUserID; unsigned long CharID = lpPktUUT->m_dwCharID; char *AccountName = lpPktUUT->m_strAccount; char *Password = lpPktUUT->m_strPassword; IN_ADDR& IPAddress = lpPktUUT->m_IPAddress; // ¿ä½Ã·£µå °ú±Ý ó¸® ·çƾ switch(Cmd) { case PktUUT::UpdateUIDTableUserLogin: { CPerformanceInstrument userLogin("UserLogin"); CAutoInstrument autoInstrument(userLogin); #ifdef AUTH_MY // edith 2009.09.11 MY¸¦ À§ÇÑ AllowIP ó¸®ÀÛ¾÷ char* szAdd = inet_ntoa(IPAddress); if(!g_IPSec.IsAliveIP(szAdd)) { AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 57, 0, 0, 'N', 0, 0); ERRLOG5(g_Log, "À¯Àú(%u) [%s] ¼­¹ö(0x%08x) ST:%d Alive È£Ãâ ½ÇÆÐ %s", UserID, AccountName, ServerID, Cmd, inet_ntoa(IPAddress)); return true; } #endif // ŰÆÛ °ü·Ã ó¸® RE_USPCheckBilling_Login GetData = {0,}; if(!DBComponent::BillingDB::USPCheckUser_Login(CDBSingleObject::GetInstance(), AccountName, UserID, 0, inet_ntoa(IPAddress), GetGroup(), &GetData)) { ERRLOG6(g_Log, "À¯Àú(%u) [%s] ¼­¹ö(0x%08x) ST:%d USPCheckUser_Login È£Ãâ ½ÇÆÐ %s : %s", UserID, AccountName, ServerID, Cmd, inet_ntoa(IPAddress), CDBSingleObject::GetInstance().GetErrorString()); // DB Query½ÇÆÐ(Ŭ¶óÀÌ¾ðÆ®¿¡´Â ¿¡·¯ 1¹ø (¼­¹ö¿¡¼­ ¿¡·¯°¡ ³µ½À´Ï´Ù) ¹ß»ý // AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 4, 0, 0, 'N', 0, 0); // return true; } // ROW¿¡¼± ¿ä½Ã·£µå ÀÎÁõÀ» »ç¿ëÇÏÁö ¾Ê´Â´Ù. // ROW¿¡¼± ÀÚü¿ä±ÝÁ¦¸¦ »ç¿ëÇÑ´Ù. AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 0, 0, 0, 'N', 0, 0); } break; case PktUUT::UpdateUIDTableCharLogin: { #ifdef AUTH_MY // edith 2009.09.11 MY¸¦ À§ÇÑ AllowIP ó¸®ÀÛ¾÷ char* szAdd = inet_ntoa(IPAddress); if(!g_IPSec.IsAliveIP(szAdd)) { AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 30, 0, 0, 'N', 0, 0); ERRLOG5(g_Log, "À¯Àú(%u) [%s] ¼­¹ö(0x%08x) ST:%d Alive È£Ãâ ½ÇÆÐ %s", UserID, AccountName, ServerID, Cmd, inet_ntoa(IPAddress)); return true; } #endif /* CPerformanceInstrument userLogin("CharLogin"); CAutoInstrument autoInstrument(userLogin); // ŰÆÛ °ü·Ã ó¸® RE_USPCheckBilling_Login GetData = {0,}; if(!DBComponent::BillingDB::USPCheckUser_CharIDLogin(CDBSingleObject::GetInstance(), AccountName, UserID, 0, inet_ntoa(IPAddress), GetGroup(), &GetData)) { ERRLOG6(g_Log, "À¯Àú(%u) [%s] ¼­¹ö(0x%08x) ST:%d USPCheckUser_Login È£Ãâ ½ÇÆÐ %s : %s", UserID, AccountName, ServerID, Cmd, inet_ntoa(IPAddress), CDBSingleObject::GetInstance().GetErrorString()); // DB Query½ÇÆÐ(Ŭ¶óÀÌ¾ðÆ®¿¡´Â ¿¡·¯ 1¹ø (¼­¹ö¿¡¼­ ¿¡·¯°¡ ³µ½À´Ï´Ù) ¹ß»ý // AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 4, 0, 0, 'N', 0, 0); // return true; } */ // ROW¿¡¼± ¿ä½Ã·£µå ÀÎÁõÀ» »ç¿ëÇÏÁö ¾Ê´Â´Ù. // ROW¿¡¼± ÀÚü¿ä±ÝÁ¦¸¦ »ç¿ëÇÑ´Ù. AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 0, 0, 0, 'N', 0, 0); } break; case PktUUT::UpdateUIDTableBillingCheck: // ROW¿¡¼± ¿ä½Ã·£µå ÀÎÁõÀ» »ç¿ëÇÏÁö ¾Ê´Â´Ù. // ROW¿¡¼± ÀÚü¿ä±ÝÁ¦¸¦ »ç¿ëÇÑ´Ù. AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 0, 0, 0, 'N', 0, 0); break; case PktUUT::UpdateUIDTableUserLogout: // case PktUUT::UpdateUIDTableCharLogout: { CPerformanceInstrument logout("Logout"); CAutoInstrument autoInstrument(logout); // ŰÆÛ ó¸® unsigned long Return = 0; if(!DBComponent::BillingDB::USPCheckUser_LogOut(CDBSingleObject::GetInstance(), AccountName, &Return)) { ERRLOG5(g_Log, "À¯Àú(%u) [%s] ¼­¹ö(0x%08x) ST:%d USPCheckUser_LogOut È£Ãâ ½ÇÆÐ : %s", UserID, AccountName, ServerID, Cmd, CDBSingleObject::GetInstance().GetErrorString()); return true; } if(0 != Return) { ERRLOG5(g_Log, "À¯Àú(%u) [%s] ¼­¹ö(0x%08x) ST:%d USPCheckUser_LogOut È£Ãâ ¸®ÅÏ ¿¡·¯. %u", UserID, AccountName, ServerID, Cmd, Return); } } break; /* case PktUUT::UpdateUIDTableUserMove: case PktUUT::UpdateUIDTableCharMove: { CPerformanceInstrument move("ZoneMove"); CAutoInstrument autoInstrument(move); // ŰÆÛ ó¸® unsigned long Return = 0; if(!DBComponent::BillingDB::USPCheckUser_LogOut(CDBSingleObject::GetInstance(), AccountName, &Return)) { ERRLOG5(g_Log, "À¯Àú(%u) [%s] ¼­¹ö(0x%08x) ST:%d USPCheckUser_LogOut È£Ãâ ½ÇÆÐ : %s", UserID, AccountName, ServerID, Cmd, CDBSingleObject::GetInstance().GetErrorString()); return true; } if(0 != Return) { ERRLOG5(g_Log, "À¯Àú(%u) [%s] ¼­¹ö(0x%08x) ST:%d USPCheckUser_LogOut È£Ãâ ¸®ÅÏ ¿¡·¯. %u", UserID, AccountName, ServerID, Cmd, Return); } } break; */ } return true; } bool CUIDAgentDispatch::ProcessDisconnectROWGlobal() { // ROW¿¡¼± ¿ä½Ã·£µå °ü·Ã ÀÎÁõÀ» »ç¿ëÇÏÁö ¾Ê±â ¶§¹®¿¡ ¹«½ÃÇÑ´Ù. return true; }