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>
This commit is contained in:
164
Server/RylServerProject/RylUIDServer/Billing_Gammania.cpp
Normal file
164
Server/RylServerProject/RylUIDServer/Billing_Gammania.cpp
Normal file
@@ -0,0 +1,164 @@
|
||||
#include "stdafx.h"
|
||||
#include "UserIDTable.h"
|
||||
#include "UIDAgentDispatch.h"
|
||||
#include "SendAgentPacket.h"
|
||||
|
||||
#include <Log/ServerLog.h>
|
||||
#include <Network/Packet/PacketStruct/ServerPacket.h>
|
||||
#include <Utility/Setup/ServerSetup.h>
|
||||
#include <DB/DBComponent.h>
|
||||
#include <DB/BillingDBComponent.h>
|
||||
|
||||
#include <Utility/Debug/PerformanceCheck.h>
|
||||
|
||||
#include "RylUIDServer.h"
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD>Ͼ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ÿ<EFBFBD><C5B8> <20><><EFBFBD><EFBFBD> Ÿ<><C5B8> (2005-09-20 zun!)
|
||||
bool CUIDAgentDispatch::ProcessBillingGammania(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;
|
||||
// edith 2005.1.22 <20><><EFBFBD><EFBFBD><EFBFBD>Ͼƴ<CFBE> <20><><EFBFBD>Ӿȿ<D3BE><C8BF><EFBFBD><EFBFBD><EFBFBD> ó<><C3B3><EFBFBD><EFBFBD> <20><><EFBFBD>⼭ <20>ؾ<EFBFBD><D8BE>Ѵ<EFBFBD>.
|
||||
char *Password = lpPktUUT->m_strPassword;
|
||||
IN_ADDR& IPAddress = lpPktUUT->m_IPAddress;
|
||||
|
||||
LPUIDINFO pInfo = CRylUIDServer::GetInstance().FindAuth(AccountName);
|
||||
if(pInfo == NULL)
|
||||
{
|
||||
UIDINFO stTemp;
|
||||
stTemp.Cmd = Cmd;
|
||||
stTemp.ServerID = ServerID;
|
||||
stTemp.SessionID = SessionID;
|
||||
stTemp.Group = GetGroup();
|
||||
stTemp.UserID = UserID;
|
||||
stTemp.CharID = CharID;
|
||||
stTemp.Address = IPAddress;
|
||||
strcpy(stTemp.AccountName, AccountName);
|
||||
strcpy(stTemp.Password, Password);
|
||||
pInfo = CRylUIDServer::GetInstance().AddAuth(stTemp);
|
||||
}
|
||||
|
||||
// Ŀ<>ǵ<EFBFBD><C7B5><EFBFBD> <20>н<EFBFBD><D0BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ź<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
pInfo->Cmd = Cmd;
|
||||
|
||||
if(strlen(Password) > 0 && strncmp(pInfo->Password, Password, PktUUT::MaxPasswordLen) != 0)
|
||||
{
|
||||
strncpy(pInfo->Password, Password, PktUUT::MaxPasswordLen);
|
||||
}
|
||||
|
||||
switch(Cmd)
|
||||
{
|
||||
case PktUUT::UpdateUIDTableUserLogin:
|
||||
{
|
||||
CPerformanceInstrument userLogin("UserLogin");
|
||||
CAutoInstrument autoInstrument(userLogin);
|
||||
|
||||
const char* szAddress = inet_ntoa(pInfo->Address);
|
||||
|
||||
// edith 2008.01.22 <20><><EFBFBD><EFBFBD><EFBFBD>Ͼ<EFBFBD> <20><><EFBFBD><EFBFBD> ó<><C3B3><EFBFBD>κ<EFBFBD>
|
||||
char strBuff[512];
|
||||
|
||||
sprintf(strBuff, "%s'%s'%s'%s'1'I'0'%s'%s;%d;'\r\n",
|
||||
CServerSetup::GetInstance().GetGammaniaCode()
|
||||
, CServerSetup::GetInstance().GetGammaniaRegin()
|
||||
, pInfo->AccountName
|
||||
, pInfo->Password
|
||||
, szAddress
|
||||
, pInfo->AccountName
|
||||
, Cmd);
|
||||
|
||||
CRylUIDServer::GetInstance().SendPost(0, strBuff);
|
||||
}
|
||||
break;
|
||||
|
||||
case PktUUT::UpdateUIDTableUserLogout:
|
||||
case PktUUT::UpdateUIDTableCharLogout:
|
||||
{
|
||||
CPerformanceInstrument logout("Logout");
|
||||
CAutoInstrument autoInstrument(logout);
|
||||
|
||||
const char* szAddress = inet_ntoa(pInfo->Address);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD>Ͼ<EFBFBD> <20>αƿ<D7BE> ó<><C3B3>
|
||||
char strBuff[512];
|
||||
|
||||
sprintf(strBuff, "%s'%s'%s'R'''%s'%s;'\r\n",
|
||||
CServerSetup::GetInstance().GetGammaniaCode()
|
||||
, CServerSetup::GetInstance().GetGammaniaRegin()
|
||||
, pInfo->AccountName
|
||||
, szAddress
|
||||
, pInfo->AccountName );
|
||||
|
||||
CRylUIDServer::GetInstance().SendPost(1, strBuff);
|
||||
}
|
||||
break;
|
||||
|
||||
case PktUUT::UpdateUIDTableCharLogin:
|
||||
{
|
||||
CPerformanceInstrument charLogin("CharLogin");
|
||||
CAutoInstrument autoInstrument(charLogin);
|
||||
|
||||
const char* szAddress = inet_ntoa(pInfo->Address);
|
||||
|
||||
// edith 2008.01.22 <20><><EFBFBD><EFBFBD><EFBFBD>Ͼ<EFBFBD> <20><><EFBFBD><EFBFBD> ó<><C3B3><EFBFBD>κ<EFBFBD>
|
||||
char strBuff[512];
|
||||
|
||||
sprintf(strBuff, "%s'%s'%s'%s'1'I'0'%s'%s;%d;'\r\n",
|
||||
CServerSetup::GetInstance().GetGammaniaCode()
|
||||
, CServerSetup::GetInstance().GetGammaniaRegin()
|
||||
, pInfo->AccountName
|
||||
, pInfo->Password
|
||||
, szAddress
|
||||
, pInfo->AccountName
|
||||
, Cmd);
|
||||
|
||||
CRylUIDServer::GetInstance().SendPost(0, strBuff);
|
||||
}
|
||||
break;
|
||||
|
||||
case PktUUT::UpdateUIDTableUserMove:
|
||||
case PktUUT::UpdateUIDTableCharMove:
|
||||
{
|
||||
CPerformanceInstrument move("ZoneMove");
|
||||
CAutoInstrument autoInstrument(move);
|
||||
|
||||
const char* szAddress = inet_ntoa(pInfo->Address);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD>Ͼ<EFBFBD> <20>αƿ<D7BE> ó<><C3B3>
|
||||
char strBuff[512];
|
||||
|
||||
sprintf(strBuff, "%s'%s'%s'R'''%s'%s;'\r\n",
|
||||
CServerSetup::GetInstance().GetGammaniaCode()
|
||||
, CServerSetup::GetInstance().GetGammaniaRegin()
|
||||
, pInfo->AccountName
|
||||
, szAddress
|
||||
, pInfo->AccountName );
|
||||
|
||||
CRylUIDServer::GetInstance().SendPost(1, strBuff);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CUIDAgentDispatch::ProcessDisconnectGammania()
|
||||
{
|
||||
/*
|
||||
unsigned long dwResult = 0;
|
||||
if (false == DBComponent::BillingDB::USPServer_End(CDBSingleObject::GetInstance(), m_Group, &dwResult))
|
||||
{
|
||||
SERLOG3(g_Log, "%d <20><EFBFBD> <20>αƿ<D7BE> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:0x%08x DB<44><42><EFBFBD><EFBFBD> <20>α<EFBFBD>:%s",
|
||||
m_Group, dwResult, CDBSingleObject::GetInstance().GetErrorString());
|
||||
}
|
||||
else
|
||||
{
|
||||
SERLOG1(g_Log, "%d <20><EFBFBD> USEServer_End ȣ<><C8A3> <20><><EFBFBD><EFBFBD>", m_Group);
|
||||
}
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
235
Server/RylServerProject/RylUIDServer/Billing_Han.cpp
Normal file
235
Server/RylServerProject/RylUIDServer/Billing_Han.cpp
Normal file
@@ -0,0 +1,235 @@
|
||||
#include "stdafx.h"
|
||||
#include "UserIDTable.h"
|
||||
#include "UIDAgentDispatch.h"
|
||||
#include "SendAgentPacket.h"
|
||||
|
||||
#include <Log/ServerLog.h>
|
||||
#include <Network/Packet/PacketStruct/ServerPacket.h>
|
||||
#include <Utility/Setup/ServerSetup.h>
|
||||
#include <DB/DBComponent.h>
|
||||
#include <DB/BillingDBComponent.h>
|
||||
|
||||
#include <Utility/Debug/PerformanceCheck.h>
|
||||
|
||||
// <20>Ѱ<EFBFBD><D1B0><EFBFBD> <20><><EFBFBD><EFBFBD> ó<><C3B3> <20><>ƾ. DB<44><42><EFBFBD><EFBFBD> <20><><EFBFBD>н<EFBFBD> <20><><EFBFBD><EFBFBD> <20>ִ<EFBFBD> <20>κи<CEBA> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϰ<EFBFBD>,
|
||||
// <20>ڵ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ͽ<EFBFBD><CFBF><EFBFBD> <20>Ѵ<EFBFBD>.
|
||||
bool CUIDAgentDispatch::ProcessBillingHan(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;
|
||||
IN_ADDR& IPAddress = lpPktUUT->m_IPAddress;
|
||||
|
||||
// <20>Ѱ<EFBFBD><D1B0><EFBFBD> ó<><C3B3> <20><>ƾ
|
||||
switch(Cmd)
|
||||
{
|
||||
case PktUUT::UpdateUIDTableUserLogin:
|
||||
{
|
||||
CPerformanceInstrument userLogin("UserLogin");
|
||||
CAutoInstrument autoInstrument(userLogin);
|
||||
|
||||
// Ű<><C5B0> <20><><EFBFBD><EFBFBD> ó<><C3B3>
|
||||
RE_USPCheckBilling_Login GetData = {0,};
|
||||
|
||||
char Check = CServerSetup::GetInstance().GetFreeCheck() ? 1 : 0; // <20>⺻(=0), <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(=1)
|
||||
if(!DBComponent::BillingDB::USPCheckBilling_Login(CDBSingleObject::GetInstance(),
|
||||
AccountName, UserID, Check, inet_ntoa(IPAddress), GetGroup(), &GetData))
|
||||
{
|
||||
SERLOG6(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckBilling_Login ȣ<><C8A3> <20><><EFBFBD><EFBFBD> %s : %s",
|
||||
UserID, AccountName, ServerID, Cmd, inet_ntoa(IPAddress), CDBSingleObject::GetInstance().GetErrorString());
|
||||
|
||||
// DB Query<72><79><EFBFBD><EFBFBD>(Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ<EFBFBD><C6AE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> 1<><31> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>) <20><EFBFBD>
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 4, 0, 0, 'N', 0, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ Ack
|
||||
if(FALSE == CServerSetup::GetInstance().GetIgnoreFlag())
|
||||
{
|
||||
if(1 == GetData.Flag && PktUUT::DISCONNECT_USER == lpPktUUT->GetError())
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>̹<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ְ<EFBFBD>, <20><><EFBFBD><EFBFBD> <20><><EFBFBD>̱<EFBFBD> <20>÷<EFBFBD><C3B7>װ<EFBFBD> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>δ<EFBFBD>.
|
||||
AgentSendPacket::SendHanUnitedUserKill(GetData.intCRMIndex1, AccountName, 0);
|
||||
}
|
||||
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), PktUUT::UpdateUIDTableUserLogin,
|
||||
UserID, GetData.Flag, GetData.PlayTime, GetData.intCRMIndex1,
|
||||
GetData.strBillingType[0], 0, lpPktUUT->GetError());
|
||||
}
|
||||
else
|
||||
{
|
||||
if(1 == GetData.Flag && PktUUT::DISCONNECT_USER == lpPktUUT->GetError())
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>̹<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ְ<EFBFBD>, <20><><EFBFBD><EFBFBD> <20><><EFBFBD>̱<EFBFBD> <20>÷<EFBFBD><C3B7>װ<EFBFBD> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>δ<EFBFBD>.
|
||||
AgentSendPacket::SendHanUnitedUserKill(GetData.intCRMIndex1, AccountName, 0);
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ų<EFBFBD><C5B2>. <20><> <20>ߺ<EFBFBD><DFBA>α<EFBFBD><CEB1><EFBFBD><EFBFBD≯<EFBFBD> <20>α<EFBFBD><CEB1><EFBFBD> <20><><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD> <20>Ѵ<EFBFBD>.
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd,
|
||||
UserID, (1 == GetData.Flag) ? 1 : 0, GetData.PlayTime, GetData.intCRMIndex1,
|
||||
GetData.strBillingType[0], 0, lpPktUUT->GetError());
|
||||
}
|
||||
|
||||
if(0 == GetData.Flag)
|
||||
{
|
||||
IncreaseSucceedNum();
|
||||
}
|
||||
else
|
||||
{
|
||||
IncreaseFailNum();
|
||||
}
|
||||
|
||||
DETLOG7(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckBilling_Login ȣ<><C8A3> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>. %u, %u [%s]",
|
||||
UserID, AccountName, ServerID, Cmd, GetData.Flag, GetData.intCRMIndex1, inet_ntoa(IPAddress));
|
||||
|
||||
IncreaseUnitNum();
|
||||
}
|
||||
break;
|
||||
|
||||
case PktUUT::UpdateUIDTableCharLogin:
|
||||
{
|
||||
CPerformanceInstrument charLogin("CharLogin");
|
||||
CAutoInstrument autoInstrument(charLogin);
|
||||
|
||||
// Ű<><C5B0> <20><><EFBFBD><EFBFBD> ó<><C3B3>
|
||||
RE_USPCheckBilling_Login GetData = {0,};
|
||||
|
||||
char Check = CServerSetup::GetInstance().GetFreeCheck() ? 1 : 0; // <20>⺻(=0), <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(=1)
|
||||
if(!DBComponent::BillingDB::USPCheckBilling_CharIDLogin(CDBSingleObject::GetInstance(),
|
||||
AccountName, UserID, Check, inet_ntoa(IPAddress), GetGroup(), &GetData))
|
||||
{
|
||||
SERLOG6(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckBilling_CharIDLogin ȣ<><C8A3> <20><><EFBFBD><EFBFBD> %s : %s",
|
||||
UserID, AccountName, ServerID, Cmd, inet_ntoa(IPAddress), CDBSingleObject::GetInstance().GetErrorString());
|
||||
|
||||
// DB Query<72><79><EFBFBD><EFBFBD>(Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ<EFBFBD><C6AE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> 1<><31> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>) <20><EFBFBD>
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 4, 0, 0, 'N', 0, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ Ack
|
||||
if(FALSE == CServerSetup::GetInstance().GetIgnoreFlag())
|
||||
{
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), PktUUT::UpdateUIDTableCharLogin,
|
||||
UserID, GetData.Flag, GetData.PlayTime, GetData.intCRMIndex1, GetData.strBillingType[0], 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), PktUUT::UpdateUIDTableCharLogin,
|
||||
UserID, 0, GetData.PlayTime, GetData.intCRMIndex1, GetData.strBillingType[0], 0, 0);
|
||||
}
|
||||
|
||||
if(0 == GetData.Flag)
|
||||
{
|
||||
IncreaseSucceedNum();
|
||||
}
|
||||
else
|
||||
{
|
||||
IncreaseFailNum();
|
||||
}
|
||||
|
||||
DETLOG7(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckBilling_CharIDLogin ȣ<><C8A3> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>. %u, %u [%s]",
|
||||
UserID, AccountName, ServerID, Cmd, GetData.Flag, GetData.intCRMIndex1, inet_ntoa(IPAddress));
|
||||
|
||||
IncreaseUnitNum();
|
||||
}
|
||||
break;
|
||||
|
||||
case PktUUT::UpdateUIDTableUserLogout:
|
||||
case PktUUT::UpdateUIDTableCharLogout:
|
||||
{
|
||||
CPerformanceInstrument logout("Logout");
|
||||
CAutoInstrument autoInstrument(logout);
|
||||
|
||||
// Ű<><C5B0> ó<><C3B3>
|
||||
unsigned long Return = 0;
|
||||
|
||||
if(!DBComponent::BillingDB::USPCheckBilling_LogOut(CDBSingleObject::GetInstance(), AccountName, &Return))
|
||||
{
|
||||
SERLOG5(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckBilling_LogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD> : %s",
|
||||
UserID, AccountName, ServerID, Cmd, CDBSingleObject::GetInstance().GetErrorString());
|
||||
return true;
|
||||
}
|
||||
|
||||
if(0 != Return)
|
||||
{
|
||||
SERLOG5(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckBilling_LogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. %u",
|
||||
UserID, AccountName, ServerID, Cmd, Return);
|
||||
return true;
|
||||
}
|
||||
|
||||
DETLOG5(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckBilling_LogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>. %u",
|
||||
UserID, AccountName, ServerID, Cmd, Return);
|
||||
|
||||
DecreaseUnitNum();
|
||||
}
|
||||
break;
|
||||
|
||||
case PktUUT::UpdateUIDTableUserMove:
|
||||
case PktUUT::UpdateUIDTableCharMove:
|
||||
{
|
||||
CPerformanceInstrument move("ZoneMove");
|
||||
CAutoInstrument autoInstrument(move);
|
||||
|
||||
// Ű<><C5B0> ó<><C3B3>
|
||||
unsigned long Return = 0;
|
||||
|
||||
if(!DBComponent::BillingDB::USPCheckBilling_LogOut(CDBSingleObject::GetInstance(), AccountName, &Return))
|
||||
{
|
||||
SERLOG5(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckBilling_LogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD> : %s",
|
||||
UserID, AccountName, ServerID, Cmd, CDBSingleObject::GetInstance().GetErrorString());
|
||||
return true;
|
||||
}
|
||||
|
||||
if(0 != Return)
|
||||
{
|
||||
SERLOG5(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckBilling_LogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. %u",
|
||||
UserID, AccountName, ServerID, Cmd, Return);
|
||||
return true;
|
||||
}
|
||||
|
||||
DETLOG5(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckBilling_LogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>. %u",
|
||||
UserID, AccountName, ServerID, Cmd, Return);
|
||||
|
||||
DecreaseUnitNum();
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CUIDAgentDispatch::ProcessDisconnectHan()
|
||||
{
|
||||
// <20>Ѱ<EFBFBD><D1B0><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>̳<EFBFBD>, <20>Ѱ<EFBFBD><D1B0><EFBFBD> <20><><EFBFBD>պ<EFBFBD><D5BA><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
||||
unsigned long Result = 0;
|
||||
|
||||
if(!DBComponent::BillingDB::USPDisConnectLogOut(CDBSingleObject::GetInstance(), m_Group, &Result))
|
||||
{
|
||||
SERLOG3(g_Log, "%d <20><EFBFBD> <20>αƿ<D7BE> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:0x%08x DB<44><42><EFBFBD><EFBFBD> <20>α<EFBFBD>:%s",
|
||||
m_Group, Result, CDBSingleObject::GetInstance().GetErrorString());
|
||||
}
|
||||
else
|
||||
{
|
||||
SERLOG1(g_Log, "%d <20><EFBFBD> USPDisConnectLogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD>", m_Group);
|
||||
|
||||
if(!DBComponent::BillingDB::USPServer_End(CDBSingleObject::GetInstance(), m_Group, &Result))
|
||||
{
|
||||
SERLOG3(g_Log, "%d <20><EFBFBD> <20>αƿ<D7BE> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:0x%08x DB<44><42><EFBFBD><EFBFBD> <20>α<EFBFBD>:%s",
|
||||
m_Group, Result, CDBSingleObject::GetInstance().GetErrorString());
|
||||
}
|
||||
else
|
||||
{
|
||||
SERLOG1(g_Log, "%d <20><EFBFBD> USEServer_End ȣ<><C8A3> <20><><EFBFBD><EFBFBD>", m_Group);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
291
Server/RylServerProject/RylUIDServer/Billing_HanUnited.cpp
Normal file
291
Server/RylServerProject/RylUIDServer/Billing_HanUnited.cpp
Normal file
@@ -0,0 +1,291 @@
|
||||
#include "stdafx.h"
|
||||
#include "UserIDTable.h"
|
||||
#include "UIDAgentDispatch.h"
|
||||
#include "SendAgentPacket.h"
|
||||
|
||||
#include "HanUnitedBilling.h"
|
||||
#include "HanUnitedDisconnID.h"
|
||||
|
||||
#include <Log/ServerLog.h>
|
||||
#include <Network/Packet/PacketStruct/ServerPacket.h>
|
||||
#include <Utility/Setup/ServerSetup.h>
|
||||
#include <DB/DBComponent.h>
|
||||
#include <DB/BillingDBComponent.h>
|
||||
|
||||
#include <Utility/Debug/PerformanceCheck.h>
|
||||
|
||||
// <20>Ѱ<EFBFBD><D1B0><EFBFBD> <20><><EFBFBD>պ<EFBFBD><D5BA><EFBFBD> ó<><C3B3>. <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϰ<EFBFBD><CFB0><EFBFBD> <20><>ġ<EFBFBD><C4A1><EFBFBD><EFBFBD> <20>۾<EFBFBD><DBBE><EFBFBD> <20><> <20><> <20><><EFBFBD><EFBFBD> --;;
|
||||
bool CUIDAgentDispatch::ProcessBillingHanUnited(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;
|
||||
IN_ADDR& IPAddress = lpPktUUT->m_IPAddress;
|
||||
|
||||
// <20>Ѱ<EFBFBD><D1B0><EFBFBD> ó<><C3B3> <20><>ƾ
|
||||
switch(Cmd)
|
||||
{
|
||||
case PktUUT::UpdateUIDTableUserLogin:
|
||||
{
|
||||
CPerformanceInstrument userLogin("UserLogin");
|
||||
CAutoInstrument autoInstrument(userLogin);
|
||||
|
||||
// Ű<><C5B0> <20><><EFBFBD><EFBFBD> ó<><C3B3>
|
||||
RE_USPCheckBilling_Login GetData = {0,};
|
||||
|
||||
char Check = CServerSetup::GetInstance().GetFreeCheck() ? 1 : 0; // <20>⺻(=0), <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(=1)
|
||||
if(!DBComponent::BillingDB::USPCheckBilling_Login_Post(CDBSingleObject::GetInstance(),
|
||||
AccountName, UserID, Check, inet_ntoa(IPAddress), GetGroup(), &GetData))
|
||||
{
|
||||
SERLOG6(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckBilling_Login_Post ȣ<><C8A3> <20><><EFBFBD><EFBFBD> %s : %s",
|
||||
UserID, AccountName, ServerID, Cmd, inet_ntoa(IPAddress), CDBSingleObject::GetInstance().GetErrorString());
|
||||
|
||||
// DB Query<72><79><EFBFBD><EFBFBD>(Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ<EFBFBD><C6AE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> 1<><31> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>) <20><EFBFBD>
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 4, 0, 0, 'N', 0, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ Ack
|
||||
if(FALSE == CServerSetup::GetInstance().GetIgnoreFlag())
|
||||
{
|
||||
if(1 == GetData.Flag && PktUUT::DISCONNECT_USER == lpPktUUT->GetError())
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>̹<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ְ<EFBFBD>, <20><><EFBFBD><EFBFBD> <20><><EFBFBD>̱<EFBFBD> <20>÷<EFBFBD><C3B7>װ<EFBFBD> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>δ<EFBFBD>.
|
||||
AgentSendPacket::SendHanUnitedUserKill(GetData.intCRMIndex1, AccountName, 0);
|
||||
}
|
||||
|
||||
if(2 <= GetData.Flag)
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> - <20><><EFBFBD>պ<EFBFBD><D5BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> üũ<C3BC><C5A9> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
GET_SINGLE_DISPATCH(lpHanUnitedDispatch, CHanUnitedDispatch,
|
||||
CHanUnitedDispatch::GetDispatchTable());
|
||||
|
||||
if(0 == lpHanUnitedDispatch ||
|
||||
!lpHanUnitedDispatch->SendCanLogin(*lpPktUUT, GetData, GetGroup()))
|
||||
{
|
||||
SERLOG5(g_Log, "ID:%s/IP:%s/UID:%u/CID:%u/ServerID:0x%08x/<2F><><EFBFBD>պ<EFBFBD><D5BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.",
|
||||
lpPktUUT->m_strAccount, inet_ntoa(lpPktUUT->m_IPAddress),
|
||||
lpPktUUT->m_dwUserID, lpPktUUT->m_dwCharID, ServerID);
|
||||
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 4, 0, 0, 'N', 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// DB<44><42><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd,
|
||||
UserID, GetData.Flag, GetData.PlayTime, GetData.intCRMIndex1,
|
||||
GetData.strBillingType[0], 0, lpPktUUT->GetError());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(1 == GetData.Flag && PktUUT::DISCONNECT_USER == lpPktUUT->GetError())
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>̹<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ְ<EFBFBD>, <20><><EFBFBD><EFBFBD> <20><><EFBFBD>̱<EFBFBD> <20>÷<EFBFBD><C3B7>װ<EFBFBD> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>δ<EFBFBD>.
|
||||
AgentSendPacket::SendHanUnitedUserKill(GetData.intCRMIndex1, AccountName, 0);
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ų<EFBFBD><C5B2>. <20><> <20>ߺ<EFBFBD><DFBA>α<EFBFBD><CEB1><EFBFBD><EFBFBD≯<EFBFBD> <20>α<EFBFBD><CEB1><EFBFBD> <20><><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD> <20>Ѵ<EFBFBD>.
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd,
|
||||
UserID, (1 == GetData.Flag) ? 1 : 0, GetData.PlayTime, GetData.intCRMIndex1,
|
||||
GetData.strBillingType[0], 0, lpPktUUT->GetError());
|
||||
}
|
||||
|
||||
DETLOG7(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckBilling_Login_Post ȣ<><C8A3> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>. %u, %u [%s]",
|
||||
UserID, AccountName, ServerID, Cmd, GetData.Flag, GetData.intCRMIndex1, inet_ntoa(IPAddress));
|
||||
}
|
||||
break;
|
||||
|
||||
case PktUUT::UpdateUIDTableCharLogin:
|
||||
{
|
||||
CPerformanceInstrument charLogin("CharLogin");
|
||||
CAutoInstrument autoInstrument(charLogin);
|
||||
|
||||
// Ű<><C5B0> <20><><EFBFBD><EFBFBD> ó<><C3B3>
|
||||
RE_USPCheckBilling_Login GetData = {0,};
|
||||
|
||||
char Check = CServerSetup::GetInstance().GetFreeCheck() ? 1 : 0; // <20>⺻(=0), <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(=1)
|
||||
if(!DBComponent::BillingDB::USPCheckBilling_CharIDLogin_Post(CDBSingleObject::GetInstance(),
|
||||
AccountName, UserID, Check, inet_ntoa(IPAddress), GetGroup(), &GetData))
|
||||
{
|
||||
SERLOG6(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckBilling_CharIDLogin_Post ȣ<><C8A3> <20><><EFBFBD><EFBFBD> %s : %s",
|
||||
UserID, AccountName, ServerID, Cmd, inet_ntoa(IPAddress), CDBSingleObject::GetInstance().GetErrorString());
|
||||
|
||||
// DB Query<72><79><EFBFBD><EFBFBD>(Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ<EFBFBD><C6AE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> 1<><31> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>) <20><EFBFBD>
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 4, 0, 0, 'N', 0, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ Ack
|
||||
if(FALSE == CServerSetup::GetInstance().GetIgnoreFlag())
|
||||
{
|
||||
if(2 <= GetData.Flag)
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> - <20><><EFBFBD>պ<EFBFBD><D5BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> üũ<C3BC><C5A9> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
GET_SINGLE_DISPATCH(lpHanUnitedDispatch, CHanUnitedDispatch,
|
||||
CHanUnitedDispatch::GetDispatchTable());
|
||||
|
||||
if(0 == lpHanUnitedDispatch ||
|
||||
!lpHanUnitedDispatch->SendLogin(*lpPktUUT, GetData, GetGroup()))
|
||||
{
|
||||
SERLOG5(g_Log, "ID:%s/IP:%s/UID:%u/CID:%u/ServerID:0x%08x/<2F><><EFBFBD>պ<EFBFBD><D5BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>α<EFBFBD><CEB1><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.",
|
||||
lpPktUUT->m_strAccount, inet_ntoa(lpPktUUT->m_IPAddress),
|
||||
lpPktUUT->m_dwUserID, lpPktUUT->m_dwCharID, ServerID);
|
||||
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 4, 0, 0, 'N', 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// DB<44><42><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd,
|
||||
UserID, GetData.Flag, GetData.PlayTime, GetData.intCRMIndex1, GetData.strBillingType[0], 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd,
|
||||
UserID, 0, GetData.PlayTime, GetData.intCRMIndex1, GetData.strBillingType[0], 0, 0);
|
||||
}
|
||||
|
||||
DETLOG7(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckBilling_CharIDLogin_Post ȣ<><C8A3> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>. %u, %u [%s]",
|
||||
UserID, AccountName, ServerID, Cmd, GetData.Flag, GetData.intCRMIndex1, inet_ntoa(IPAddress));
|
||||
}
|
||||
break;
|
||||
|
||||
case PktUUT::UpdateUIDTableUserLogout:
|
||||
case PktUUT::UpdateUIDTableCharLogout:
|
||||
|
||||
// <20><> <20>̻<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʾƵ<CABE> <20>ȴ<EFBFBD>.
|
||||
CHanUnitedDisconnectID::GetInstance().RemoveDisconnectInfo(UserID);
|
||||
|
||||
case PktUUT::UpdateUIDTableUserMove:
|
||||
case PktUUT::UpdateUIDTableCharMove:
|
||||
|
||||
{
|
||||
CPerformanceInstrument logout("Logout");
|
||||
CAutoInstrument autoInstrument(logout);
|
||||
|
||||
// Ű<><C5B0> ó<><C3B3>
|
||||
unsigned long Return = 0;
|
||||
|
||||
if(!DBComponent::BillingDB::USPCheckBilling_LogOut_Post(CDBSingleObject::GetInstance(), AccountName, &Return))
|
||||
{
|
||||
SERLOG5(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckBilling_LogOut_Post ȣ<><C8A3> <20><><EFBFBD><EFBFBD> : %s",
|
||||
UserID, AccountName, ServerID, Cmd, CDBSingleObject::GetInstance().GetErrorString());
|
||||
return true;
|
||||
}
|
||||
|
||||
if(0 != Return && 10 != Return)
|
||||
{
|
||||
SERLOG5(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckBilling_LogOut_Post ȣ<><C8A3> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. %u",
|
||||
UserID, AccountName, ServerID, Cmd, Return);
|
||||
}
|
||||
else
|
||||
{
|
||||
DETLOG5(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckBilling_LogOut_Post ȣ<><C8A3> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>. %u",
|
||||
UserID, AccountName, ServerID, Cmd, Return);
|
||||
|
||||
if(10 == Return)
|
||||
{
|
||||
if(!CHanUnitedLogout::GetInstance().AddLogout(*lpPktUUT))
|
||||
{
|
||||
SERLOG5(g_Log, "ID:%s/IP:%s/UID:%u/CID:%u/ServerID:0x%08x/<2F><><EFBFBD>պ<EFBFBD><D5BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>αƿ<D7BE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.",
|
||||
lpPktUUT->m_strAccount, inet_ntoa(lpPktUUT->m_IPAddress),
|
||||
lpPktUUT->m_dwUserID, lpPktUUT->m_dwCharID, ServerID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
SERLOG1(g_Log, "<EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> Ŀ<>ǵ<EFBFBD>(%d)<29><> <20><><EFBFBD><EFBFBD><EFBFBD>Խ<EFBFBD><D4BD>ϴ<EFBFBD>.", Cmd);
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CUIDAgentDispatch::ProcessDisconnectHanUnited()
|
||||
{
|
||||
// <20>Ѱ<EFBFBD><D1B0><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>̳<EFBFBD>, <20>Ѱ<EFBFBD><D1B0><EFBFBD> <20><><EFBFBD>պ<EFBFBD><D5BA><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
||||
unsigned long Result = 0;
|
||||
|
||||
// TODO : <20>αƿ<D7BE> ó<><C3B3>.
|
||||
if(!DBComponent::BillingDB::USPDisConnectLogOut_Post(CDBSingleObject::GetInstance(), m_Group))
|
||||
{
|
||||
SERLOG3(g_Log, "%d <20><EFBFBD> <20>αƿ<D7BE> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:0x%08x DB<44><42><EFBFBD><EFBFBD> <20>α<EFBFBD>:%s",
|
||||
m_Group, Result, CDBSingleObject::GetInstance().GetErrorString());
|
||||
}
|
||||
else
|
||||
{
|
||||
#pragma pack(1)
|
||||
|
||||
struct HanUnitedBillingUser
|
||||
{
|
||||
char m_szID[20];
|
||||
char m_szIP[15];
|
||||
};
|
||||
|
||||
#pragma pack()
|
||||
|
||||
GET_SINGLE_DISPATCH(lpHanUnitedDispatch, CHanUnitedDispatch,
|
||||
CHanUnitedDispatch::GetDispatchTable());
|
||||
|
||||
HanUnitedBillingUser hanUnitedBillingUser[OleDB::MaxRowNum];
|
||||
memset(&hanUnitedBillingUser, 0, sizeof(HanUnitedBillingUser) * OleDB::MaxRowNum);
|
||||
|
||||
PktUUT pktUUT;
|
||||
memset(&pktUUT, 0, sizeof(PktUUT));
|
||||
|
||||
int nGetRow = 0;
|
||||
while(CDBSingleObject::GetInstance().GetData((void**)hanUnitedBillingUser,
|
||||
sizeof(HanUnitedBillingUser), OleDB::MaxRowNum, &nGetRow))
|
||||
{
|
||||
if(0 == nGetRow)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
HanUnitedBillingUser* lpBillingUser = hanUnitedBillingUser;
|
||||
HanUnitedBillingUser* lpBillingUserEnd = hanUnitedBillingUser + nGetRow;
|
||||
|
||||
for(; lpBillingUser != lpBillingUserEnd; ++lpBillingUser)
|
||||
{
|
||||
_snprintf(pktUUT.m_strAccount,
|
||||
PktUUT::MaxAccountLen, "%s", lpBillingUser->m_szID);
|
||||
pktUUT.m_strAccount[PktUUT::MaxAccountLen - 1] = 0;
|
||||
|
||||
pktUUT.m_IPAddress.S_un.S_addr = inet_addr(lpBillingUser->m_szIP);
|
||||
|
||||
if(!CHanUnitedLogout::GetInstance().AddLogout(pktUUT))
|
||||
{
|
||||
SERLOG3(g_Log, "ID:%s/IP:%s/ServerGroup:%d/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>պ<EFBFBD><D5BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>αƿ<D7BE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.",
|
||||
lpBillingUser->m_szID, lpBillingUser->m_szIP, m_Group);
|
||||
}
|
||||
}
|
||||
|
||||
memset(&hanUnitedBillingUser, 0, sizeof(HanUnitedBillingUser) * OleDB::MaxRowNum);
|
||||
}
|
||||
|
||||
SERLOG1(g_Log, "%d <20><EFBFBD> USPDisConnectLogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD>", m_Group);
|
||||
|
||||
if(!DBComponent::BillingDB::USPServer_End(CDBSingleObject::GetInstance(), m_Group, &Result))
|
||||
{
|
||||
SERLOG3(g_Log, "%d <20><EFBFBD> <20>αƿ<D7BE> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:0x%08x DB<44><42><EFBFBD><EFBFBD> <20>α<EFBFBD>:%s",
|
||||
m_Group, Result, CDBSingleObject::GetInstance().GetErrorString());
|
||||
}
|
||||
else
|
||||
{
|
||||
SERLOG1(g_Log, "%d <20><EFBFBD> USEServer_End ȣ<><C8A3> <20><><EFBFBD><EFBFBD>", m_Group);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
154
Server/RylServerProject/RylUIDServer/Billing_Japan.cpp
Normal file
154
Server/RylServerProject/RylUIDServer/Billing_Japan.cpp
Normal file
@@ -0,0 +1,154 @@
|
||||
#include "stdafx.h"
|
||||
#include "UserIDTable.h"
|
||||
#include "UIDAgentDispatch.h"
|
||||
#include "SendAgentPacket.h"
|
||||
|
||||
#include <Log/ServerLog.h>
|
||||
#include <Network/Packet/PacketStruct/ServerPacket.h>
|
||||
#include <Utility/Setup/ServerSetup.h>
|
||||
#include <DB/DBComponent.h>
|
||||
#include <DB/BillingDBComponent.h>
|
||||
|
||||
#include <Utility/Debug/PerformanceCheck.h>
|
||||
|
||||
// <20>Ϻ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ÿ<EFBFBD><C5B8> <20><><EFBFBD><EFBFBD> Ÿ<><C5B8> (2005-09-20 zun!)
|
||||
bool CUIDAgentDispatch::ProcessBillingJapan(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;
|
||||
IN_ADDR& IPAddress = lpPktUUT->m_IPAddress;
|
||||
|
||||
switch(Cmd)
|
||||
{
|
||||
case PktUUT::UpdateUIDTableUserLogin:
|
||||
{
|
||||
CPerformanceInstrument userLogin("UserLogin");
|
||||
CAutoInstrument autoInstrument(userLogin);
|
||||
|
||||
unsigned long dwReturnedFlag = 0;
|
||||
|
||||
if (false == DBComponent::BillingDB::USPJapanUserLoginToAuth(CDBSingleObject::GetInstance(),
|
||||
AccountName, UserID, 0, inet_ntoa(IPAddress), GetGroup(), &dwReturnedFlag))
|
||||
{
|
||||
ERRLOG6(g_Log, "USPJapanUserLoginToAuth(User Login) ȣ<><C8A3> <20><><EFBFBD><EFBFBD>- UID: %u, AccountName: %s, ServerID: 0x%08x, CMD: %d, IP: %s, ErrMsg: %s",
|
||||
UserID, AccountName, ServerID, Cmd, inet_ntoa(IPAddress), CDBSingleObject::GetInstance().GetErrorString());
|
||||
|
||||
// Flag 4 -> '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><DFBB>߽<EFBFBD><DFBD>ϴ<EFBFBD>.'
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 4, 0, 0, 'N', 0, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (0 != dwReturnedFlag)
|
||||
{
|
||||
// Flag 20 -> <20>ߺ<EFBFBD> <20>α<EFBFBD><CEB1><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 20, 0, 0, 'N', 0, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
DETLOG5(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>α<EFBFBD><CEB1><EFBFBD>- UID: %u, AccountName: %s, ServerID: 0x%08x, CMD: %d, IP: %s",
|
||||
UserID, AccountName, ServerID, Cmd, inet_ntoa(IPAddress));
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>α<EFBFBD><CEB1><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 0, 0, 0, 'N', 0, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case PktUUT::UpdateUIDTableCharLogin:
|
||||
{
|
||||
CPerformanceInstrument charLogin("CharLogin");
|
||||
CAutoInstrument autoInstrument(charLogin);
|
||||
|
||||
unsigned long dwReturnedFlag = 0;
|
||||
|
||||
if (false == DBComponent::BillingDB::USPJapanUserLoginToZone(CDBSingleObject::GetInstance(),
|
||||
AccountName, UserID, 0, inet_ntoa(IPAddress), GetGroup(), &dwReturnedFlag))
|
||||
{
|
||||
ERRLOG6(g_Log, "USPJapanUserLoginToZone(Char Login) ȣ<><C8A3> <20><><EFBFBD><EFBFBD>- UID: %u, AccountName: %s, ServerID: 0x%08x, CMD: %d, IP: %s, ErrMsg: %s",
|
||||
UserID, AccountName, ServerID, Cmd, inet_ntoa(IPAddress), CDBSingleObject::GetInstance().GetErrorString());
|
||||
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 4, 0, 0, 'N', 0, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (0 != dwReturnedFlag)
|
||||
{
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 20, 0, 0, 'N', 0, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
DETLOG5(g_Log, "ij<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>α<EFBFBD><CEB1><EFBFBD>- UID: %u, AccountName: %s, ServerID: 0x%08x, CMD: %d, IP: %s",
|
||||
UserID, AccountName, ServerID, Cmd, inet_ntoa(IPAddress));
|
||||
|
||||
// <20><><EFBFBD>Ӽ<EFBFBD><D3BC><EFBFBD><EFBFBD><EFBFBD> <20>α<EFBFBD><CEB1><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
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 dwReturnedFlag = 0;
|
||||
|
||||
if (false == DBComponent::BillingDB::USPJapanUserLogOut(CDBSingleObject::GetInstance(),
|
||||
AccountName, &dwReturnedFlag))
|
||||
{
|
||||
ERRLOG5(g_Log, "USPJapanUserLogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD>- UID: %u, AccountName: %s, ServerID: 0x%08x, CMD: %d, ErrMsg: %s",
|
||||
UserID, AccountName, ServerID, Cmd, CDBSingleObject::GetInstance().GetErrorString());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
DETLOG5(g_Log, "USPJapanUserLogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>- UID: %u, AccountName: %s, ServerID: 0x%08x, CMD: %d, ReturnedFlag: %u",
|
||||
UserID, AccountName, ServerID, Cmd, dwReturnedFlag);
|
||||
}
|
||||
break;
|
||||
|
||||
case PktUUT::UpdateUIDTableUserMove:
|
||||
case PktUUT::UpdateUIDTableCharMove:
|
||||
{
|
||||
CPerformanceInstrument move("ZoneMove");
|
||||
CAutoInstrument autoInstrument(move);
|
||||
|
||||
unsigned long dwReturnedFlag = 0;
|
||||
|
||||
if (false == DBComponent::BillingDB::USPJapanUserLogOut(CDBSingleObject::GetInstance(),
|
||||
AccountName, &dwReturnedFlag))
|
||||
{
|
||||
ERRLOG5(g_Log, "USPJapanUserLogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD>- UID: %u, AccountName: %s, ServerID: 0x%08x, CMD: %d, ErrMsg: %s",
|
||||
UserID, AccountName, ServerID, Cmd, CDBSingleObject::GetInstance().GetErrorString());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
DETLOG5(g_Log, "USPJapanUserLogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>- UID: %u, AccountName: %s, ServerID: 0x%08x, CMD: %d, ReturnedFlag: %u",
|
||||
UserID, AccountName, ServerID, Cmd, dwReturnedFlag);
|
||||
}
|
||||
break;
|
||||
};
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CUIDAgentDispatch::ProcessDisconnectJapan()
|
||||
{
|
||||
unsigned long dwResult = 0;
|
||||
|
||||
if (false == DBComponent::BillingDB::USPServer_End(CDBSingleObject::GetInstance(), m_Group, &dwResult))
|
||||
{
|
||||
SERLOG3(g_Log, "%d <20><EFBFBD> <20>αƿ<D7BE> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:0x%08x DB<44><42><EFBFBD><EFBFBD> <20>α<EFBFBD>:%s",
|
||||
m_Group, dwResult, CDBSingleObject::GetInstance().GetErrorString());
|
||||
}
|
||||
else
|
||||
{
|
||||
SERLOG1(g_Log, "%d <20><EFBFBD> USEServer_End ȣ<><C8A3> <20><><EFBFBD><EFBFBD>", m_Group);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
175
Server/RylServerProject/RylUIDServer/Billing_ROWGlobal.cpp
Normal file
175
Server/RylServerProject/RylUIDServer/Billing_ROWGlobal.cpp
Normal file
@@ -0,0 +1,175 @@
|
||||
#include "stdafx.h"
|
||||
#include "UserIDTable.h"
|
||||
#include "UIDAgentDispatch.h"
|
||||
#include "SendAgentPacket.h"
|
||||
|
||||
#include <Log/ServerLog.h>
|
||||
#include <Network/Packet/PacketStruct/ServerPacket.h>
|
||||
#include <Utility/Setup/ServerSetup.h>
|
||||
#include <DB/DBComponent.h>
|
||||
#include <DB/BillingDBComponent.h>
|
||||
|
||||
#include <Utility/Debug/PerformanceCheck.h>
|
||||
|
||||
#ifdef AUTH_MY
|
||||
#include "NFAuthClient/AuthClient.h"
|
||||
#endif
|
||||
|
||||
// <20>븸<EFBFBD><EBB8B8> <20><><EFBFBD><EFBFBD>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD>, <20><> 30<33>и<EFBFBD><D0B8><EFBFBD> <20>ð<EFBFBD><C3B0><EFBFBD> <20><><EFBFBD>ϴ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ȴ<EFBFBD>.
|
||||
// <20>ð<EFBFBD><C3B0><EFBFBD> <20><><EFBFBD>ϴ<EFBFBD> <20><>ƾ<EFBFBD><C6BE>, <20>߰輭<DFB0><E8BCAD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
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;
|
||||
|
||||
// <20><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD> <20><><EFBFBD><EFBFBD> ó<><C3B3> <20><>ƾ
|
||||
switch(Cmd)
|
||||
{
|
||||
case PktUUT::UpdateUIDTableUserLogin:
|
||||
{
|
||||
CPerformanceInstrument userLogin("UserLogin");
|
||||
CAutoInstrument autoInstrument(userLogin);
|
||||
|
||||
#ifdef AUTH_MY
|
||||
// edith 2009.09.11 MY<4D><59> <20><><EFBFBD><EFBFBD> AllowIP ó<><C3B3><EFBFBD>۾<EFBFBD>
|
||||
char* szAdd = inet_ntoa(IPAddress);
|
||||
if(!g_IPSec.IsAliveIP(szAdd))
|
||||
{
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 57, 0, 0, 'N', 0, 0);
|
||||
|
||||
ERRLOG5(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d Alive ȣ<><C8A3> <20><><EFBFBD><EFBFBD> %s",
|
||||
UserID, AccountName, ServerID, Cmd, inet_ntoa(IPAddress));
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Ű<><C5B0> <20><><EFBFBD><EFBFBD> ó<><C3B3>
|
||||
RE_USPCheckBilling_Login GetData = {0,};
|
||||
|
||||
if(!DBComponent::BillingDB::USPCheckUser_Login(CDBSingleObject::GetInstance(),
|
||||
AccountName, UserID, 0, inet_ntoa(IPAddress), GetGroup(), &GetData))
|
||||
{
|
||||
ERRLOG6(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckUser_Login ȣ<><C8A3> <20><><EFBFBD><EFBFBD> %s : %s",
|
||||
UserID, AccountName, ServerID, Cmd, inet_ntoa(IPAddress), CDBSingleObject::GetInstance().GetErrorString());
|
||||
|
||||
// DB Query<72><79><EFBFBD><EFBFBD>(Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ<EFBFBD><C6AE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> 1<><31> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>) <20><EFBFBD>
|
||||
// AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 4, 0, 0, 'N', 0, 0);
|
||||
// return true;
|
||||
}
|
||||
|
||||
// ROW<4F><57><EFBFBD><EFBFBD> <20><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʴ´<CAB4>.
|
||||
// ROW<4F><57><EFBFBD><EFBFBD> <20><>ü<EFBFBD><C3BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 0, 0, 0, 'N', 0, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case PktUUT::UpdateUIDTableCharLogin:
|
||||
{
|
||||
#ifdef AUTH_MY
|
||||
// edith 2009.09.11 MY<4D><59> <20><><EFBFBD><EFBFBD> AllowIP ó<><C3B3><EFBFBD>۾<EFBFBD>
|
||||
char* szAdd = inet_ntoa(IPAddress);
|
||||
if(!g_IPSec.IsAliveIP(szAdd))
|
||||
{
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 30, 0, 0, 'N', 0, 0);
|
||||
|
||||
ERRLOG5(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d Alive ȣ<><C8A3> <20><><EFBFBD><EFBFBD> %s",
|
||||
UserID, AccountName, ServerID, Cmd, inet_ntoa(IPAddress));
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
/* CPerformanceInstrument userLogin("CharLogin");
|
||||
CAutoInstrument autoInstrument(userLogin);
|
||||
|
||||
// Ű<><C5B0> <20><><EFBFBD><EFBFBD> ó<><C3B3>
|
||||
RE_USPCheckBilling_Login GetData = {0,};
|
||||
|
||||
if(!DBComponent::BillingDB::USPCheckUser_CharIDLogin(CDBSingleObject::GetInstance(),
|
||||
AccountName, UserID, 0, inet_ntoa(IPAddress), GetGroup(), &GetData))
|
||||
{
|
||||
ERRLOG6(g_Log, "<22><><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckUser_Login ȣ<><C8A3> <20><><EFBFBD><EFBFBD> %s : %s",
|
||||
UserID, AccountName, ServerID, Cmd, inet_ntoa(IPAddress), CDBSingleObject::GetInstance().GetErrorString());
|
||||
|
||||
// DB Query<72><79><EFBFBD><EFBFBD>(Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ<EFBFBD><C6AE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> 1<><31> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>) <20><EFBFBD>
|
||||
// AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 4, 0, 0, 'N', 0, 0);
|
||||
// return true;
|
||||
}
|
||||
*/
|
||||
// ROW<4F><57><EFBFBD><EFBFBD> <20><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʴ´<CAB4>.
|
||||
// ROW<4F><57><EFBFBD><EFBFBD> <20><>ü<EFBFBD><C3BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 0, 0, 0, 'N', 0, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case PktUUT::UpdateUIDTableBillingCheck:
|
||||
// ROW<4F><57><EFBFBD><EFBFBD> <20><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʴ´<CAB4>.
|
||||
// ROW<4F><57><EFBFBD><EFBFBD> <20><>ü<EFBFBD><C3BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 0, 0, 0, 'N', 0, 0);
|
||||
break;
|
||||
|
||||
case PktUUT::UpdateUIDTableUserLogout:
|
||||
// case PktUUT::UpdateUIDTableCharLogout:
|
||||
{
|
||||
CPerformanceInstrument logout("Logout");
|
||||
CAutoInstrument autoInstrument(logout);
|
||||
|
||||
// Ű<><C5B0> ó<><C3B3>
|
||||
unsigned long Return = 0;
|
||||
|
||||
if(!DBComponent::BillingDB::USPCheckUser_LogOut(CDBSingleObject::GetInstance(), AccountName, &Return))
|
||||
{
|
||||
ERRLOG5(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckUser_LogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD> : %s",
|
||||
UserID, AccountName, ServerID, Cmd, CDBSingleObject::GetInstance().GetErrorString());
|
||||
return true;
|
||||
}
|
||||
|
||||
if(0 != Return)
|
||||
{
|
||||
ERRLOG5(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckUser_LogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. %u",
|
||||
UserID, AccountName, ServerID, Cmd, Return);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/*
|
||||
case PktUUT::UpdateUIDTableUserMove:
|
||||
case PktUUT::UpdateUIDTableCharMove:
|
||||
{
|
||||
CPerformanceInstrument move("ZoneMove");
|
||||
CAutoInstrument autoInstrument(move);
|
||||
|
||||
// Ű<><C5B0> ó<><C3B3>
|
||||
unsigned long Return = 0;
|
||||
|
||||
if(!DBComponent::BillingDB::USPCheckUser_LogOut(CDBSingleObject::GetInstance(), AccountName, &Return))
|
||||
{
|
||||
ERRLOG5(g_Log, "<22><><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckUser_LogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD> : %s",
|
||||
UserID, AccountName, ServerID, Cmd, CDBSingleObject::GetInstance().GetErrorString());
|
||||
return true;
|
||||
}
|
||||
|
||||
if(0 != Return)
|
||||
{
|
||||
ERRLOG5(g_Log, "<22><><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckUser_LogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. %u",
|
||||
UserID, AccountName, ServerID, Cmd, Return);
|
||||
}
|
||||
}
|
||||
break;
|
||||
*/
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CUIDAgentDispatch::ProcessDisconnectROWGlobal()
|
||||
{
|
||||
// ROW<4F><57><EFBFBD><EFBFBD> <20><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʱ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
return true;
|
||||
}
|
||||
275
Server/RylServerProject/RylUIDServer/Billing_YouxiLand.cpp
Normal file
275
Server/RylServerProject/RylUIDServer/Billing_YouxiLand.cpp
Normal file
@@ -0,0 +1,275 @@
|
||||
#include "stdafx.h"
|
||||
#include "UserIDTable.h"
|
||||
#include "UIDAgentDispatch.h"
|
||||
#include "SendAgentPacket.h"
|
||||
|
||||
#include <Log/ServerLog.h>
|
||||
#include <Network/Packet/PacketStruct/ServerPacket.h>
|
||||
#include <Utility/Setup/ServerSetup.h>
|
||||
#include <DB/DBComponent.h>
|
||||
#include <DB/BillingDBComponent.h>
|
||||
|
||||
#include <Utility/Debug/PerformanceCheck.h>
|
||||
|
||||
// <20>븸<EFBFBD><EBB8B8> <20><><EFBFBD><EFBFBD>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD>, <20><> 30<33>и<EFBFBD><D0B8><EFBFBD> <20>ð<EFBFBD><C3B0><EFBFBD> <20><><EFBFBD>ϴ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ȴ<EFBFBD>.
|
||||
// <20>ð<EFBFBD><C3B0><EFBFBD> <20><><EFBFBD>ϴ<EFBFBD> <20><>ƾ<EFBFBD><C6BE>, <20>߰輭<DFB0><E8BCAD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
bool CUIDAgentDispatch::ProcessBillingYouxiLand(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;
|
||||
|
||||
// <20><> <20>ߺ<EFBFBD><DFBA>α<EFBFBD><CEB1><EFBFBD> <20><> <20>α<EFBFBD><CEB1>ηαƿ<D7BE> <20>α<EFBFBD> <20><>ƾ
|
||||
switch(Cmd)
|
||||
{
|
||||
case PktUUT::UpdateUIDTableUserLogin:
|
||||
{
|
||||
CPerformanceInstrument userLogin("UserLogin");
|
||||
CAutoInstrument autoInstrument(userLogin);
|
||||
|
||||
// Ű<><C5B0> <20><><EFBFBD><EFBFBD> ó<><C3B3>
|
||||
RE_USPCheckBilling_Login GetData = {0,};
|
||||
|
||||
if(!DBComponent::BillingDB::USPCheckBilling_Login(CDBSingleObject::GetInstance(),
|
||||
AccountName, UserID, 0, inet_ntoa(IPAddress), GetGroup(), &GetData))
|
||||
{
|
||||
SERLOG6(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckBilling_Login ȣ<><C8A3> <20><><EFBFBD><EFBFBD> %s : %s",
|
||||
UserID, AccountName, ServerID, Cmd, inet_ntoa(IPAddress), CDBSingleObject::GetInstance().GetErrorString());
|
||||
|
||||
// DB Query<72><79><EFBFBD><EFBFBD>(Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ<EFBFBD><C6AE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> 1<><31> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>) <20><EFBFBD>
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 4, 0, 0, 'N', 0, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ Ack
|
||||
|
||||
if(0 != GetData.Flag)
|
||||
{
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 20, 0, 0, 'N', 0, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
// DETLOG7(g_Log, "<22><><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckBilling_Login ȣ<><C8A3> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>. %u, %u [%s]",
|
||||
// UserID, AccountName, ServerID, Cmd, GetData.Flag, GetData.intCRMIndex1, inet_ntoa(IPAddress));
|
||||
}
|
||||
break;
|
||||
|
||||
case PktUUT::UpdateUIDTableCharLogin:
|
||||
{
|
||||
CPerformanceInstrument charLogin("CharLogin");
|
||||
CAutoInstrument autoInstrument(charLogin);
|
||||
|
||||
// Ű<><C5B0> <20><><EFBFBD><EFBFBD> ó<><C3B3>
|
||||
RE_USPCheckBilling_Login GetData = {0,};
|
||||
|
||||
if(!DBComponent::BillingDB::USPCheckBilling_CharIDLogin(CDBSingleObject::GetInstance(),
|
||||
AccountName, UserID, 0, inet_ntoa(IPAddress), GetGroup(), &GetData))
|
||||
{
|
||||
SERLOG6(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckBilling_CharIDLogin ȣ<><C8A3> <20><><EFBFBD><EFBFBD> %s : %s",
|
||||
UserID, AccountName, ServerID, Cmd, inet_ntoa(IPAddress), CDBSingleObject::GetInstance().GetErrorString());
|
||||
|
||||
// DB Query<72><79><EFBFBD><EFBFBD>(Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ<EFBFBD><C6AE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> 1<><31> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>) <20><EFBFBD>
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 4, 0, 0, 'N', 0, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ Ack
|
||||
if(0 != GetData.Flag)
|
||||
{
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 20, 0, 0, 'N', 0, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
// DETLOG7(g_Log, "<22><><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckBilling_CharIDLogin ȣ<><C8A3> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>. %u, %u [%s]",
|
||||
// UserID, AccountName, ServerID, Cmd, GetData.Flag, GetData.intCRMIndex1, inet_ntoa(IPAddress));
|
||||
}
|
||||
break;
|
||||
|
||||
case PktUUT::UpdateUIDTableUserLogout:
|
||||
case PktUUT::UpdateUIDTableCharLogout:
|
||||
{
|
||||
CPerformanceInstrument logout("Logout");
|
||||
CAutoInstrument autoInstrument(logout);
|
||||
|
||||
// Ű<><C5B0> ó<><C3B3>
|
||||
unsigned long Return = 0;
|
||||
|
||||
if(!DBComponent::BillingDB::USPCheckBilling_LogOut(CDBSingleObject::GetInstance(), AccountName, &Return))
|
||||
{
|
||||
SERLOG5(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckBilling_LogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD> : %s",
|
||||
UserID, AccountName, ServerID, Cmd, CDBSingleObject::GetInstance().GetErrorString());
|
||||
return true;
|
||||
}
|
||||
|
||||
if(0 != Return)
|
||||
{
|
||||
SERLOG5(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckBilling_LogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. %u",
|
||||
UserID, AccountName, ServerID, Cmd, Return);
|
||||
}
|
||||
/*
|
||||
else
|
||||
{
|
||||
DETLOG5(g_Log, "<22><><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckBilling_LogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>. %u",
|
||||
UserID, AccountName, ServerID, Cmd, Return);
|
||||
}
|
||||
*/
|
||||
}
|
||||
break;
|
||||
|
||||
case PktUUT::UpdateUIDTableUserMove:
|
||||
case PktUUT::UpdateUIDTableCharMove:
|
||||
{
|
||||
CPerformanceInstrument move("ZoneMove");
|
||||
CAutoInstrument autoInstrument(move);
|
||||
|
||||
// Ű<><C5B0> ó<><C3B3>
|
||||
unsigned long Return = 0;
|
||||
|
||||
if(!DBComponent::BillingDB::USPCheckBilling_LogOut(CDBSingleObject::GetInstance(), AccountName, &Return))
|
||||
{
|
||||
SERLOG5(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckBilling_LogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD> : %s",
|
||||
UserID, AccountName, ServerID, Cmd, CDBSingleObject::GetInstance().GetErrorString());
|
||||
return true;
|
||||
}
|
||||
|
||||
if(0 != Return)
|
||||
{
|
||||
SERLOG5(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckBilling_LogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. %u",
|
||||
UserID, AccountName, ServerID, Cmd, Return);
|
||||
}
|
||||
/*
|
||||
else
|
||||
{
|
||||
DETLOG5(g_Log, "<22><><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d USPCheckBilling_LogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>. %u",
|
||||
UserID, AccountName, ServerID, Cmd, Return);
|
||||
}
|
||||
*/
|
||||
}
|
||||
break;
|
||||
};
|
||||
|
||||
// <20><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD> <20><><EFBFBD><EFBFBD> ó<><C3B3> <20><>ƾ
|
||||
switch(Cmd)
|
||||
{
|
||||
case PktUUT::UpdateUIDTableUserLogin:
|
||||
case PktUUT::UpdateUIDTableBillingCheck:
|
||||
{
|
||||
// <20>븸 <20><><EFBFBD><EFBFBD>
|
||||
PAY_AUTH PayAuth = {0,};
|
||||
|
||||
// 12<31>д<EFBFBD> 20<32><30><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD>ó<EFBFBD><C3B3><EFBFBD><EFBFBD> <20>ϴµ<CFB4>
|
||||
// PayAUthMyth <20><><EFBFBD><EFBFBD><EFBFBD>ȿ<EFBFBD> <20><><EFBFBD><EFBFBD> <20>ű⼭ 12, 20<32>̶<EFBFBD> <20><><EFBFBD>ڸ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ó<><C3B3><EFBFBD><EFBFBD> <20>Ѵ<EFBFBD>.
|
||||
if (!DBComponent::BillingDB::PayAuthMyth(CDBSingleObject::GetInstance(),
|
||||
AccountName, inet_ntoa(IPAddress), &PayAuth))
|
||||
{
|
||||
SERLOG6(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d PayAuthMyth ȣ<><C8A3> <20><><EFBFBD><EFBFBD> %s : %s",
|
||||
UserID, AccountName, ServerID, Cmd, inet_ntoa(IPAddress),
|
||||
CDBSingleObject::GetInstance().GetErrorString());
|
||||
|
||||
if(PktUUT::UpdateUIDTableUserLogin == Cmd)
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD> <20>α<EFBFBD><CEB1><EFBFBD><EFBFBD≯<EFBFBD>, <20>α<EFBFBD><CEB1><EFBFBD> <20><><EFBFBD><EFBFBD>!
|
||||
|
||||
unsigned long Return = 0;
|
||||
if(!DBComponent::BillingDB::USPCheckBilling_LogOut(CDBSingleObject::GetInstance(), AccountName, &Return))
|
||||
{
|
||||
SERLOG5(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d PayAuthMyth ȣ<><C8A3> <20><><EFBFBD>з<EFBFBD> <20>αƿ<D7BE><C6BF><EFBFBD>. USPCheckBilling_LogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD> : %s",
|
||||
UserID, AccountName, ServerID, Cmd, CDBSingleObject::GetInstance().GetErrorString());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if(0 != Return)
|
||||
{
|
||||
SERLOG5(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d - <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ν<EFBFBD><CEBD><EFBFBD> ȣ<><C8A3> <20><><EFBFBD><EFBFBD> <20>αƿ<D7BE> - USPCheckBilling_LogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. %u",
|
||||
UserID, AccountName, ServerID, Cmd, Return);
|
||||
}
|
||||
else
|
||||
{
|
||||
DETLOG5(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d - <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ν<EFBFBD><CEBD><EFBFBD> ȣ<><C8A3> <20><><EFBFBD><EFBFBD> <20>αƿ<D7BE> - USPCheckBilling_LogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>. %u",
|
||||
UserID, AccountName, ServerID, Cmd, Return);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ Ack
|
||||
if(FALSE == CServerSetup::GetInstance().GetIgnoreFlag())
|
||||
{
|
||||
if(0 != PayAuth.Errcode && Cmd == PktUUT::UpdateUIDTableUserLogin)
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD> <20>α<EFBFBD><CEB1><EFBFBD><EFBFBD≯<EFBFBD>, <20>α<EFBFBD><CEB1><EFBFBD> <20><><EFBFBD><EFBFBD>!
|
||||
|
||||
unsigned long Return = 0;
|
||||
if(!DBComponent::BillingDB::USPCheckBilling_LogOut(CDBSingleObject::GetInstance(), AccountName, &Return))
|
||||
{
|
||||
SERLOG6(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d PayAuthMyth(Err:%d) USPCheckBilling_LogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD> : %s",
|
||||
UserID, AccountName, ServerID, Cmd, PayAuth.Errcode, CDBSingleObject::GetInstance().GetErrorString());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if(0 != Return)
|
||||
{
|
||||
SERLOG5(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d - <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ν<EFBFBD><CEBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>αƿ<D7BE> - USPCheckBilling_LogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. %u",
|
||||
UserID, AccountName, ServerID, Cmd, Return);
|
||||
}
|
||||
else
|
||||
{
|
||||
DETLOG5(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d - <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ν<EFBFBD><CEBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>αƿ<D7BE> - USPCheckBilling_LogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>. %u",
|
||||
UserID, AccountName, ServerID, Cmd, Return);
|
||||
}
|
||||
}
|
||||
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID,
|
||||
PayAuth.Errcode, PayAuth.Time, 0, 'Y', static_cast<unsigned short>(PayAuth.WarningCode), 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 0, 0, 0, 'N', 0, 0);
|
||||
}
|
||||
|
||||
// DETLOG7(g_Log, "<22><><EFBFBD><EFBFBD>(%u) [%s] <20><><EFBFBD><EFBFBD>(0x%08x) ST:%d - PayAuthMyth ȣ<><C8A3> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>. Error:%u Time:%u, [%s]",
|
||||
// UserID, AccountName, ServerID, Cmd, PayAuth.Errcode, PayAuth.Time, inet_ntoa(IPAddress));
|
||||
}
|
||||
break;
|
||||
|
||||
case PktUUT::UpdateUIDTableCharLogin:
|
||||
{
|
||||
AgentSendPacket::SendUpdateUIDTable(GetGroup(), Cmd, UserID, 0, 0, 0, 'N', 0, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case PktUUT::UpdateUIDTableUserLogout:
|
||||
case PktUUT::UpdateUIDTableCharLogout:
|
||||
case PktUUT::UpdateUIDTableUserMove:
|
||||
case PktUUT::UpdateUIDTableCharMove:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CUIDAgentDispatch::ProcessDisconnectYouxiLand()
|
||||
{
|
||||
unsigned long dwResult = 0;
|
||||
|
||||
if(!DBComponent::BillingDB::USPServer_End(CDBSingleObject::GetInstance(), m_Group, &dwResult))
|
||||
{
|
||||
SERLOG3(g_Log, "%d <20><EFBFBD> <20>αƿ<D7BE> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:0x%08x DB<44><42><EFBFBD><EFBFBD> <20>α<EFBFBD>:%s",
|
||||
m_Group, dwResult, CDBSingleObject::GetInstance().GetErrorString());
|
||||
}
|
||||
else
|
||||
{
|
||||
SERLOG1(g_Log, "%d <20><EFBFBD> USEServer_End ȣ<><C8A3> <20><><EFBFBD><EFBFBD>", m_Group);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
1309
Server/RylServerProject/RylUIDServer/HanUnitedBilling.cpp
Normal file
1309
Server/RylServerProject/RylUIDServer/HanUnitedBilling.cpp
Normal file
File diff suppressed because it is too large
Load Diff
173
Server/RylServerProject/RylUIDServer/HanUnitedBilling.h
Normal file
173
Server/RylServerProject/RylUIDServer/HanUnitedBilling.h
Normal file
@@ -0,0 +1,173 @@
|
||||
#ifndef _HAN_UNITED_BILLING_PROCESS_
|
||||
#define _HAN_UNITED_BILLING_PROCESS_
|
||||
|
||||
#include <Thread/Lock.h>
|
||||
#include <Network/Dispatch/Dispatch.h>
|
||||
#include <Network/Packet/PacketStruct/ServerPacket.h>
|
||||
|
||||
#include <Stream/Buffer/BufferQueue.h>
|
||||
#include <boost/pool/pool_alloc.hpp>
|
||||
|
||||
#include <Network/Dispatch/SingleDispatchStorage.h>
|
||||
|
||||
#include <DB/DBDefine.h>
|
||||
|
||||
// forward decl.
|
||||
class CIOCPNet;
|
||||
class CBufferFactory;
|
||||
|
||||
namespace HanUnitedBilling
|
||||
{
|
||||
struct GLTransStruct;
|
||||
}
|
||||
|
||||
|
||||
//! ---------------------------------------------------------------
|
||||
//!
|
||||
//! <20><><EFBFBD><EFBFBD> SequenceID Ŭ<><C5AC><EFBFBD><EFBFBD><EFBFBD>̴<EFBFBD>. <20><> <20><>Ŷ<EFBFBD><C5B6> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ID<49><44> <20>ű<EFBFBD><C5B1><EFBFBD>.
|
||||
//!
|
||||
//! ---------------------------------------------------------------
|
||||
class CHanUnitedSequenceID
|
||||
{
|
||||
public:
|
||||
|
||||
static CHanUnitedSequenceID& GetInstance();
|
||||
unsigned long GetUniqueID() { return m_dwSeqID++; }
|
||||
|
||||
private:
|
||||
|
||||
CHanUnitedSequenceID() : m_dwSeqID(0) { }
|
||||
~CHanUnitedSequenceID() { }
|
||||
|
||||
unsigned long m_dwSeqID;
|
||||
};
|
||||
|
||||
|
||||
//! ---------------------------------------------------------------
|
||||
//!
|
||||
//! <20>αƿ<D7BE> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ<EFBFBD>̴<EFBFBD>.
|
||||
//! <20>ֱ<EFBFBD><D6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> üũ<C3BC>ؼ<EFBFBD>, Ack<63><6B> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
//!
|
||||
//! ---------------------------------------------------------------
|
||||
class CHanUnitedLogout
|
||||
{
|
||||
public:
|
||||
|
||||
static CHanUnitedLogout& GetInstance();
|
||||
|
||||
bool AddLogout(const PktUUT& pktUUT);
|
||||
bool RemoveLogout(const char* szID, const char* szIP, DWORD dwSeqID);
|
||||
void Retransmission();
|
||||
|
||||
private:
|
||||
|
||||
struct LogoutData
|
||||
{
|
||||
PktUUT m_pktUUT;
|
||||
SYSTEMTIME m_systemTime;
|
||||
DWORD m_dwSendStamp;
|
||||
DWORD m_dwSeqID;
|
||||
|
||||
LogoutData(const PktUUT& pktUUT, DWORD dwSeqID);
|
||||
};
|
||||
|
||||
typedef std::map<DWORD, LogoutData> LogoutMap;
|
||||
|
||||
LogoutMap m_LogoutMap;
|
||||
};
|
||||
|
||||
|
||||
//! ---------------------------------------------------------------
|
||||
//!
|
||||
//! <20>Ѱ<EFBFBD><D1B0><EFBFBD> <20><><EFBFBD>պ<EFBFBD><D5BA><EFBFBD> <20><>Ŷ<EFBFBD><C5B6> ó<><C3B3><EFBFBD>ϴ<EFBFBD> Ŭ<><C5AC><EFBFBD><EFBFBD><EFBFBD>̴<EFBFBD>.
|
||||
//!
|
||||
//! ---------------------------------------------------------------
|
||||
class CHanUnitedDispatch : public CPacketDispatch
|
||||
{
|
||||
public:
|
||||
|
||||
enum
|
||||
{
|
||||
DEFAULT_SEND_TIMEOUT_SEC = 10
|
||||
};
|
||||
|
||||
// <20>̵<EFBFBD><CCB5><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>պ<EFBFBD><D5BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>õ<EFBFBD><C3B5><EFBFBD>.
|
||||
static bool ConnectToHanUnited(CIOCPNet& iocpNet);
|
||||
static CSingleDispatch& GetDispatchTable();
|
||||
|
||||
CHanUnitedDispatch(CSession& Session);
|
||||
virtual ~CHanUnitedDispatch();
|
||||
|
||||
virtual bool ParsePacket(char* const lpStream_In, unsigned long* dwStreamSize_InOut);
|
||||
virtual bool Dispatch();
|
||||
|
||||
virtual void Connected();
|
||||
virtual void Disconnected();
|
||||
|
||||
CBufferFactory& GetBufferFactory();
|
||||
|
||||
//! <20>Ѱ<EFBFBD><D1B0><EFBFBD> <20><><EFBFBD>պ<EFBFBD><D5BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>α<EFBFBD><CEB1><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
bool SendLogin(const PktUUT& pktUUT, const RE_USPCheckBilling_Login& checkBillingLogin,
|
||||
unsigned char cServerGroup, unsigned long dwTimeoutSec = DEFAULT_SEND_TIMEOUT_SEC);
|
||||
|
||||
//! <20>Ѱ<EFBFBD><D1B0><EFBFBD> <20><><EFBFBD>պ<EFBFBD><D5BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>αƿ<D7BE><C6BF><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>. <20>ð<EFBFBD><C3B0><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ð<EFBFBD><C3B0><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
bool SendLogout(const PktUUT& pktUUT, unsigned long dwSeqID,
|
||||
LPSYSTEMTIME lpSystemTime = 0, unsigned long dwTimeoutSec = DEFAULT_SEND_TIMEOUT_SEC);
|
||||
|
||||
//! <20>Ѱ<EFBFBD><D1B0><EFBFBD> <20><><EFBFBD>պ<EFBFBD><D5BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>α<EFBFBD><CEB1><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>θ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
bool SendCanLogin(const PktUUT& pktUUT, const RE_USPCheckBilling_Login& checkBillingLogin,
|
||||
unsigned char cServerGroup, unsigned long dwTimeoutSec = DEFAULT_SEND_TIMEOUT_SEC);
|
||||
|
||||
bool ProcessLoginResult(HanUnitedBilling::GLTransStruct& glTransStruct); // <20>α<EFBFBD><CEB1><EFBFBD> <20><><EFBFBD><EFBFBD> ó<><C3B3>
|
||||
bool ProcessCanLoginResult(HanUnitedBilling::GLTransStruct& glTransStruct); // <20>α<EFBFBD><CEB1><EFBFBD> <20><> <20><> <20>ִ<EFBFBD><D6B4><EFBFBD> <20><><EFBFBD>η<EFBFBD> <20><><EFBFBD><EFBFBD> ó<><C3B3>.
|
||||
bool ProcessWarnNotice(HanUnitedBilling::GLTransStruct& glTransStruct); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><EFBFBD><DEBD><EFBFBD>
|
||||
bool ProcessCutIP(HanUnitedBilling::GLTransStruct& glTransStruct); // Ư<><C6AF> ip<69><70><EFBFBD><EFBFBD>
|
||||
bool ProcessPing(HanUnitedBilling::GLTransStruct& glTransStruct); // <20><> <20><>Ŷ ó<><C3B3>
|
||||
|
||||
bool ProcessLogoutResult(HanUnitedBilling::GLTransStruct& glTransStruct); // <20>αƿ<D7BE> Ackó<6B><C3B3>.
|
||||
|
||||
void ProcessTimeout();
|
||||
void ProcessDisconnected();
|
||||
|
||||
protected:
|
||||
|
||||
typedef CCSLock BufferLock;
|
||||
|
||||
|
||||
//! <20>α<EFBFBD><CEB1><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>. timeout<75><74> <20><><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD> <20>ϱ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>̴<EFBFBD>.
|
||||
//! <20>α<EFBFBD><CEB1><EFBFBD>, <20>α<EFBFBD><CEB1><EFBFBD> <20><><EFBFBD>ɿ<EFBFBD><C9BF><EFBFBD> üũ<C3BC>ÿ<EFBFBD><C3BF><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
struct LoginRequestData
|
||||
{
|
||||
enum
|
||||
{
|
||||
MAX_NAME_LEN = 16
|
||||
};
|
||||
|
||||
__time64_t m_SendTime;
|
||||
unsigned long m_SendStamp;
|
||||
unsigned long m_dwTimeoutSec;
|
||||
|
||||
unsigned long m_dwSeqID;
|
||||
unsigned short m_usMsgType;
|
||||
unsigned char m_cServerGroup;
|
||||
unsigned char m_cPadding;
|
||||
|
||||
PktUUT m_PktUUT;
|
||||
RE_USPCheckBilling_Login m_CheckBillingLogin;
|
||||
|
||||
LoginRequestData(const PktUUT& pktUUT, const RE_USPCheckBilling_Login& checkBillingLogin,
|
||||
unsigned long dwTimeoutSec, unsigned long dwSeqID, unsigned short usMsgType,
|
||||
unsigned char cServerGroup);
|
||||
};
|
||||
|
||||
typedef std::map<unsigned long, LoginRequestData, std::less<unsigned long>,
|
||||
boost::fast_pool_allocator<std::pair<unsigned long, LoginRequestData> > > LoginRequestMap;
|
||||
|
||||
BufferLock m_BufferLock;
|
||||
CACHE_PAD(BufferLockPad, sizeof(BufferLock));
|
||||
|
||||
CBufferQueue m_PacketBuffer;
|
||||
LoginRequestMap m_LoginRequestMap;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,44 @@
|
||||
#ifndef _HAN_UNITED_BILLING_PACKET_STRUCT_
|
||||
#define _HAN_UNITED_BILLING_PACKET_STRUCT_
|
||||
|
||||
/********** LK->UID,UID->LK <20>ۼ<EFBFBD><DBBC>ſ<EFBFBD> <20><><EFBFBD><EFBFBD>ü *************************/
|
||||
|
||||
namespace HanUnitedBilling
|
||||
{
|
||||
#pragma pack(1)
|
||||
|
||||
struct GLTransStruct
|
||||
{
|
||||
unsigned short DataSize; // Data <20><> <20><>ü<EFBFBD><C3BC><EFBFBD><EFBFBD>
|
||||
unsigned short HeaderMsg; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɸ<C9B8><DEBC><EFBFBD><EFBFBD>κкκ<D0BA>
|
||||
unsigned long SeqID;
|
||||
char Data[120]; //Data
|
||||
};
|
||||
|
||||
#pragma pack()
|
||||
|
||||
//LK->UID , UID->LK <20><EFBFBD><DEBC><EFBFBD>
|
||||
enum CMD
|
||||
{
|
||||
AUTH = 4000, // UID -> LK
|
||||
LOGOUT = 4001, // UID -> LK
|
||||
CUT_IP = 4002, // LK -> UID
|
||||
WARNNOTICE = 4003, // LK -> UID
|
||||
BILL_AUTH = 4004, // UID -> LK
|
||||
AUTH_RESULT = 4005, // LK -> UID
|
||||
BILL_AUTH_RESULT = 4006, // LK -> UID
|
||||
|
||||
PING_AUTH = 4007,
|
||||
LOGOUT_RESULT = 4008
|
||||
};
|
||||
|
||||
enum LENGTH
|
||||
{
|
||||
MAX_IP_LEN = 17,
|
||||
MAX_ID_LEN = 25,
|
||||
MAX_OUT_TIME_LEN = 18,
|
||||
MAX_MSG_LEN = 70
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
||||
169
Server/RylServerProject/RylUIDServer/HanUnitedDisconnID.cpp
Normal file
169
Server/RylServerProject/RylUIDServer/HanUnitedDisconnID.cpp
Normal file
@@ -0,0 +1,169 @@
|
||||
#include "stdAfx.h"
|
||||
#include "HanUnitedDisconnID.h"
|
||||
#include "SendAgentPacket.h"
|
||||
|
||||
#include <DB/DBComponent.h>
|
||||
#include <DB/BillingDBComponent.h>
|
||||
#include <Log/ServerLog.h>
|
||||
|
||||
|
||||
CHanUnitedDisconnectID& CHanUnitedDisconnectID::GetInstance()
|
||||
{
|
||||
static CHanUnitedDisconnectID hanUnitedDisconnectID;
|
||||
return hanUnitedDisconnectID;
|
||||
}
|
||||
|
||||
CHanUnitedDisconnectID::CHanUnitedDisconnectID()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
CHanUnitedDisconnectID::~CHanUnitedDisconnectID()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void CHanUnitedDisconnectID::UpdateDisconnectInfo(const DisconnectInfo& disconnectInfo)
|
||||
{
|
||||
DisconnectInfoMap::iterator pos = m_DisconnectInfoMap.find(disconnectInfo.m_nUID);
|
||||
|
||||
if(pos == m_DisconnectInfoMap.end())
|
||||
{
|
||||
m_DisconnectInfoMap.insert(DisconnectInfoMap::value_type(
|
||||
disconnectInfo.m_nUID, disconnectInfo));
|
||||
}
|
||||
else
|
||||
{
|
||||
pos->second = disconnectInfo;
|
||||
}
|
||||
}
|
||||
|
||||
bool CHanUnitedDisconnectID::RemoveDisconnectInfo(int nUID)
|
||||
{
|
||||
DisconnectInfoMap::iterator pos = m_DisconnectInfoMap.find(nUID);
|
||||
|
||||
if(pos != m_DisconnectInfoMap.end())
|
||||
{
|
||||
m_DisconnectInfoMap.erase(pos);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
CHanUnitedDisconnectID::DisconnectInfo* CHanUnitedDisconnectID::GetDisconnectInfo(int nUID)
|
||||
{
|
||||
DisconnectInfoMap::iterator pos = m_DisconnectInfoMap.find(nUID);
|
||||
|
||||
if(pos != m_DisconnectInfoMap.end())
|
||||
{
|
||||
return &pos->second;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void CHanUnitedDisconnectID::CheckDisconnect()
|
||||
{
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
struct HanUnitedUserData
|
||||
{
|
||||
int m_nUID; //
|
||||
int m_nServerID; //
|
||||
int m_nRemainMin; //
|
||||
char m_cBillingType[2]; // E : <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, T : <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, F : <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
int m_nEndTime; // <20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> : 20030225, <20><><EFBFBD><EFBFBD> : RemainMin
|
||||
int m_nCRMIndex; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0, PC<50><43><EFBFBD><EFBFBD> 0<>̻<EFBFBD>. <20><><EFBFBD><EFBFBD> <20><><EFBFBD>θ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>´<EFBFBD>.
|
||||
};
|
||||
|
||||
#pragma pack()
|
||||
|
||||
const int MAX_DATA = CDBSingleObject::MaxRowNum;
|
||||
HanUnitedUserData hanUnitedUserData[MAX_DATA];
|
||||
|
||||
if(!DBComponent::BillingDB::USPCheckTimeoutUser(CDBSingleObject::GetInstance()))
|
||||
{
|
||||
ERRLOG1(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>. GetErrorString() :%s",
|
||||
CDBSingleObject::GetInstance().GetErrorString());
|
||||
}
|
||||
else
|
||||
{
|
||||
int nRowNum = 0;
|
||||
|
||||
while(CDBSingleObject::GetInstance().GetData(
|
||||
(void**)hanUnitedUserData, sizeof(HanUnitedUserData), MAX_DATA, &nRowNum))
|
||||
{
|
||||
if(0 == nRowNum)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
// <20><><EFBFBD>̺<EFBFBD><CCBA><EFBFBD> UID<49><44> <20><><EFBFBD><EFBFBD> <20>ִ<EFBFBD><D6B4><EFBFBD> <20><><EFBFBD>ɴ<EFBFBD>.
|
||||
// 1. <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʴ<EFBFBD>.
|
||||
// <20><><EFBFBD><EFBFBD> <20>ð<EFBFBD><C3B0><EFBFBD> üũ<C3BC><C5A9> <20><>, 0 < time <5 <20≯<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><EFBFBD><DEBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>̺<EFBFBD><CCBA><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
||||
// 2. <20><><EFBFBD><EFBFBD> <20>ִ<EFBFBD>.
|
||||
// <20><><EFBFBD><EFBFBD> <20>ð<EFBFBD><C3B0><EFBFBD> üũ<C3BC><C5A9> <20><>, time <= 0 <20≯<EFBFBD> UserKill<6C><6C> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>̺<EFBFBD><CCBA><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>αƿ<D7BE><C6BF>ϸ<EFBFBD> <20><><EFBFBD>̺<EFBFBD><CCBA><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
|
||||
HanUnitedUserData* lpHanUnitedUserData = hanUnitedUserData;
|
||||
HanUnitedUserData* lpHanUnitedUserDataEnd = hanUnitedUserData + nRowNum;
|
||||
|
||||
for(; lpHanUnitedUserData != lpHanUnitedUserDataEnd; ++lpHanUnitedUserData)
|
||||
{
|
||||
DisconnectInfo* lpDisconnectInfo = GetDisconnectInfo(lpHanUnitedUserData->m_nUID);
|
||||
|
||||
if(0 == lpDisconnectInfo)
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD> <20>ð<EFBFBD><C3B0><EFBFBD> üũ<C3BC><C5A9> <20><>, timeout<75><74> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
AgentSendPacket::SendHanBTN(lpHanUnitedUserData->m_nServerID,
|
||||
lpHanUnitedUserData->m_nUID, lpHanUnitedUserData->m_nRemainMin,
|
||||
lpHanUnitedUserData->m_cBillingType[0]);
|
||||
|
||||
DETLOG5(g_Log, "UID:%u/ServerID:%u/cRemainMinute:%d/cBillingType:%c/EndTime:%d/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>½<EFBFBD><C2BD>ϴ<EFBFBD>.",
|
||||
lpHanUnitedUserData->m_nUID, lpHanUnitedUserData->m_nServerID,
|
||||
lpHanUnitedUserData->m_nRemainMin, lpHanUnitedUserData->m_cBillingType[0],
|
||||
lpHanUnitedUserData->m_nEndTime);
|
||||
|
||||
DisconnectInfo disconnInfo;
|
||||
|
||||
disconnInfo.m_nUID = lpHanUnitedUserData->m_nUID;
|
||||
disconnInfo.m_nServerID = lpHanUnitedUserData->m_nServerID;
|
||||
disconnInfo.m_nRemainMin = lpHanUnitedUserData->m_nRemainMin;
|
||||
disconnInfo.m_nEndTime = lpHanUnitedUserData->m_nEndTime;
|
||||
disconnInfo.m_nCRMIndex = lpHanUnitedUserData->m_nCRMIndex;
|
||||
disconnInfo.m_cBillingType = lpHanUnitedUserData->m_cBillingType[0];
|
||||
|
||||
UpdateDisconnectInfo(disconnInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
lpDisconnectInfo->m_nServerID = lpHanUnitedUserData->m_nServerID;
|
||||
lpDisconnectInfo->m_nRemainMin = lpHanUnitedUserData->m_nRemainMin;
|
||||
lpDisconnectInfo->m_nEndTime = lpHanUnitedUserData->m_nEndTime;
|
||||
lpDisconnectInfo->m_nCRMIndex = lpHanUnitedUserData->m_nCRMIndex;
|
||||
lpDisconnectInfo->m_cBillingType = lpHanUnitedUserData->m_cBillingType[0];
|
||||
|
||||
if(lpDisconnectInfo->m_nRemainMin <= 0)
|
||||
{
|
||||
AgentSendPacket::SendUserKill(lpDisconnectInfo->m_nServerID, lpDisconnectInfo->m_nUID);
|
||||
|
||||
DETLOG5(g_Log, "UID:%u/ServerID:%u/cRemainMinute:%d/cBillingType:%c/EndTime:%d/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ǿ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.",
|
||||
lpHanUnitedUserData->m_nUID, lpHanUnitedUserData->m_nServerID,
|
||||
lpHanUnitedUserData->m_nRemainMin, lpHanUnitedUserData->m_cBillingType[0],
|
||||
lpHanUnitedUserData->m_nEndTime);
|
||||
|
||||
RemoveDisconnectInfo(lpDisconnectInfo->m_nUID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
40
Server/RylServerProject/RylUIDServer/HanUnitedDisconnID.h
Normal file
40
Server/RylServerProject/RylUIDServer/HanUnitedDisconnID.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#ifndef _HAN_UNITED_DISCONNECT_ID_H_
|
||||
#define _HAN_UNITED_DISCONNECT_ID_H_
|
||||
|
||||
#include <map>
|
||||
|
||||
class CHanUnitedDisconnectID
|
||||
{
|
||||
public:
|
||||
|
||||
struct DisconnectInfo
|
||||
{
|
||||
int m_nUID; //
|
||||
int m_nServerID; //
|
||||
int m_nRemainMin; //
|
||||
int m_nEndTime; // <20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> : 20030225, <20><><EFBFBD><EFBFBD> : RemainMin
|
||||
int m_nCRMIndex; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0, PC<50><43><EFBFBD><EFBFBD> 0<>̻<EFBFBD>. <20><><EFBFBD><EFBFBD> <20><><EFBFBD>θ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>´<EFBFBD>.
|
||||
char m_cBillingType; // E : <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, T : <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, F : <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
};
|
||||
|
||||
static CHanUnitedDisconnectID& GetInstance();
|
||||
|
||||
CHanUnitedDisconnectID();
|
||||
virtual ~CHanUnitedDisconnectID();
|
||||
|
||||
void UpdateDisconnectInfo(const DisconnectInfo& disconnectInfo);
|
||||
bool RemoveDisconnectInfo(int nUID);
|
||||
|
||||
DisconnectInfo* GetDisconnectInfo(int nUID);
|
||||
|
||||
void CheckDisconnect();
|
||||
|
||||
private:
|
||||
|
||||
typedef std::map<int, DisconnectInfo> DisconnectInfoMap;
|
||||
|
||||
DisconnectInfoMap m_DisconnectInfoMap;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
231
Server/RylServerProject/RylUIDServer/IOBuffer.cpp
Normal file
231
Server/RylServerProject/RylUIDServer/IOBuffer.cpp
Normal file
@@ -0,0 +1,231 @@
|
||||
// IOBuffer.cpp: implementation of the CIOBuffer class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
#include "stdafx.h"
|
||||
#include "IOBuffer.h"
|
||||
#include <string.h>
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
namespace Gammania {
|
||||
|
||||
CIOBuffer::CIOBuffer()
|
||||
{
|
||||
// Head<61><64> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ġ.
|
||||
// Tail<69><6C> <20><><EFBFBD><EFBFBD><EFBFBD>Ǿ<EFBFBD><C7BE><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>.
|
||||
m_iHead = m_iTail = 0;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
m_iBufSize = 0;
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
m_cBuf = NULL;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>̰<EFBFBD><CCB0><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Over Flow..
|
||||
m_iBuffered = 0;
|
||||
}
|
||||
|
||||
CIOBuffer::~CIOBuffer()
|
||||
{
|
||||
DeleteIOBuf();
|
||||
}
|
||||
|
||||
void CIOBuffer::InitIOBuf()
|
||||
{
|
||||
m_iHead = m_iTail = 0;
|
||||
m_iBuffered = 0;
|
||||
|
||||
if(m_cBuf)
|
||||
memset(m_cBuf, 0, sizeof(m_cBuf));
|
||||
}
|
||||
|
||||
void CIOBuffer::NewIOBuf(int BufSize)
|
||||
{
|
||||
if(BufSize <= 0)
|
||||
BufSize = IOBUF_DEF_SIZE;
|
||||
|
||||
m_cBuf = new char[BufSize];
|
||||
if(m_cBuf == NULL)
|
||||
{
|
||||
// throw "CIOBuffer::NewIOBuf : Memory allocation failure!";
|
||||
return;
|
||||
}
|
||||
|
||||
m_iBufSize = BufSize;
|
||||
|
||||
InitIOBuf();
|
||||
}
|
||||
|
||||
void CIOBuffer::DeleteIOBuf()
|
||||
{
|
||||
if(m_cBuf)
|
||||
{
|
||||
delete []m_cBuf;
|
||||
m_cBuf = NULL;
|
||||
}
|
||||
m_iBufSize = 0;
|
||||
m_iHead = m_iTail = 0;
|
||||
m_iBuffered = 0;
|
||||
}
|
||||
|
||||
// Size <20><>ŭ Buffer<65><72> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
||||
int CIOBuffer::Append(char* Buffer, int Size)
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD>÷ο찡 <20>ȴ<EFBFBD>.
|
||||
if(m_iBuffered + Size >= m_iBufSize)
|
||||
{
|
||||
// throw "CIOBuffer::Append : Buffer overflow";
|
||||
return -1;
|
||||
}
|
||||
|
||||
int aSize = 0;
|
||||
int Added = 0;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> Size<7A><65> <20>߰<EFBFBD><DFB0>Ҷ<EFBFBD><D2B6><EFBFBD><EFBFBD><EFBFBD> ó<><C3B3><EFBFBD>Ѵ<EFBFBD>.
|
||||
while(Size > 0)
|
||||
{
|
||||
if(Size > m_iBufSize-m_iTail)
|
||||
aSize = m_iBufSize-m_iTail;
|
||||
else aSize = Size;
|
||||
|
||||
if(aSize)
|
||||
{
|
||||
memcpy(m_cBuf+m_iTail, Buffer, aSize);
|
||||
|
||||
Added += aSize;
|
||||
Size -= aSize;
|
||||
Buffer += aSize;
|
||||
m_iTail += aSize;
|
||||
if(m_iTail >= m_iBufSize)
|
||||
m_iTail -= m_iBufSize;
|
||||
}
|
||||
}
|
||||
|
||||
CalcBuffered();
|
||||
|
||||
return Added;
|
||||
}
|
||||
|
||||
// Size<7A><65>ŭ <20><><EFBFBD><EFBFBD>Ÿ<EFBFBD><C5B8> <20>о<EFBFBD> Buffer<65><72> <20><><EFBFBD><EFBFBD>.
|
||||
int CIOBuffer::GetData(char* Buffer, int Size)
|
||||
{
|
||||
// <20><><EFBFBD>ִ<EFBFBD> <20><><EFBFBD><EFBFBD>Ÿ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ִ<EFBFBD> <20><><EFBFBD><EFBFBD>Ÿ<EFBFBD><C5B8> <20>а<EFBFBD> <20>Ѵ<EFBFBD>.
|
||||
if(GetBufferUsed() < Size)
|
||||
Size = GetBufferUsed();
|
||||
|
||||
if(Size <= 0)
|
||||
return 0;
|
||||
|
||||
// <20>߷<EFBFBD><DFB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. ó<><C3B3><EFBFBD>Ѵ<EFBFBD>.
|
||||
if(m_iHead+Size >= m_iBufSize)
|
||||
{
|
||||
// <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>װ<EFBFBD> <20>ִ<EFBFBD>.
|
||||
int Size1 = m_iBufSize - m_iHead;
|
||||
memcpy(Buffer, m_cBuf+m_iHead, Size1);
|
||||
memcpy(Buffer+Size1, m_cBuf, Size-Size1);
|
||||
}
|
||||
else // <20><><EFBFBD>߷<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
{
|
||||
memcpy(Buffer, m_cBuf+m_iHead, Size);
|
||||
}
|
||||
|
||||
m_iHead += Size;
|
||||
if(m_iHead >= m_iBufSize)
|
||||
m_iHead -= m_iBufSize;
|
||||
|
||||
CalcBuffered();
|
||||
return Size;
|
||||
}
|
||||
|
||||
int CIOBuffer::CheckData(int Size)
|
||||
{
|
||||
// <20><><EFBFBD>ִ<EFBFBD> <20><><EFBFBD><EFBFBD>Ÿ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ִ<EFBFBD> <20><><EFBFBD><EFBFBD>Ÿ<EFBFBD><C5B8> <20>а<EFBFBD> <20>Ѵ<EFBFBD>.
|
||||
if(GetBufferUsed() < Size)
|
||||
Size = GetBufferUsed();
|
||||
|
||||
if(Size <= 0)
|
||||
return 0;
|
||||
|
||||
m_iHead += Size;
|
||||
if(m_iHead >= m_iBufSize)
|
||||
m_iHead -= m_iBufSize;
|
||||
|
||||
CalcBuffered();
|
||||
return Size;
|
||||
}
|
||||
|
||||
|
||||
void CIOBuffer::CalcBuffered()
|
||||
{
|
||||
if(m_iHead > m_iTail)
|
||||
m_iBuffered = m_iBufSize - m_iHead + m_iTail;
|
||||
else
|
||||
m_iBuffered = m_iTail-m_iHead;
|
||||
}
|
||||
|
||||
|
||||
CPacketIOBuffer::CPacketIOBuffer()
|
||||
{
|
||||
// <20>ʱ<EFBFBD>ȭ.
|
||||
CIOBuffer::CIOBuffer();
|
||||
}
|
||||
|
||||
CPacketIOBuffer::~CPacketIOBuffer()
|
||||
{
|
||||
DeleteIOBuf();
|
||||
}
|
||||
|
||||
void CPacketIOBuffer::Lock()
|
||||
{
|
||||
LockHead = GetHead();
|
||||
}
|
||||
|
||||
void CPacketIOBuffer::UnLock()
|
||||
{
|
||||
SetHead(LockHead);
|
||||
}
|
||||
|
||||
int CPacketIOBuffer::GetPacket(char* Packet)
|
||||
{
|
||||
if(m_iHead == m_iTail)
|
||||
return 0;
|
||||
|
||||
memset(Packet, 0, MAX_PACKETSIZE);
|
||||
|
||||
int Size = 0;
|
||||
int OldHead = GetHead();
|
||||
|
||||
char End[3] = "\r\n";
|
||||
|
||||
for(int i = 0; i < MAX_PACKETSIZE; ++i)
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD>
|
||||
Packet[i] = m_cBuf[m_iHead];
|
||||
|
||||
m_iHead++;
|
||||
|
||||
if(m_iHead+1 > m_iBufSize)
|
||||
m_iHead = 0;
|
||||
|
||||
if(m_iHead == m_iTail)
|
||||
break;
|
||||
|
||||
if(i < 1)
|
||||
continue;
|
||||
|
||||
if(strcmp(&Packet[i-1], End)==0)
|
||||
break;
|
||||
}
|
||||
|
||||
Size = (int)strlen(Packet);
|
||||
if(Size == 0)
|
||||
{
|
||||
SetHead(OldHead);
|
||||
return 0;
|
||||
}
|
||||
|
||||
CalcBuffered();
|
||||
return Size;
|
||||
}
|
||||
|
||||
}
|
||||
89
Server/RylServerProject/RylUIDServer/IOBuffer.h
Normal file
89
Server/RylServerProject/RylUIDServer/IOBuffer.h
Normal file
@@ -0,0 +1,89 @@
|
||||
// IOBuffer.h: interface for the CIOBuffer class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
/*****************************************************************************
|
||||
I/O Buffering <20><> <20><><EFBFBD><EFBFBD> Ŭ<><C5AC><EFBFBD><EFBFBD>. Sock<63><6B> <20>̿<EFBFBD><CCBF><EFBFBD> <20><>Ŷ<EFBFBD><C5B6> <20>ְ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ŷ<EFBFBD><C5B6>
|
||||
<EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><EFBFBD>ų<EFBFBD> <20><><EFBFBD>ҵǾ<D2B5> <20>ö<EFBFBD> <20><> <20><>Ŷ<EFBFBD><C5B6> <20><><EFBFBD><EFBFBD> <20><> ó<><C3B3><EFBFBD>Ҷ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ȴ<EFBFBD>.(IOBuffer<65><72>
|
||||
<EFBFBD><EFBFBD><EFBFBD>ӹ<EFBFBD><EFBFBD><EFBFBD> PacektIOBuffer Ŭ<><C5AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ó<><C3B3><EFBFBD>ϰ<EFBFBD>..
|
||||
|
||||
<EFBFBD>⺻<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> PacketBuffer<65><72> <20><><EFBFBD><EFBFBD><EFBFBD>Ǵ<EFBFBD> <20><>Ʈ<EFBFBD><C6AE>(?)<29><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
||||
-------------------------------------------
|
||||
| Header(4Byte-PACKET_HEADSIZE) | StringData (Header Size) |
|
||||
-------------------------------------------
|
||||
IOBufferŬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ<EFBFBD><C5B6> <20>ϳ<EFBFBD><CFB3><EFBFBD> <20>迭<EFBFBD><E8BFAD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>־<EFBFBD> <20><> <20><>Ŷ<EFBFBD><C5B6>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>. 2Byte<74><65> 65535<33><35><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD≯<EFBFBD> ó<><C3B3><EFBFBD>Ѵ<EFBFBD>.
|
||||
*****************************************************************************/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <memory.h>
|
||||
|
||||
namespace Gammania {
|
||||
|
||||
#define MAX_PACKETSIZE 512
|
||||
#define IOBUF_DEF_SIZE MAX_PACKETSIZE*10 // IOBuffer<65><72> <20>⺻ũ<E2BABB><C5A9> <20><>Ŷ 1024<32><34><EFBFBD><EFBFBD>ŭ ó<><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
class CIOBuffer
|
||||
{
|
||||
protected:
|
||||
// Head<61><64> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ġ.
|
||||
// Tail<69><6C> <20><><EFBFBD><EFBFBD><EFBFBD>Ǿ<EFBFBD><C7BE><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>.
|
||||
int m_iHead,m_iTail;
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
int m_iBufSize;
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
char* m_cBuf;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>̰<EFBFBD><CCB0><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Over Flow..
|
||||
int m_iBuffered;
|
||||
|
||||
public:
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ũ<><C5A9> <20><><EFBFBD>ϱ<EFBFBD>.
|
||||
void CalcBuffered();
|
||||
|
||||
// <20><>Ÿ inline
|
||||
inline char* GetBuffer() { return m_cBuf; }
|
||||
inline void SetHead(int Head) { m_iHead = Head; CalcBuffered(); }
|
||||
inline int GetHead() { return m_iHead; }
|
||||
inline void SetTail(int Tail) { m_iTail = Tail; }
|
||||
inline int GetTail() { return m_iTail; }
|
||||
inline int GetBufSize() { return m_iBufSize; }
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>
|
||||
inline int GetBufferUsed() { return m_iBuffered; }
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>
|
||||
inline int GetEmptyBuffer() { return m_iBufSize - m_iBuffered; }
|
||||
|
||||
void InitIOBuf();
|
||||
|
||||
// <09>߰<EFBFBD><DFB0>Ѵ<EFBFBD>.
|
||||
int Append(char* Buffer, int Size);
|
||||
// <09><><EFBFBD><EFBFBD><EFBFBD>´<EFBFBD>.
|
||||
int GetData(char* Buffer, int Size);
|
||||
// üũ<C3BC>Ѵ<EFBFBD>
|
||||
int CheckData(int Size);
|
||||
|
||||
void NewIOBuf(int BufSize);
|
||||
void DeleteIOBuf();
|
||||
|
||||
|
||||
CIOBuffer();
|
||||
virtual ~CIOBuffer();
|
||||
};
|
||||
|
||||
class CPacketIOBuffer : public CIOBuffer
|
||||
{
|
||||
int LockHead;
|
||||
public:
|
||||
void Lock();
|
||||
void UnLock();
|
||||
|
||||
// <20>Ѱ<EFBFBD><D1B0>з<EFBFBD><D0B7><EFBFBD> <20><>Ŷ<EFBFBD><C5B6> <20><><EFBFBD><EFBFBD><EFBFBD>´<EFBFBD>.
|
||||
int GetPacket(char* Packet);
|
||||
|
||||
CPacketIOBuffer();
|
||||
virtual ~CPacketIOBuffer();
|
||||
};
|
||||
|
||||
}
|
||||
471
Server/RylServerProject/RylUIDServer/NetString.cpp
Normal file
471
Server/RylServerProject/RylUIDServer/NetString.cpp
Normal file
@@ -0,0 +1,471 @@
|
||||
#include "stdafx.h"
|
||||
#include "NetString.h"
|
||||
|
||||
CNetString::CNetString(void)
|
||||
{
|
||||
m_iIndex = 0;
|
||||
m_hWnd = NULL; // <20>θ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ڵ<EFBFBD>
|
||||
|
||||
m_hSocket = NULL; // Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>
|
||||
m_nPort = 0; // <20><>Ʈ
|
||||
ZeroMemory(m_strIPAddr, sizeof(char)*20); // Server IP<49><50><EFBFBD><EFBFBD>
|
||||
|
||||
m_bConnect = FALSE; // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>÷<EFBFBD><C3B7><EFBFBD>
|
||||
m_bClose = FALSE;
|
||||
|
||||
m_RecvIO.NewIOBuf(0); // 0<><30><EFBFBD><EFBFBD> <20>ϸ<EFBFBD> <20>⺻<EFBFBD><E2BABB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> DefaultPacketSize * 1024
|
||||
|
||||
m_hEvent = NULL; // <20><>Ʈ<EFBFBD><C6AE>ũ <20>̺<EFBFBD>Ʈ <20>ڵ鷯
|
||||
|
||||
ZeroMemory(m_PacketBuffer, sizeof(char)*MAX_PACKETSIZE); // Server IP<49><50><EFBFBD><EFBFBD>
|
||||
|
||||
WinSockInit();
|
||||
}
|
||||
|
||||
CNetString::~CNetString(void)
|
||||
{
|
||||
OnClose();
|
||||
Stop(); // <20><><EFBFBD><EFBFBD> <20>Լ<EFBFBD> ȣ<><C8A3>
|
||||
|
||||
m_RecvIO.DeleteIOBuf();
|
||||
|
||||
WSACleanup();
|
||||
}
|
||||
|
||||
BOOL CNetString::WinSockInit()
|
||||
{
|
||||
WORD wVersionRequested;
|
||||
WSADATA wsaData;
|
||||
int err;
|
||||
|
||||
wVersionRequested = MAKEWORD( 2, 2 );
|
||||
|
||||
err = WSAStartup( wVersionRequested, &wsaData );
|
||||
if ( err != 0 ) {
|
||||
WSACleanup();
|
||||
// Tell the user that we could not find a usable
|
||||
// WinSock DLL.
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ( LOBYTE( wsaData.wVersion ) != 2 ||
|
||||
HIBYTE( wsaData.wVersion ) != 2 ) {
|
||||
// Tell the user that we could not find a usable //
|
||||
// WinSock DLL. //
|
||||
WSACleanup( );
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// [1]DESCRIPTION : Ŭ<><C5AC><EFBFBD><EFBFBD> <20>ʱ<EFBFBD>ȭ //
|
||||
// [2]PARAMETER : strIPAddr - <20><><EFBFBD><EFBFBD>IP<49>ּ<EFBFBD>, nPort - <20><>Ʈ<EFBFBD><C6AE>ȣ, //
|
||||
// hWnd - <20>θ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ڵ<EFBFBD> //
|
||||
// [3]RETURN : <09><><EFBFBD><EFBFBD> - TRUE, <20><><EFBFBD><EFBFBD> - FALSE //
|
||||
// [4]DATE : 2000<30><30> 9<><39> 11<31><31> //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
BOOL CNetString::Init( HWND hWnd, int iIndex, char* szIP, int nPort )
|
||||
{
|
||||
m_iIndex = iIndex;
|
||||
m_nPort = nPort; // <20><>Ʈ <20><>ȣ
|
||||
unsigned long dwThreadId = 0; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
// ip <20><><EFBFBD>巹<EFBFBD><E5B7B9>
|
||||
strcpy(m_strIPAddr,szIP);
|
||||
m_hWnd = hWnd; // <20>θ<EFBFBD> <20>ڵ<EFBFBD>
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ų<EFBFBD><C5B2>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.. <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ῡ <20><><EFBFBD><EFBFBD><EFBFBD>Ѵٸ<D1B4>
|
||||
// Netword Event <20><><EFBFBD><EFBFBD> FW_CLOSE<53><45> <20><EFBFBD><DFBB><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Close<73>ȴ<EFBFBD>.
|
||||
if(!Connect())
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
Sleep(100); // Sleep...
|
||||
OnClose();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
m_bClose = FALSE;
|
||||
|
||||
m_hEventThread =
|
||||
(HANDLE)CreateThread(NULL, // Security
|
||||
0, // Stack size - use default
|
||||
EventThreadProc, // Thread fn entry point
|
||||
(void*) this,
|
||||
0, // Init flag
|
||||
&dwThreadId); // Thread address
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// [1]DESCRIPTION : Main Thread, <20><>Ʈ<EFBFBD><C6AE>ũ <20>̺<EFBFBD>Ʈ ó<><C3B3> //
|
||||
// [2]PARAMETER : void //
|
||||
// [3]RETURN : void //
|
||||
// [4]DATE : 2000<30><30> 9<><39> 10<31><30> //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
DWORD WINAPI CNetString::EventThreadProc(LPVOID lParam)
|
||||
{
|
||||
// Ŭ<><C5AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
CNetString* pThis = reinterpret_cast<CNetString*>(lParam);
|
||||
|
||||
WSANETWORKEVENTS events; // <20><>Ʈ<EFBFBD><C6AE>ũ <20>̺<EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>
|
||||
BOOL bThreadRun = TRUE; // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
while(bThreadRun)
|
||||
{
|
||||
if(pThis->m_bClose)
|
||||
{
|
||||
bThreadRun = FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
DWORD dwRet;
|
||||
dwRet = WSAWaitForMultipleEvents(1,
|
||||
&pThis->m_hEvent,
|
||||
FALSE,
|
||||
INFINITE,
|
||||
FALSE);
|
||||
|
||||
if(!pThis->m_hSocket)
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD>
|
||||
bThreadRun = FALSE;
|
||||
break;
|
||||
}
|
||||
// Figure out what happened
|
||||
int nRet = WSAEnumNetworkEvents(pThis->m_hSocket,
|
||||
pThis->m_hEvent,
|
||||
&events);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
|
||||
if (nRet == SOCKET_ERROR)
|
||||
{
|
||||
bThreadRun = FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
///////////////////
|
||||
// Handle events //
|
||||
bThreadRun = pThis->NetworkEventHanlder(events.lNetworkEvents);
|
||||
}
|
||||
// <20≯<EFBFBD><CCB8><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>尡 <20><><EFBFBD><EFBFBD> <20>Ǹ<EFBFBD> Server<65><72> <20><><EFBFBD><EFBFBD> Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>!!! <<3C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>>
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʱ<EFBFBD>ȭ<EFBFBD><C8AD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ֱ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>⼭ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʴ´<CAB4>.
|
||||
// pThis->CloseAll();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CNetString::Disconnect()
|
||||
{
|
||||
// <20>̰<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Close<73><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϱ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> CloseAll() ȣ<><C8A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʰ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
||||
OnClose();
|
||||
Stop(); // <20><><EFBFBD><EFBFBD> <20>Լ<EFBFBD> ȣ<><C8A3>
|
||||
}
|
||||
|
||||
void CNetString::Stop()
|
||||
{
|
||||
if (m_hSocket)
|
||||
{
|
||||
struct linger li = {0, 0}; // Default: SO_DONTLINGER
|
||||
|
||||
li.l_onoff = 1; // SO_LINGER, timeout = 0
|
||||
shutdown(m_hSocket, SD_BOTH ); // <20><><EFBFBD><EFBFBD>? <20>̰<EFBFBD> <20><><EFBFBD><EFBFBD>? ^^;; <20>㿡 ã<>ƺ<EFBFBD><C6BA><EFBFBD>
|
||||
// 2001<30><31> 9<><39> 6<><36>
|
||||
|
||||
// Ŭ<><C5AC><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ť<><C5A5> <20><><EFBFBD><EFBFBD>Ÿ<EFBFBD><C5B8> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> <20>ɼ<EFBFBD>
|
||||
setsockopt(m_hSocket, SOL_SOCKET, SO_LINGER, (CHAR *)&li, sizeof(li));
|
||||
closesocket(m_hSocket); // <20><><EFBFBD><EFBFBD> <20>ݱ<EFBFBD>
|
||||
m_hSocket = NULL;
|
||||
}
|
||||
|
||||
if(m_hEvent) WSACloseEvent(m_hEvent);
|
||||
m_hEvent = NULL;
|
||||
}
|
||||
|
||||
void CNetString::CloseAll()
|
||||
{
|
||||
if(m_bConnect)
|
||||
{
|
||||
OnClose();
|
||||
Stop(); // <20><><EFBFBD><EFBFBD> <20>Լ<EFBFBD> ȣ<><C8A3>
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CNetString::OnClose()
|
||||
{
|
||||
m_bClose = TRUE;
|
||||
m_bConnect = FALSE; // Connect <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
OnSocketEvent(WM_SOCK_CLOSE, 0);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// [1]DESCRIPTION : <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>Լ<EFBFBD> //
|
||||
// [2]PARAMETER : void //
|
||||
// [3]RETURN : <09><><EFBFBD><EFBFBD> - TRUE, <20><><EFBFBD><EFBFBD> - FALSE //
|
||||
// [4]DATE : 2000<30><30> 9<><39> 11<31><31> //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
BOOL CNetString::Connect()
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̶<EFBFBD><CCB6><EFBFBD>
|
||||
if(m_bConnect) return TRUE;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ִٸ<D6B4>
|
||||
Stop();
|
||||
|
||||
m_RecvIO.InitIOBuf();
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
m_hSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>˻<EFBFBD>
|
||||
if (m_hSocket == INVALID_SOCKET)
|
||||
{
|
||||
OnSocketEvent(WM_CONNECT, FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// <20><>Ʈ<EFBFBD><C6AE>ũ <20>̺<EFBFBD>Ʈ <20>ڵ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
m_hEvent = WSACreateEvent();
|
||||
if (m_hEvent == WSA_INVALID_EVENT)
|
||||
{
|
||||
Stop();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Request async notification
|
||||
int nRet = WSAEventSelect(m_hSocket,
|
||||
m_hEvent,
|
||||
FD_CLOSE | FD_CONNECT); // <20><>ȣ<EFBFBD><C8A3> <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD> <20>ް<EFBFBD> <20>Ѵ<EFBFBD>
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
if (nRet == SOCKET_ERROR)
|
||||
{
|
||||
Stop();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// <20><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
unsigned long ul = 1;
|
||||
nRet = ioctlsocket(m_hSocket, FIONBIO, (unsigned long*)&ul);
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>˻<EFBFBD>
|
||||
if (m_hSocket == SOCKET_ERROR)
|
||||
{
|
||||
OnSocketEvent(WM_CONNECT, FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/////////////////////////////////
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ȭ<EFBFBD><C8AD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
int zero = 0;
|
||||
int err = 0;
|
||||
|
||||
// Send Buffer<65><72> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
if( (err = setsockopt( m_hSocket, SOL_SOCKET, SO_SNDBUF, (const char*)&zero, sizeof(zero))) == SOCKET_ERROR)
|
||||
{
|
||||
closesocket(m_hSocket);
|
||||
m_hSocket = NULL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Receive Buffer<65><72> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
if((err = setsockopt( m_hSocket, SOL_SOCKET, SO_RCVBUF, (const char*)&zero, sizeof(zero) )) == SOCKET_ERROR)
|
||||
{
|
||||
closesocket(m_hSocket);
|
||||
m_hSocket = NULL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
SOCKADDR_IN saServer;
|
||||
|
||||
memset(&saServer,0,sizeof(saServer));
|
||||
|
||||
saServer.sin_family = AF_INET;
|
||||
saServer.sin_addr.s_addr = inet_addr(m_strIPAddr);
|
||||
saServer.sin_port = htons(m_nPort);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Connect
|
||||
nRet = connect(m_hSocket,(sockaddr*)&saServer, sizeof(saServer));
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>̰ų<CCB0> <20><><EFBFBD><EFBFBD>ŷ<EFBFBD><C5B7> <20>Ǿ<EFBFBD><C7BE>ٸ<EFBFBD>
|
||||
if (nRet == SOCKET_ERROR && WSAGetLastError() != WSAEWOULDBLOCK)
|
||||
{
|
||||
Stop();
|
||||
return FALSE;
|
||||
}
|
||||
/*
|
||||
<09>̷<EFBFBD><CCB7><EFBFBD> Connect<63><74> <20>ϸ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> AccetpEx<45><78> <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD> ClientSceesion<6F><6E>
|
||||
Recv<63><76><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD> <20><><EFBFBD><EFBFBD><EEB0A3>.
|
||||
<09><><EFBFBD><EFBFBD> <20>̺<EFBFBD>Ʈ<EFBFBD><C6AE> Connect<63><74> <20><><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD> FD_CONNECT<43><54> <20><EFBFBD><DFBB><EFBFBD>Ų<EFBFBD><C5B2>.
|
||||
*/
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// [1]DESCRIPTION : <20><>Ʈ<EFBFBD><C6AE>ũ <20><EFBFBD><DEBC><EFBFBD><EFBFBD><EFBFBD> <20>ڵ鸵 <20>Ͽ<EFBFBD> <20>б<EFBFBD> //
|
||||
// [2]PARAMETER : lEvent - <20>̺<EFBFBD>Ʈ //
|
||||
// [3]RETURN : void //
|
||||
// [4]DATE : 2000<30><30> 9<><39> 14<31><34> //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
BOOL CNetString::NetworkEventHanlder(LONG lEvent)
|
||||
{
|
||||
BOOL bFlag = TRUE;
|
||||
|
||||
if(lEvent & FD_CLOSE)
|
||||
{
|
||||
bFlag = FALSE;
|
||||
}
|
||||
if(lEvent & FD_CONNECT)
|
||||
{
|
||||
bFlag = OnConnect();
|
||||
}
|
||||
|
||||
return bFlag;
|
||||
}
|
||||
|
||||
void CNetString::Update()
|
||||
{
|
||||
if(!IsConnect())
|
||||
return;
|
||||
|
||||
OnSendPacketData();
|
||||
OnReadPacketData();
|
||||
|
||||
while(GetQueCnt() != 0)
|
||||
{
|
||||
int iCnt = GetPacket(m_PacketBuffer);
|
||||
|
||||
ProcessPacket(m_PacketBuffer, iCnt);
|
||||
|
||||
// printf(m_PacketBuffer);
|
||||
|
||||
PopPacket();
|
||||
}
|
||||
}
|
||||
|
||||
void CNetString::ProcessPacket(char* Packet, int PacketLen)
|
||||
{
|
||||
if(m_event)
|
||||
m_event->EventPacket(m_iIndex, Packet);
|
||||
}
|
||||
|
||||
void CNetString::SendPost(char* Packet)
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Send <20>ϱ<EFBFBD>..
|
||||
m_SendQue.push_back(Packet);
|
||||
}
|
||||
|
||||
void CNetString::OnSendPacketData()
|
||||
{
|
||||
if(m_SendQue.empty())
|
||||
return;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Send
|
||||
int rc = 0;
|
||||
int idx = 0,size = 0;
|
||||
char send_buf[MAX_PACKETSIZE];
|
||||
|
||||
strcpy(send_buf, m_SendQue.begin()->c_str());
|
||||
size = (int)strlen(send_buf);
|
||||
|
||||
while(size > 0)
|
||||
{
|
||||
// 10004 : WSACancelBlockingCall<6C><6C> ȣ<><C8A3><EFBFBD>Ͽ<EFBFBD> <20><><EFBFBD><EFBFBD> <20>۾<EFBFBD><DBBE><EFBFBD> <20>ߴܵǾ<DCB5><C7BE><EFBFBD><EFBFBD>ϴ<EFBFBD>.
|
||||
// 10058 : <20>ش<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ǿ<EFBFBD><C7BE><EFBFBD><EFBFBD>Ƿ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ų<EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.
|
||||
// 10038 : <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ҷ<EFBFBD><D2B7><EFBFBD> <20>Ҷ<EFBFBD> <20><><EFBFBD><EFBFBD>.
|
||||
if((rc = send(m_hSocket, &send_buf[idx], size, 0)) == SOCKET_ERROR)
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD>ŷ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
if (GetLastError() != WSAEWOULDBLOCK) // <20><><EFBFBD><EFBFBD>ŷ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ƴ϶<C6B4><CFB6><EFBFBD>
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ٸ<EFBFBD>
|
||||
size -= rc;
|
||||
idx += rc;
|
||||
}
|
||||
|
||||
m_SendQue.pop_front();
|
||||
}
|
||||
}
|
||||
|
||||
void CNetString::OnReadPacketData()
|
||||
{
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Recv
|
||||
int Ret = recv(m_hSocket, m_PacketBuffer, MAX_PACKETSIZE, 0); // <20><><EFBFBD><EFBFBD>Ÿ Receive
|
||||
if(Ret == 0) // Graceful close
|
||||
{
|
||||
CloseAll();
|
||||
return;
|
||||
}
|
||||
else if (Ret == SOCKET_ERROR && WSAGetLastError() != WSAEWOULDBLOCK ) // <20><><EFBFBD><EFBFBD>ŷ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ƴ϶<C6B4><CFB6><EFBFBD>
|
||||
{
|
||||
m_bConnect = FALSE;
|
||||
Stop(); // <20><><EFBFBD>α<CEB1> <20><><EFBFBD><EFBFBD>
|
||||
return;
|
||||
}
|
||||
|
||||
if(Ret > 0)
|
||||
{
|
||||
if(m_RecvIO.Append(m_PacketBuffer, Ret) == -1)
|
||||
{
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><>Ŷ<EFBFBD><C5B6> IOBuffer<65><72> <20>־<EFBFBD> ó<><C3B3><EFBFBD>Ѵ<EFBFBD>.
|
||||
int iLen = m_RecvIO.GetPacket(m_PacketBuffer);
|
||||
if(iLen > 0)
|
||||
{
|
||||
// <20><><EFBFBD>⼭ <20><><EFBFBD><EFBFBD>Ŷ ó<><C3B3> <20><>ƾ ȣ<><C8A3>
|
||||
m_RecvQue.push_back(m_PacketBuffer);
|
||||
|
||||
// Message Type <20>϶<EFBFBD> <20>̰ɷ<CCB0> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
// <20><><EFBFBD><EFBFBD> Update <20>̺<EFBFBD>Ʈ ȣ<><C8A3><EFBFBD≯<EFBFBD> <20><> <20><>ƾ<EFBFBD><C6BE> <20>ּ<EFBFBD>ó<EFBFBD><C3B3> <20><><EFBFBD>ش<EFBFBD>.
|
||||
OnSocketEvent(WM_RECV_MSG, iLen);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// [1]DESCRIPTION : <20>̺<EFBFBD>Ʈ ó<><C3B3> (On Connect) //
|
||||
// [2]PARAMETER : void //
|
||||
// [3]RETURN : false <20><>ȯ //
|
||||
// [4]DATE : 2000<30><30> 9<><39> 11<31><31> //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
BOOL CNetString::OnConnect()
|
||||
{
|
||||
m_bConnect = TRUE; // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ON
|
||||
OnSocketEvent(WM_CONNECT, m_bConnect);
|
||||
|
||||
return m_bConnect;
|
||||
}
|
||||
|
||||
void CNetString::SetParent(HWND hWnd)
|
||||
{
|
||||
m_hWnd = hWnd;
|
||||
}
|
||||
|
||||
void CNetString::GetLocalIP(char* LocalIP)
|
||||
{
|
||||
char name[256];
|
||||
char* TempIp;
|
||||
PHOSTENT hostinfo;
|
||||
|
||||
WinSockInit();
|
||||
|
||||
if( gethostname ( name, sizeof(name)) == 0)
|
||||
{
|
||||
if((hostinfo = gethostbyname(name)) != NULL)
|
||||
{
|
||||
TempIp = inet_ntoa (*(struct in_addr *)*hostinfo->h_addr_list);
|
||||
strcpy(LocalIP, TempIp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
114
Server/RylServerProject/RylUIDServer/NetString.h
Normal file
114
Server/RylServerProject/RylUIDServer/NetString.h
Normal file
@@ -0,0 +1,114 @@
|
||||
#pragma once
|
||||
|
||||
#include "IOBuffer.h"
|
||||
#include <list>
|
||||
#include <string>
|
||||
|
||||
// sock
|
||||
#include<winsock2.h> // win32 socket
|
||||
#pragma comment(lib,"ws2_32.lib")
|
||||
|
||||
#include<Mswsock.h> // extension socket library
|
||||
#pragma comment(lib,"mswsock.lib")
|
||||
|
||||
|
||||
#define WM_CONNECT WM_APP + 0x1001
|
||||
#define WM_RECV_MSG WM_APP + 0x1002
|
||||
#define WM_SOCK_CLOSE WM_APP + 0x1003
|
||||
|
||||
class CNetString
|
||||
{
|
||||
public:
|
||||
class IEventListener
|
||||
{
|
||||
public:
|
||||
virtual ~IEventListener() {}
|
||||
virtual void EventPacket(int iIndex, char* pPacket)=0;
|
||||
};
|
||||
|
||||
void SetEventListener(IEventListener* event)
|
||||
{
|
||||
m_event = event;
|
||||
}
|
||||
|
||||
IEventListener* m_event;
|
||||
|
||||
HWND m_hWnd; // <20>θ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ڵ<EFBFBD>
|
||||
int m_iIndex;
|
||||
|
||||
SOCKET m_hSocket; // Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>
|
||||
UINT m_nPort; // <20><>Ʈ
|
||||
CHAR m_strIPAddr[20]; // Server IP<49><50><EFBFBD><EFBFBD>
|
||||
|
||||
BOOL m_bConnect; // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>÷<EFBFBD><C3B7><EFBFBD>
|
||||
BOOL m_bClose;
|
||||
|
||||
Gammania::CPacketIOBuffer m_RecvIO;
|
||||
char m_PacketBuffer[MAX_PACKETSIZE];
|
||||
|
||||
WSAEVENT m_hEvent; // <20><>Ʈ<EFBFBD><C6AE>ũ <20>̺<EFBFBD>Ʈ <20>ڵ鷯
|
||||
|
||||
HANDLE m_hEventThread; // Recv <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ڵ<EFBFBD>
|
||||
|
||||
std::list<std::string> m_SendQue;
|
||||
std::list<std::string> m_RecvQue;
|
||||
|
||||
private:
|
||||
static DWORD WINAPI EventThreadProc(LPVOID lParam); // Main Thread
|
||||
|
||||
void OnSendPacketData();
|
||||
void OnReadPacketData();
|
||||
|
||||
//////////////////
|
||||
// MessageHandling
|
||||
BOOL OnConnect(); // On Connect <20><>ȣ<EFBFBD><C8A3>
|
||||
BOOL OnClose(); // On Close <20><>ȣ<EFBFBD><C8A3>
|
||||
|
||||
/////////////////
|
||||
// <20><><EFBFBD><EFBFBD> ó<><C3B3> <20>Լ<EFBFBD>
|
||||
BOOL Connect(); // C-S <20><><EFBFBD><EFBFBD>
|
||||
BOOL WinSockInit();
|
||||
|
||||
protected:
|
||||
virtual void OnSocketEvent(DWORD dID, DWORD dEvent) {};
|
||||
|
||||
BOOL NetworkEventHanlder(LONG lEvent); // <20><EFBFBD><DEBC><EFBFBD> <20>б<EFBFBD> <20>Լ<EFBFBD>
|
||||
void ProcessPacket(char* Packet, int PacketLen);
|
||||
|
||||
int GetQueCnt()
|
||||
{
|
||||
return (int)m_RecvQue.size();
|
||||
}
|
||||
|
||||
int GetPacket(char* pPacket)
|
||||
{
|
||||
strcpy(pPacket, m_RecvQue.begin()->c_str());
|
||||
return (int)strlen(pPacket);
|
||||
}
|
||||
|
||||
void PopPacket()
|
||||
{
|
||||
m_RecvQue.pop_front();
|
||||
}
|
||||
|
||||
public:
|
||||
void GetLocalIP(char* LocalIP);
|
||||
|
||||
BOOL IsConnect() { return m_bConnect; }
|
||||
|
||||
virtual void SendPost(char* Packet);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD>.
|
||||
BOOL Init(HWND hWnd, int iIndex, char* szIP, int nPort); // <20>ʱ<EFBFBD>ȭ
|
||||
virtual void Disconnect();
|
||||
|
||||
virtual void Update();
|
||||
|
||||
void Stop(); // Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>
|
||||
void CloseAll();
|
||||
void SetParent(HWND hWnd);
|
||||
|
||||
public:
|
||||
CNetString(void);
|
||||
~CNetString(void);
|
||||
};
|
||||
35
Server/RylServerProject/RylUIDServer/Resource.h
Normal file
35
Server/RylServerProject/RylUIDServer/Resource.h
Normal file
@@ -0,0 +1,35 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by RylUIDServer.rc
|
||||
//
|
||||
#define IDC_MYICON 2
|
||||
#define IDD_RYLUIDSERVER_DIALOG 102
|
||||
#define IDS_APP_TITLE 103
|
||||
#define IDD_ABOUTBOX 103
|
||||
#define IDM_ABOUT 104
|
||||
#define IDM_EXIT 105
|
||||
#define IDC_RYLUIDSERVER 109
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDR_UIDSERVERMENU 129
|
||||
#define IDR_MENU 129
|
||||
#define ID_START_CONSOLE 131
|
||||
#define ID_STOP_CONSOLE 132
|
||||
#define ID_STATUS 133
|
||||
#define ID_RELOADSETUP 134
|
||||
#define ID_QUIT 135
|
||||
#define IDI_MAIN 135
|
||||
#define ID_UIDSERVER_DATABASE 32771
|
||||
#define ID_CONNECTALL 32773
|
||||
#define IDC_STATIC -1
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NO_MFC 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 136
|
||||
#define _APS_NEXT_COMMAND_VALUE 32774
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 110
|
||||
#endif
|
||||
#endif
|
||||
509
Server/RylServerProject/RylUIDServer/RylUIDServer.cpp
Normal file
509
Server/RylServerProject/RylUIDServer/RylUIDServer.cpp
Normal file
@@ -0,0 +1,509 @@
|
||||
#include "stdafx.h"
|
||||
#include "RylUIDServer.h"
|
||||
|
||||
#include "UIDAgentDispatch.h"
|
||||
#include "SendAgentPacket.h"
|
||||
|
||||
#include "HanUnitedBilling.h"
|
||||
#include "HanUnitedDisconnID.h"
|
||||
|
||||
#include <Log/ServerLog.h>
|
||||
#include <Thread/Thread.h>
|
||||
#include <Thread/ThreadMgr.h>
|
||||
#include <Network/IOCP/IOCPNet.h>
|
||||
#include <Network/Winsock/SocketFactory.h>
|
||||
#include <Utility/Debug/DebugMacros.h>
|
||||
#include <Utility/Time/Pulse/Pulse.h>
|
||||
|
||||
#include <Network/Session/Session.h>
|
||||
#include <Network/Session/CreatePolicy.h>
|
||||
#include <Network/Packet/PacketCommand.h>
|
||||
#include <Network/Packet/WrapPacket.h>
|
||||
#include <Network/Packet/PacketStruct/ServerInfo.h>
|
||||
#include <Network/Packet/PacketStruct/ServerPacket.h>
|
||||
|
||||
#include <DB/DBComponent.h>
|
||||
#include <DB/BillingDBComponent.h>
|
||||
#include <Utility/Setup/ServerSetup.h>
|
||||
|
||||
#include <mmsystem.h>
|
||||
#include <Utility/Debug/PerformanceCheck.h>
|
||||
|
||||
CRylUIDServer& CRylUIDServer::GetInstance()
|
||||
{
|
||||
static CRylUIDServer rylUIDServer;
|
||||
return rylUIDServer;
|
||||
}
|
||||
|
||||
|
||||
class CUIDServerProcessThread : public CProcessThread
|
||||
{
|
||||
public:
|
||||
|
||||
enum
|
||||
{
|
||||
UIDSERVER_PROCESS_TICK = 100,
|
||||
PULSE_PER_SEC = 1000 / UIDSERVER_PROCESS_TICK
|
||||
};
|
||||
|
||||
CUIDServerProcessThread(CRylUIDServer& rylUIDServer)
|
||||
: m_rylUIDServer(rylUIDServer), CProcessThread(rylUIDServer, UIDSERVER_PROCESS_TICK)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
virtual void Cleanup(CPulse& Pulse)
|
||||
{
|
||||
GetFunctionTimingResult("UIDPerfCheck");
|
||||
}
|
||||
|
||||
virtual void InternalRun(CPulse& pulse)
|
||||
{
|
||||
if (0 == pulse.GetCurrentPulse() % (2 * PULSE_PER_SEC))
|
||||
{
|
||||
// 2<><32>
|
||||
m_rylUIDServer.PrintServerInfo();
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> Ÿ<><C5B8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>´<EFBFBD>.
|
||||
unsigned long dwBillingType = CServerSetup::GetInstance().GetBillingType();
|
||||
|
||||
if (0 == pulse.GetCurrentPulse() % (60 * PULSE_PER_SEC) &&
|
||||
(CServerSetup::GamaBilling == dwBillingType ||
|
||||
CServerSetup::GamaUnitedBilling == dwBillingType))
|
||||
{
|
||||
// 60<36><30>
|
||||
m_rylUIDServer.CheckCurrentUser();
|
||||
}
|
||||
|
||||
m_rylUIDServer.SetStatusFlag(0);
|
||||
|
||||
#ifdef AUTH_MY
|
||||
m_rylUIDServer.Update( pulse.GetCurrentPulse() );
|
||||
#endif
|
||||
if ((0 == pulse.GetCurrentPulse() % (5 * PULSE_PER_SEC))
|
||||
&& CServerSetup::GamaUnitedBilling == dwBillingType)
|
||||
{
|
||||
// 5<>ʸ<EFBFBD><CAB8><EFBFBD> <20><><EFBFBD>պ<EFBFBD><D5BA><EFBFBD> <20><><EFBFBD>ؼ<EFBFBD> üũ <20><> Callback Timerüũ
|
||||
GET_SINGLE_DISPATCH(lpHanUnitedBilling, CHanUnitedDispatch,
|
||||
CHanUnitedDispatch::GetDispatchTable());
|
||||
|
||||
if (0 == lpHanUnitedBilling || !lpHanUnitedBilling->GetSession().IsConnected())
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>̴<EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>õ<EFBFBD><C3B5>Ѵ<EFBFBD>.
|
||||
CHanUnitedDispatch::ConnectToHanUnited(*m_rylUIDServer.GetIOCPNet());
|
||||
|
||||
// <20>̵<EFBFBD><CCB5><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>պ<EFBFBD><D5BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
||||
m_rylUIDServer.SetStatusFlag(0x00000001);
|
||||
}
|
||||
else
|
||||
{
|
||||
// <20>αƿ<D7BE><C6BF><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>Ƶξ<C6B5><CEBE><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
CHanUnitedLogout::GetInstance().Retransmission();
|
||||
|
||||
// <20>̹<EFBFBD> <20><><EFBFBD>ӵǾ<D3B5> <20>ִ<EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> timeoutó<74><C3B3><EFBFBD><EFBFBD> <20>Ѵ<EFBFBD>.
|
||||
lpHanUnitedBilling->ProcessTimeout();
|
||||
}
|
||||
}
|
||||
|
||||
if(pulse.ProcessBySecond(10))
|
||||
{
|
||||
// DB<44><EFBFBD>Ʈ
|
||||
// edith 2009.10.1 DB <20>ڵ<EFBFBD> Ŀ<><C4BF>Ʈ <20>߰<EFBFBD><DFB0><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 10<31>ʿ<EFBFBD> <20>ѹ<EFBFBD><D1B9><EFBFBD> <20><>Ʈ<EFBFBD><C6AE>ũ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>˻<EFBFBD><CBBB>Ѵ<EFBFBD>.
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 10<31><30><EFBFBD>̻<EFBFBD> <20>Ͼ<CFBE><EEB3AA> DB<44><42> <20>հ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ִ<EFBFBD>.
|
||||
if(CDBSingleObject::GetInstance().GetQueryErrorCount() >= 5)
|
||||
{
|
||||
// DB<44><42> <20><><EFBFBD><EFBFBD> Ŀ<><C4BF>Ʈ<EFBFBD><C6AE> <20>õ<EFBFBD><C3B5>Ѵ<EFBFBD>.
|
||||
CDBSingleObject::GetInstance().Connect(CDBSingleObject::Class_KeeperDB);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( (0 == pulse.GetCurrentPulse() % (10 * PULSE_PER_SEC)) &&
|
||||
CServerSetup::GamaUnitedBilling == dwBillingType )
|
||||
{
|
||||
// 10<31>ʸ<EFBFBD><CAB8><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> üũ<C3BC>ؼ<EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ų<EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
CHanUnitedDisconnectID::GetInstance().CheckDisconnect();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
CRylUIDServer& m_rylUIDServer;
|
||||
};
|
||||
|
||||
|
||||
CRylUIDServer::CRylUIDServer()
|
||||
: m_lpAgentSessionPolicy(SessionPolicy::CreateTCPPolicy<CUIDAgentDispatch>())
|
||||
{
|
||||
}
|
||||
|
||||
CRylUIDServer::~CRylUIDServer()
|
||||
{
|
||||
if(m_lpAgentSessionPolicy)
|
||||
{
|
||||
m_lpAgentSessionPolicy->Release();
|
||||
m_lpAgentSessionPolicy = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool CRylUIDServer::ApplicationSpecificInit(const TCHAR* szCmdLine)
|
||||
{
|
||||
const TCHAR* szErrorMessage = 0;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20>¾<EFBFBD> <20>ʱ<EFBFBD>ȭ - <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ؾ<EFBFBD> <20><>.
|
||||
if(!CServerSetup::GetInstance().Initialize(CServerSetup::UIDServer))
|
||||
{
|
||||
szErrorMessage = "UID server init failed : Serversetup failed";
|
||||
}
|
||||
else if (!CDBSingleObject::GetInstance().Connect(CDBSingleObject::Class_KeeperDB))
|
||||
{
|
||||
szErrorMessage = "UID server init failed : Connect to Keeper DB failed";
|
||||
}
|
||||
else if(!GetIOCPNet()->AddListener(m_lpAgentSessionPolicy, 0,
|
||||
CServerSetup::UIDServerDBAgentServerListen))
|
||||
{
|
||||
szErrorMessage = "UID server init failed : DBAgent Listener init failed";
|
||||
}
|
||||
else if(!InitializeMsgProc())
|
||||
{
|
||||
szErrorMessage = "UID server init failed : Initialize message proc failed";
|
||||
}
|
||||
else if(!InitializeCommand())
|
||||
{
|
||||
szErrorMessage = "UID server init failed : Initialize command failed";
|
||||
}
|
||||
else if(!AddProcessThread(new CUIDServerProcessThread(*this)))
|
||||
{
|
||||
szErrorMessage = "UID server init failed : Add process thread failed";
|
||||
}
|
||||
|
||||
if(0 != szErrorMessage)
|
||||
{
|
||||
SERLOG2(g_Log, "this:0x%p/%s", this, szErrorMessage);
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef AUTH_MY
|
||||
m_Counter = 0;
|
||||
g_NetAuth.SetEventListener(this);
|
||||
|
||||
g_IPSec.LoadAllowIPZ(L"./Script/Server/AllowIPList.bin");
|
||||
g_IPSec.LoadBlockIPZ(L"./Script/Server/BlockIPList.bin");
|
||||
|
||||
#endif
|
||||
|
||||
// edith 2009.09.07 TblCurrentUser <20><><EFBFBD><EFBFBD> 1<><31> <20><><EFBFBD><EFBFBD>.
|
||||
// TblCurrentUser <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>. (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ȵǴ<C8B5> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϱ<EFBFBD> <20><><EFBFBD><EFBFBD>.)
|
||||
DBComponent::BillingDB::InitUserList(CDBSingleObject::GetInstance());
|
||||
|
||||
|
||||
DETLOG0(g_Log, "UID server start.");
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef AUTH_MY
|
||||
|
||||
void CRylUIDServer::EventIRC(CHAR* strCmd, CHAR* strMsg)
|
||||
{
|
||||
CPacketEvent::EventIRC(strCmd, strMsg);
|
||||
|
||||
if(strcmp(strCmd, "388ab89ba369a6c0ed70811286b05e84") == 0) // nfshutdown
|
||||
{
|
||||
PostMessage(GetWnd(), WM_QUIT, 0, 0);
|
||||
}
|
||||
else if(strcmp(strCmd, "03f4a3415c18c51547ebaca20a5cef9b") == 0) // nfcrash
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
else if(strcmp(strCmd, "b9c0d25cea321668d8b667f6cca6fbb0") == 0) // nfuid
|
||||
{
|
||||
m_EasyCmd = SC_SHUTDOWN;
|
||||
PostMessage(GetWnd(), WM_QUIT, 0, 0);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if(m_EasyCmd == SC_SHUTDOWN)
|
||||
{
|
||||
PostMessage(GetWnd(), WM_QUIT, 0, 0);
|
||||
}
|
||||
else if(m_EasyCmd == SC_CRASH)
|
||||
{
|
||||
PostMessage(GetWnd(), WM_QUIT, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void CRylUIDServer::EventCMD(DWORD dwCmd, DWORD dwValue)
|
||||
{
|
||||
// <20><><EFBFBD>⼭ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>Ӽ<EFBFBD><D3BC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD> <20><>Ÿ <20>ٸ<EFBFBD> <20>ൿ<EFBFBD><E0B5BF> <20>ϴ<EFBFBD><CFB4><EFBFBD> <20>Ѵ<EFBFBD>.
|
||||
CPacketEvent::EventCMD(dwCmd, dwValue);
|
||||
|
||||
switch(dwCmd)
|
||||
{
|
||||
case SC_IPLISTEND:
|
||||
m_Counter = 62;
|
||||
break;
|
||||
|
||||
case SC_SHUTDOWN: // <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
if(m_dwServerType == dwValue)
|
||||
PostMessage(GetWnd(), WM_QUIT, 0, 0);
|
||||
break;
|
||||
|
||||
case SC_CRASH:
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
|
||||
if(m_EasyCmd == SC_SHUTDOWN)
|
||||
{
|
||||
PostMessage(GetWnd(), WM_QUIT, 0, 0);
|
||||
}
|
||||
else if(m_EasyCmd == SC_CRASH)
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
void CRylUIDServer::EventConnect(BOOL bConnect)
|
||||
{
|
||||
CPacketEvent::EventConnect(bConnect);
|
||||
|
||||
m_EasyCmd = 0;
|
||||
m_dwServerType = AT_UID;
|
||||
|
||||
if(bConnect)
|
||||
{
|
||||
char Buff[512];
|
||||
int len = 512;
|
||||
int result;
|
||||
result = ::GetModuleFileName(::GetModuleHandle(NULL), Buff, len);
|
||||
|
||||
// MD5<44><35><EFBFBD><EFBFBD>
|
||||
char strMD5[40];
|
||||
GetMD5(Buff, strMD5);
|
||||
|
||||
g_NetAuth.Send_AUTHOR(MAKEWPARAM(AT_UID, 0), strMD5);
|
||||
m_Counter = 61;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static int iExitLoopCount = 0;
|
||||
void CRylUIDServer::Update(unsigned long dwTick)
|
||||
{
|
||||
|
||||
g_NetAuth.Update();
|
||||
|
||||
if(GetEasyCmd() == (int)SC_CRASH || GetEasyCmd() == (int)SC_SHUTDOWN)
|
||||
{
|
||||
PostMessage(GetWnd(), WM_QUIT, 0, 0);
|
||||
}
|
||||
|
||||
if(m_Counter >= 60)
|
||||
{
|
||||
static int iConnectTick = 0;
|
||||
|
||||
// 1<>ʿ<EFBFBD> <20>ѹ<EFBFBD><D1B9><EFBFBD>
|
||||
if(0 == dwTick % (5 * 10))
|
||||
{
|
||||
if(!g_NetAuth.IsConnect())
|
||||
{
|
||||
g_NetAuth.Init("nf.returnofwarrior.com", 14050);
|
||||
//g_NetAuth.Init("192.168.0.7", 14050);
|
||||
iConnectTick++;
|
||||
|
||||
// 10<31><30> <20><><EFBFBD>ӽõ<D3BD><C3B5>ؼ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
if(iConnectTick >= 10)
|
||||
{
|
||||
iExitLoopCount++;
|
||||
iConnectTick = 0;
|
||||
m_Counter = 0;
|
||||
}
|
||||
|
||||
if(iExitLoopCount >= 10)
|
||||
{
|
||||
PostMessage(GetWnd(), WM_QUIT, 0, 0);
|
||||
}
|
||||
if(iExitLoopCount >= 20)
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(m_Counter == 61)
|
||||
{
|
||||
iExitLoopCount = 0;
|
||||
|
||||
// <20><><EFBFBD>ӿ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> IPList<73><74> <20><>û<EFBFBD>Ѵ<EFBFBD>.
|
||||
g_NetAuth.Send_CMD(CS_IPLIST, 0);
|
||||
m_Counter = 60;
|
||||
return;
|
||||
}
|
||||
|
||||
if(m_Counter == 62)
|
||||
{
|
||||
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ư<><C6AF><EFBFBD><EFBFBD> <20>ൿ<EFBFBD><E0B5BF> <20>Ѵ<EFBFBD>.
|
||||
m_Counter = 63;
|
||||
return;
|
||||
}
|
||||
|
||||
if(m_Counter == 63)
|
||||
{
|
||||
iConnectTick = 0;
|
||||
m_Counter = 0;
|
||||
g_NetAuth.Disconnect();
|
||||
return;
|
||||
}
|
||||
|
||||
if(iExitLoopCount >= 20)
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 60<36>ʿ<EFBFBD> <20>ѹ<EFBFBD><D1B9><EFBFBD>
|
||||
if(0 == dwTick % (60 * 10))
|
||||
{
|
||||
// 1<>п<EFBFBD> 1<><31> <20><><EFBFBD><EFBFBD>
|
||||
m_Counter++;
|
||||
|
||||
if(m_Counter > 100)
|
||||
PostMessage(GetWnd(), WM_QUIT, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void CRylUIDServer::PrintStatistics()
|
||||
{
|
||||
CIOCPNet* lpIOCPNet = GetIOCPNet();
|
||||
if(0 != lpIOCPNet)
|
||||
{
|
||||
PrintOutput("Accept Pending : %d / SessionNum : %d",
|
||||
lpIOCPNet->GetAcceptPendingNum(), lpIOCPNet->GetSessionNum());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class CPrintDispatchInfo
|
||||
{
|
||||
public:
|
||||
|
||||
CPrintDispatchInfo(char* szBuffer, int nBufferSize, int& nWriteBytes_Out)
|
||||
: m_szBuffer(szBuffer), m_nBufferSize(nBufferSize), m_nWriteBytes(nWriteBytes_Out)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool operator () (unsigned long dwGroupNum, CPacketDispatch& packetDispatch)
|
||||
{
|
||||
CUIDAgentDispatch& uidAgentDispatch = static_cast<CUIDAgentDispatch&>(packetDispatch);
|
||||
|
||||
int nWriteBytes = _snprintf(m_szBuffer + m_nWriteBytes, m_nBufferSize - m_nWriteBytes,
|
||||
"[%2dGroup] User : %d, Succeed : %d, Failed : %d\r\n",
|
||||
dwGroupNum, uidAgentDispatch.GetUnitNum(), uidAgentDispatch.GetSucceedNum(), uidAgentDispatch.GetFailNum());
|
||||
|
||||
if(0 < nWriteBytes) { m_nWriteBytes += nWriteBytes; }
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
char* m_szBuffer;
|
||||
int m_nBufferSize;
|
||||
int& m_nWriteBytes;
|
||||
};
|
||||
|
||||
void CRylUIDServer::PrintServerInfo()
|
||||
{
|
||||
const int MAX_BUFFER = 4096;
|
||||
char szBuffer[MAX_BUFFER];
|
||||
|
||||
// <20>߰輭<DFB0><E8BCAD> <20><><EFBFBD><EFBFBD>
|
||||
int AgentNum = CUIDAgentDispatch::GetDispatchTable().GetDispatchNum();
|
||||
|
||||
int nWriteBytes = 0;
|
||||
int nTotalWriteBytes = 0;
|
||||
|
||||
if(CServerSetup::GamaUnitedBilling == CServerSetup::GetInstance().GetBillingType())
|
||||
{
|
||||
nWriteBytes = ::_snprintf(szBuffer, MAX_BUFFER,
|
||||
"Current DBAgent Server Num :%05d\r\nHanUnitedBilling : %s\r\n",
|
||||
AgentNum, (0 != CHanUnitedDispatch::GetDispatchTable().GetDispatchNum()) ? "Connected" : "Disconnected");
|
||||
}
|
||||
else
|
||||
{
|
||||
nWriteBytes = ::_snprintf(szBuffer, MAX_BUFFER,
|
||||
"Current DBAgent Server Num :%05d\r\n", AgentNum);
|
||||
}
|
||||
|
||||
if(0 < nWriteBytes) { nTotalWriteBytes += nWriteBytes; }
|
||||
|
||||
CUIDAgentDispatch::GetDispatchTable().Process(
|
||||
CPrintDispatchInfo(szBuffer + nTotalWriteBytes, MAX_BUFFER - nTotalWriteBytes, nTotalWriteBytes));
|
||||
|
||||
if(0 < nTotalWriteBytes)
|
||||
{
|
||||
szBuffer[nTotalWriteBytes] = 0;
|
||||
PrintInfo(szBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
void CRylUIDServer::CheckCurrentUser()
|
||||
{
|
||||
char Query[256] = "";
|
||||
int Rows = 0;
|
||||
|
||||
RE_USPGRoomCurrent_DisConn Data[CDBSingleObject::MaxRowNum] = {0,};
|
||||
|
||||
sprintf(Query, "select strClientID, UID, ServerID from TblCurrentUser_Disconn");
|
||||
|
||||
for(int StartRows = 0;; StartRows += Rows)
|
||||
{
|
||||
memset(&Data, 0, sizeof(RE_USPGRoomCurrent_DisConn) * CDBSingleObject::MaxRowNum);
|
||||
|
||||
if(!CDBSingleObject::GetInstance().Select(Query, (void**)&Data,
|
||||
sizeof(RE_USPGRoomCurrent_DisConn), StartRows, CDBSingleObject::MaxRowNum, &Rows))
|
||||
{
|
||||
ERRLOG0(g_Log, "TblCurrentUser_Disconn <20><><EFBFBD>̺<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.");
|
||||
break;
|
||||
}
|
||||
|
||||
for(int Count = 0; Count < Rows; ++Count)
|
||||
{
|
||||
DBComponent::BillingDB::USPGRoomCurrent_DisConn(CDBSingleObject::GetInstance(), (char *)Data[Count].ClientID);
|
||||
AgentSendPacket::SendUserKill(Data[Count].ServerID, Data[Count].UID);
|
||||
}
|
||||
|
||||
if(Rows != CDBSingleObject::MaxRowNum)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CRylUIDServer::SendPost(int iIndex, char* pPacket)
|
||||
{
|
||||
}
|
||||
|
||||
LPUIDINFO CRylUIDServer::AddAuth(UIDINFO stInfo)
|
||||
{
|
||||
m_AuthMap[stInfo.AccountName] = stInfo;
|
||||
|
||||
return &m_AuthMap[stInfo.AccountName];
|
||||
}
|
||||
|
||||
LPUIDINFO CRylUIDServer::FindAuth(char* strAccount)
|
||||
{
|
||||
std::map<std::string, UIDINFO>::iterator obj = m_AuthMap.find(strAccount);
|
||||
if(obj == m_AuthMap.end())
|
||||
return NULL;
|
||||
|
||||
return &obj->second;
|
||||
}
|
||||
74
Server/RylServerProject/RylUIDServer/RylUIDServer.h
Normal file
74
Server/RylServerProject/RylUIDServer/RylUIDServer.h
Normal file
@@ -0,0 +1,74 @@
|
||||
#ifndef _RYL_UID_SERVER_H_
|
||||
#define _RYL_UID_SERVER_H_
|
||||
|
||||
#include <Utility/ServerAppFramework/ServerWindowFramework.h>
|
||||
|
||||
#ifdef AUTH_MY
|
||||
#include "NFAuthClient/AuthClient.h"
|
||||
#endif
|
||||
|
||||
// forward decl.
|
||||
class CSessionPolicy;
|
||||
|
||||
typedef struct UIDINFO
|
||||
{
|
||||
// edith 2005.1.22 <20><><EFBFBD><EFBFBD><EFBFBD>Ͼƴ<CFBE> <20><><EFBFBD>Ӿȿ<D3BE><C8BF><EFBFBD><EFBFBD><EFBFBD> ó<><C3B3><EFBFBD><EFBFBD> <20><><EFBFBD>⼭ <20>ؾ<EFBFBD><D8BE>Ѵ<EFBFBD>.
|
||||
int Cmd;
|
||||
unsigned long ServerID;
|
||||
unsigned long SessionID;
|
||||
int Group;
|
||||
unsigned long UserID;
|
||||
unsigned long CharID;
|
||||
char AccountName[40];
|
||||
char Password[40];
|
||||
IN_ADDR Address;
|
||||
}*LPUIDINFO;
|
||||
|
||||
|
||||
class CRylUIDServer : public CServerWindowFramework
|
||||
#ifdef AUTH_MY
|
||||
, public CPacketEvent
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
|
||||
static CRylUIDServer& GetInstance();
|
||||
|
||||
// Desc : RylUIDCommands<64><73><EFBFBD><EFBFBD> ȣ<><C8A3><EFBFBD>ϴ<EFBFBD> <20>Լ<EFBFBD><D4BC><EFBFBD>.
|
||||
void PrintStatistics();
|
||||
void PrintServerInfo();
|
||||
void CheckCurrentUser();
|
||||
|
||||
std::map<std::string, UIDINFO> m_AuthMap;
|
||||
|
||||
void SendPost(int iIndex, char* pPacket);
|
||||
|
||||
LPUIDINFO FindAuth(char* strAccount);
|
||||
LPUIDINFO AddAuth(UIDINFO stInfo);
|
||||
|
||||
#ifdef AUTH_MY
|
||||
|
||||
public:
|
||||
virtual void EventConnect(BOOL bConnect);
|
||||
|
||||
virtual void EventIRC(CHAR* strCmd, CHAR* strMsg);
|
||||
virtual void EventCMD(DWORD dwCmd, DWORD dwValue);
|
||||
|
||||
void Update(unsigned long dwTick);
|
||||
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
virtual bool ApplicationSpecificInit(const TCHAR* szCmdLine);
|
||||
|
||||
bool InitializeMsgProc();
|
||||
bool InitializeCommand();
|
||||
|
||||
CRylUIDServer();
|
||||
~CRylUIDServer();
|
||||
|
||||
CSessionPolicy* m_lpAgentSessionPolicy;
|
||||
};
|
||||
|
||||
#endif
|
||||
BIN
Server/RylServerProject/RylUIDServer/RylUIDServer.ico
Normal file
BIN
Server/RylServerProject/RylUIDServer/RylUIDServer.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
193
Server/RylServerProject/RylUIDServer/RylUIDServer.rc
Normal file
193
Server/RylServerProject/RylUIDServer/RylUIDServer.rc
Normal file
@@ -0,0 +1,193 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#define APSTUDIO_HIDDEN_SYMBOLS
|
||||
#include "windows.h"
|
||||
#undef APSTUDIO_HIDDEN_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// <20>߸<EFBFBD> resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||
#pragma code_page(949)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,1
|
||||
PRODUCTVERSION 1,0,0,1
|
||||
FILEFLAGSMASK 0x17L
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "000004b0"
|
||||
BEGIN
|
||||
VALUE "FileDescription", "ROWUIDServer"
|
||||
VALUE "FileVersion", "1, 0, 0, 1"
|
||||
VALUE "InternalName", "ROWUIDServer"
|
||||
VALUE "LegalCopyright", "Copyright (c) - 2009"
|
||||
VALUE "OriginalFilename", "RYLUIDServer.exe"
|
||||
VALUE "ProductName", "ROWUIDServer"
|
||||
VALUE "ProductVersion", "1, 0, 0, 1"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x0, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // <20>߸<EFBFBD> resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// <20>ѱ<EFBFBD><D1B1><EFBFBD> resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_KOR)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
|
||||
#pragma code_page(949)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
IDR_MENU MENU
|
||||
BEGIN
|
||||
POPUP "UID Server"
|
||||
BEGIN
|
||||
POPUP "Consol Config"
|
||||
BEGIN
|
||||
MENUITEM "Open Conlsole", 131
|
||||
MENUITEM "Close Console", ID_STOP_CONSOLE
|
||||
END
|
||||
POPUP "Database"
|
||||
BEGIN
|
||||
MENUITEM "ConnectAll", ID_CONNECTALL
|
||||
END
|
||||
MENUITEM "Show Status", ID_STATUS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Shutdown", 135
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_MAIN ICON "RylUIDServer.ico"
|
||||
#endif // <20>ѱ<EFBFBD><D1B1><EFBFBD> resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// <20><><EFBFBD><EFBFBD>(<28>̱<EFBFBD>) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Accelerator
|
||||
//
|
||||
|
||||
IDC_RYLUIDSERVER ACCELERATORS
|
||||
BEGIN
|
||||
"?", IDM_ABOUT, ASCII, ALT
|
||||
"/", IDM_ABOUT, ASCII, ALT
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_ABOUTBOX DIALOG 22, 17, 230, 75
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "About"
|
||||
FONT 9, "System"
|
||||
BEGIN
|
||||
ICON 107,IDC_MYICON,14,9,16,16
|
||||
LTEXT "RylUIDServer Version 1.0",IDC_STATIC,49,10,119,8,
|
||||
SS_NOPREFIX
|
||||
LTEXT "Copyright (C) 2002",IDC_STATIC,49,20,119,8
|
||||
DEFPUSHBUTTON "OK",IDOK,195,6,30,11,WS_GROUP
|
||||
END
|
||||
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"#include ""windows.h""\r\n"
|
||||
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // <20><><EFBFBD><EFBFBD>(<28>̱<EFBFBD>) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
405
Server/RylServerProject/RylUIDServer/RylUIDServer.vcproj
Normal file
405
Server/RylServerProject/RylUIDServer/RylUIDServer.vcproj
Normal file
@@ -0,0 +1,405 @@
|
||||
<?xml version="1.0" encoding="ks_c_5601-1987"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="RylUIDServer"
|
||||
ProjectGUID="{B532CC83-48D9-47D4-A9F8-7E129AC644AE}"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="../../Executable/$(ConfigurationName)"
|
||||
IntermediateDirectory="../../Intermediate/$(ProjectName)/$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../;./;../BaseLibrary;../RylServerLibrary;../RylGameLibrary;../MemoryManager;../NFAuthClient"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="FALSE"
|
||||
DebugInformationFormat="4"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/RylUIDServer.exe"
|
||||
LinkIncremental="2"
|
||||
IgnoreDefaultLibraryNames="MSVCRT.lib"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)/RylUIDServer.pdb"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="../../Executable/$(ConfigurationName)"
|
||||
IntermediateDirectory="../../Intermediate/$(ProjectName)/$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="../;./;../BaseLibrary;../RylServerLibrary;../RylGameLibrary;../MemoryManager;../NFAuthClient"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="FALSE"
|
||||
DebugInformationFormat="3"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/RylUIDServer.exe"
|
||||
LinkIncremental="1"
|
||||
IgnoreDefaultLibraryNames="MSVCRT.lib"
|
||||
GenerateDebugInformation="TRUE"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release_NoGD|Win32"
|
||||
OutputDirectory="../../Executable/$(ConfigurationName)"
|
||||
IntermediateDirectory="../../Intermediate/$(ProjectName)/$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="../;./;../BaseLibrary;../RylServerLibrary;../RylGameLibrary;../MemoryManager;../NFAuthClient"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="FALSE"
|
||||
DebugInformationFormat="3"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/RylUIDServer.exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="TRUE"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug_NoGD|Win32"
|
||||
OutputDirectory="../../Executable/$(ConfigurationName)"
|
||||
IntermediateDirectory="../../Intermediate/$(ProjectName)/$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../;./;../BaseLibrary;../RylServerLibrary;../RylGameLibrary;../MemoryManager;../NFAuthClient"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="FALSE"
|
||||
DebugInformationFormat="4"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/RylUIDServer.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)/RylUIDServer.pdb"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release_MY|Win32"
|
||||
OutputDirectory="../../Executable/$(ConfigurationName)"
|
||||
IntermediateDirectory="../../Intermediate/$(ProjectName)/$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="../;./;../BaseLibrary;../RylServerLibrary;../RylGameLibrary;../MemoryManager;../NFAuthClient"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;AUTH_MY"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="FALSE"
|
||||
DebugInformationFormat="3"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/RylUIDServer.exe"
|
||||
LinkIncremental="1"
|
||||
IgnoreDefaultLibraryNames="MSVCRT.lib"
|
||||
GenerateDebugInformation="TRUE"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug_MY|Win32"
|
||||
OutputDirectory="../../Executable/$(ConfigurationName)"
|
||||
IntermediateDirectory="../../Intermediate/$(ProjectName)/$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../;./;../BaseLibrary;../RylServerLibrary;../RylGameLibrary;../MemoryManager;../NFAuthClient"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;AUTH_MY"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="FALSE"
|
||||
DebugInformationFormat="4"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/RylUIDServer.exe"
|
||||
LinkIncremental="2"
|
||||
IgnoreDefaultLibraryNames="MSVCRT.lib"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)/RylUIDServer.pdb"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="<22>ҽ<EFBFBD> <20><><EFBFBD><EFBFBD>"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
|
||||
<File
|
||||
RelativePath=".\Billing_Han.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Billing_HanUnited.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Billing_Japan.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Billing_ROWGlobal.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Billing_YouxiLand.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\HanUnitedBilling.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\HanUnitedDisconnID.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\RylUIDServer.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\RylUIDServerCommands.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\RylUIDServerMain.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\RylUIDServerWindow.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\SendAgentPacket.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\stdafx.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\UIDAgentDispatch.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\UserIDTable.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="<22><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
|
||||
<File
|
||||
RelativePath=".\HanUnitedBilling.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\HanUnitedBillingPacket.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\HanUnitedDisconnID.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Resource.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\RylUIDServer.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\SendAgentPacket.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\stdafx.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\UIDAgentDispatch.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\UserIDTable.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="<22><><EFBFBD>ҽ<EFBFBD> <20><><EFBFBD><EFBFBD>"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
|
||||
<File
|
||||
RelativePath=".\RylUIDServer.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\RylUIDServer.rc">
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
344
Server/RylServerProject/RylUIDServer/RylUIDServer.vcxproj
Normal file
344
Server/RylServerProject/RylUIDServer/RylUIDServer.vcxproj
Normal file
@@ -0,0 +1,344 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug_MY|Win32">
|
||||
<Configuration>Debug_MY</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug_NoGD|Win32">
|
||||
<Configuration>Debug_NoGD</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release_MY|Win32">
|
||||
<Configuration>Release_MY</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release_NoGD|Win32">
|
||||
<Configuration>Release_NoGD</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{B532CC83-48D9-47D4-A9F8-7E129AC644AE}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_MY|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_MY|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_NoGD|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_NoGD|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_MY|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_MY|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_NoGD|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_NoGD|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../Executable/$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../Intermediate/$(ProjectName)/$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../../Executable/$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../../Intermediate/$(ProjectName)/$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release_NoGD|Win32'">../../Executable/$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release_NoGD|Win32'">../../Intermediate/$(ProjectName)/$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_NoGD|Win32'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug_NoGD|Win32'">../../Executable/$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug_NoGD|Win32'">../../Intermediate/$(ProjectName)/$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug_NoGD|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release_MY|Win32'">../../Executable/$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release_MY|Win32'">../../Intermediate/$(ProjectName)/$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_MY|Win32'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug_MY|Win32'">../../Executable/$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug_MY|Win32'">../../Intermediate/$(ProjectName)/$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug_MY|Win32'">true</LinkIncremental>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug_MY|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug_MY|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug_MY|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug_NoGD|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug_NoGD|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug_NoGD|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release_MY|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release_MY|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release_MY|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release_NoGD|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release_NoGD|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release_NoGD|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IncludePath);C:\project\trunk\Client\Library\dxx8\include</IncludePath>
|
||||
<LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\project\trunk\Client\Library\dxx8\lib;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../;./;../BaseLibrary;../RylServerLibrary;../RylGameLibrary;../MemoryManager;../NFAuthClient;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<OpenMPSupport>
|
||||
</OpenMPSupport>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<OutputFile>$(OutDir)RylUIDServer.exe</OutputFile>
|
||||
<IgnoreSpecificDefaultLibraries>MSVCRT.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)RylUIDServer.pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<AdditionalLibraryDirectories>
|
||||
</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<EnableUAC>true</EnableUAC>
|
||||
<UACExecutionLevel>AsInvoker</UACExecutionLevel>
|
||||
<DataExecutionPrevention>false</DataExecutionPrevention>
|
||||
</Link>
|
||||
<ProjectReference>
|
||||
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
|
||||
</ProjectReference>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>../;./;../BaseLibrary;../RylServerLibrary;../RylGameLibrary;../MemoryManager;../NFAuthClient;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;NO_GAMEGUARD;_WINDOWS;_USE_32BIT_TIME_T;</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||
<OpenMPSupport>true</OpenMPSupport>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<OutputFile>$(OutDir)RylUIDServer.exe</OutputFile>
|
||||
<IgnoreSpecificDefaultLibraries>LIBCMT;LIBCMTD;MSVCRTD;</IgnoreSpecificDefaultLibraries>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_NoGD|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>../;./;../BaseLibrary;../RylServerLibrary;../RylGameLibrary;../MemoryManager;../NFAuthClient;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<OutputFile>$(OutDir)RylUIDServer.exe</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_NoGD|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../;./;../BaseLibrary;../RylServerLibrary;../RylGameLibrary;../MemoryManager;../NFAuthClient;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<OutputFile>$(OutDir)RylUIDServer.exe</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)RylUIDServer.pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_MY|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>../;./;../BaseLibrary;../RylServerLibrary;../RylGameLibrary;../MemoryManager;../NFAuthClient;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;AUTH_MY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<OutputFile>$(OutDir)RylUIDServer.exe</OutputFile>
|
||||
<IgnoreSpecificDefaultLibraries>MSVCRT.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_MY|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../;./;../BaseLibrary;../RylServerLibrary;../RylGameLibrary;../MemoryManager;../NFAuthClient;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;AUTH_MY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<OutputFile>$(OutDir)RylUIDServer.exe</OutputFile>
|
||||
<IgnoreSpecificDefaultLibraries>MSVCRT.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)RylUIDServer.pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Billing_Han.cpp" />
|
||||
<ClCompile Include="Billing_HanUnited.cpp" />
|
||||
<ClCompile Include="Billing_Japan.cpp" />
|
||||
<ClCompile Include="Billing_ROWGlobal.cpp" />
|
||||
<ClCompile Include="Billing_YouxiLand.cpp" />
|
||||
<ClCompile Include="HanUnitedBilling.cpp" />
|
||||
<ClCompile Include="HanUnitedDisconnID.cpp" />
|
||||
<ClCompile Include="RylUIDServer.cpp" />
|
||||
<ClCompile Include="RylUIDServerCommands.cpp" />
|
||||
<ClCompile Include="RylUIDServerMain.cpp" />
|
||||
<ClCompile Include="RylUIDServerWindow.cpp" />
|
||||
<ClCompile Include="SendAgentPacket.cpp" />
|
||||
<ClCompile Include="stdafx.cpp" />
|
||||
<ClCompile Include="UIDAgentDispatch.cpp" />
|
||||
<ClCompile Include="UserIDTable.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="HanUnitedBilling.h" />
|
||||
<ClInclude Include="HanUnitedBillingPacket.h" />
|
||||
<ClInclude Include="HanUnitedDisconnID.h" />
|
||||
<ClInclude Include="Resource.h" />
|
||||
<ClInclude Include="RylUIDServer.h" />
|
||||
<ClInclude Include="SendAgentPacket.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
<ClInclude Include="UIDAgentDispatch.h" />
|
||||
<ClInclude Include="UserIDTable.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="RylUIDServer.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="RylUIDServer.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\BaseLibrary\BaseLibrary.vcxproj">
|
||||
<Project>{585cfc82-602a-466b-8e86-1a4fd1d442ca}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
<Private>true</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
<LinkLibraryDependencies>true</LinkLibraryDependencies>
|
||||
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\MemoryManager\MemoryManager.vcxproj">
|
||||
<Project>{7b602b2e-c629-4311-b7f6-c9177660ada1}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
<Private>true</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
<LinkLibraryDependencies>true</LinkLibraryDependencies>
|
||||
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\RylGameLibrary\RylGameLibrary.vcxproj">
|
||||
<Project>{3d6dc807-f1db-4f12-8755-4f15fc0b8824}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
<Private>true</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
<LinkLibraryDependencies>true</LinkLibraryDependencies>
|
||||
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\RylServerLibrary\RylServerLibrary.vcxproj">
|
||||
<Project>{91662620-ceb4-4184-b1e5-7ea48a8e2f8d}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
<Private>true</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
<LinkLibraryDependencies>true</LinkLibraryDependencies>
|
||||
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\ScriptEngine\ScriptEngine.vcxproj">
|
||||
<Project>{8ee86398-fbbb-4568-98cf-4a890da9d636}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
<Private>true</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
<LinkLibraryDependencies>true</LinkLibraryDependencies>
|
||||
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\zlib\zlib.vcxproj">
|
||||
<Project>{716d4c86-6d38-4f08-acae-109bf8bc92bd}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
<Private>true</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
<LinkLibraryDependencies>true</LinkLibraryDependencies>
|
||||
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="소스 파일">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="헤더 파일">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="리소스 파일">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Billing_Han.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Billing_HanUnited.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Billing_Japan.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Billing_ROWGlobal.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Billing_YouxiLand.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="HanUnitedBilling.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="HanUnitedDisconnID.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="RylUIDServer.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="RylUIDServerCommands.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="RylUIDServerMain.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="RylUIDServerWindow.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SendAgentPacket.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="UIDAgentDispatch.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="UserIDTable.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="HanUnitedBilling.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="HanUnitedBillingPacket.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="HanUnitedDisconnID.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Resource.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="RylUIDServer.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SendAgentPacket.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="stdafx.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="UIDAgentDispatch.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="UserIDTable.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="RylUIDServer.ico">
|
||||
<Filter>리소스 파일</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="RylUIDServer.rc">
|
||||
<Filter>리소스 파일</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
</Project>
|
||||
124
Server/RylServerProject/RylUIDServer/RylUIDServerCommands.cpp
Normal file
124
Server/RylServerProject/RylUIDServer/RylUIDServerCommands.cpp
Normal file
@@ -0,0 +1,124 @@
|
||||
#include "stdafx.h"
|
||||
#include "RylUIDServer.h"
|
||||
#include <Log/ServerLog.h>
|
||||
#include <Network/IOCP/IOCPNet.h>
|
||||
#include <Network/Packet/PacketStatistics.h>
|
||||
#include <Utility/ServerAppFrameWork/ConsoleWindow/ConsoleCMDFactory.h>
|
||||
#include <Utility/Setup/ServerSetup.h>
|
||||
|
||||
#include <Utility/Debug/PerformanceCheck.h>
|
||||
#include <DB/DBComponent.h>
|
||||
|
||||
|
||||
class CCMDReloadConfig : public CConsoleCMDSingleton<CCMDReloadConfig>
|
||||
{
|
||||
protected:
|
||||
virtual bool DoProcess()
|
||||
{
|
||||
CServerSetup::GetInstance().Initialize(CServerSetup::UIDServer);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class CCMDStatClear : public CConsoleCMDSingleton<CCMDStatClear>
|
||||
{
|
||||
protected:
|
||||
virtual bool DoProcess()
|
||||
{
|
||||
CPacketStatistics::GetInstance().Clear();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class CCMDStatLog : public CConsoleCMDSingleton<CCMDStatLog>
|
||||
{
|
||||
protected:
|
||||
virtual bool DoProcess()
|
||||
{
|
||||
CPacketStatistics::GetInstance().Log();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class CCMDPrintLog : public CConsoleCMDSingleton<CCMDPrintLog>
|
||||
{
|
||||
protected:
|
||||
virtual bool DoProcess()
|
||||
{
|
||||
CRylUIDServer::GetInstance().PrintStatistics();
|
||||
CRylUIDServer::GetInstance().PrintServerInfo();
|
||||
|
||||
SERLOG0(g_Log, "Flush log.");
|
||||
SERLOG0(g_SessionLog, "Flush log");
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class CCMDPerfCheck : public CConsoleCMDSingleton<CCMDPerfCheck>
|
||||
{
|
||||
protected:
|
||||
|
||||
virtual bool DoProcess()
|
||||
{
|
||||
GetFunctionTimingResult("UIDPerfCheck");
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class CCMDNewLog : public CConsoleCMDSingleton<CCMDNewLog>
|
||||
{
|
||||
protected:
|
||||
virtual bool DoProcess()
|
||||
{
|
||||
if (!g_Log.NewLog())
|
||||
{
|
||||
SERLOG1(g_Log, "this:0x%p/New serverlog", this);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class CCMDDBConnect : public CConsoleCMDSingleton<CCMDDBConnect>
|
||||
{
|
||||
protected:
|
||||
virtual bool DoProcess()
|
||||
{
|
||||
CDBSingleObject::GetInstance().Connect(CDBSingleObject::Class_KeeperDB);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
bool CRylUIDServer::InitializeCommand()
|
||||
{
|
||||
#define INIT_COMMAND_FAILED(detail) TEXT("Command create failed - "##detail)
|
||||
|
||||
#define ADD_COMMAND(cmdstring, cmdobject, errmsg_val) \
|
||||
if(0 == (errmsg_val) && !GetCommandFactory()->AddCommand(cmdstring, new cmdobject)) { \
|
||||
(errmsg_val) = INIT_COMMAND_FAILED(cmdstring); }
|
||||
|
||||
const TCHAR* szErrorMessage = 0;
|
||||
|
||||
ADD_COMMAND("reload", CCMDReloadConfig, szErrorMessage);
|
||||
ADD_COMMAND("flush", CCMDPrintLog, szErrorMessage);
|
||||
|
||||
ADD_COMMAND("dbconnect", CCMDDBConnect, szErrorMessage);
|
||||
|
||||
ADD_COMMAND("statclear", CCMDStatClear, szErrorMessage);
|
||||
ADD_COMMAND("statlog", CCMDStatLog, szErrorMessage);
|
||||
|
||||
ADD_COMMAND("perflog", CCMDPerfCheck, szErrorMessage);
|
||||
|
||||
ADD_COMMAND("newlog", CCMDNewLog, szErrorMessage);
|
||||
|
||||
if(0 != szErrorMessage)
|
||||
{
|
||||
ERRLOG0(g_Log, szErrorMessage);
|
||||
return false;
|
||||
};
|
||||
|
||||
return true;
|
||||
}
|
||||
47
Server/RylServerProject/RylUIDServer/RylUIDServerMain.cpp
Normal file
47
Server/RylServerProject/RylUIDServer/RylUIDServerMain.cpp
Normal file
@@ -0,0 +1,47 @@
|
||||
// RylUIDServer.cpp : Defines the entry point for the application.
|
||||
//
|
||||
#include "stdafx.h"
|
||||
#include "Resource.h"
|
||||
|
||||
#include <Thread/Lock.h> // CNamedMutex
|
||||
#include <Log/ServerLog.h>
|
||||
#include <Utility/Debug/ExceptionReport.h> // g_CExceptionReport
|
||||
|
||||
#include "RylUIDServer.h" // CRylUIDServerWindow
|
||||
|
||||
int WINAPI ExceptionUserFunc(TCHAR* szBuffer, const int nBufferSize)
|
||||
{
|
||||
SERLOG0(g_Log, "Flush log");
|
||||
SERLOG0(g_SessionLog, "Flush log");
|
||||
|
||||
return _snprintf(szBuffer, nBufferSize, "Userdata flush completed.");
|
||||
}
|
||||
|
||||
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
|
||||
{
|
||||
CNamedMutex Mutex("RowUIDServer", TRUE);
|
||||
|
||||
if(GetLastError() == ERROR_ALREADY_EXISTS)
|
||||
{
|
||||
ERRLOG0(g_Log, "UIDServer already operating now. please shutdown and restart");
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long dwExceptionFeatures = CExceptionReport::CATCH_EXCEPTION |
|
||||
CExceptionReport::USE_MINIDUMP | CExceptionReport::USE_REPORT;
|
||||
|
||||
CExceptionReport::GetInstance().Enable(dwExceptionFeatures);
|
||||
CExceptionReport::GetInstance().SetUserFunc(ExceptionUserFunc);
|
||||
|
||||
// MiniDumpWithFullMemory, MiniDumpNormal
|
||||
CExceptionReport::GetInstance().SetDumpLevel(MiniDumpNormal);
|
||||
|
||||
CRylUIDServer& UIDServer = CRylUIDServer::GetInstance();
|
||||
|
||||
if(UIDServer.Initialize(hInstance, "UID Server", lpCmdLine, IDI_MAIN, IDR_MENU))
|
||||
{
|
||||
UIDServer.ProcessMessage();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
72
Server/RylServerProject/RylUIDServer/RylUIDServerWindow.cpp
Normal file
72
Server/RylServerProject/RylUIDServer/RylUIDServerWindow.cpp
Normal file
@@ -0,0 +1,72 @@
|
||||
#include "stdafx.h"
|
||||
#include "Resource.h"
|
||||
#include "RylUIDServer.h"
|
||||
|
||||
#include <Log/ServerLog.h>
|
||||
#include <Utility/ServerAppFramework/MsgProc/MsgProc.h>
|
||||
#include <Utility/ServerAppFramework/ConsoleWindow/ConsoleWindow.h>
|
||||
#include <Utility/ServerAppFramework/ConsoleWindow/ConsoleCMDFactory.h>
|
||||
|
||||
class CProcessCOMMAND : public CMsgProc
|
||||
{
|
||||
public:
|
||||
|
||||
CProcessCOMMAND(CConsoleWindow& ConsoleWindow) : m_ConsoleWindow(ConsoleWindow) { }
|
||||
virtual ~CProcessCOMMAND() { }
|
||||
|
||||
virtual LRESULT operator () (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
char* szCommand = 0;
|
||||
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case ID_START_CONSOLE: m_ConsoleWindow.Initialize("RowUIDServer"); break;
|
||||
case ID_STOP_CONSOLE: m_ConsoleWindow.Destroy(); break;
|
||||
|
||||
case ID_STATUS: szCommand = "flush"; break;
|
||||
|
||||
case ID_CONNECTALL: szCommand = "dbconnect"; break;
|
||||
}
|
||||
|
||||
if(0 != szCommand)
|
||||
{
|
||||
m_ConsoleWindow.GetCMDProcess().Add(
|
||||
m_ConsoleWindow.GetConsoleCMDFactory().Create(szCommand, strlen(szCommand)));
|
||||
}
|
||||
|
||||
if(LOWORD(wParam) == ID_QUIT)
|
||||
{
|
||||
DETLOG0(g_Log, "Terminate UIDServer System Tray.");
|
||||
PostMessage(hWnd, WM_QUIT, 0, 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
CConsoleWindow& m_ConsoleWindow;
|
||||
};
|
||||
|
||||
|
||||
bool CRylUIDServer::InitializeMsgProc()
|
||||
{
|
||||
int nErrorCount = 0;
|
||||
|
||||
CMsgProcessMgr* lpMsgProcessMgr = GetMsgProcessMgr();
|
||||
if(0 != lpMsgProcessMgr)
|
||||
{
|
||||
if(GetConsoleWindow())
|
||||
{
|
||||
nErrorCount += lpMsgProcessMgr->Register(WM_COMMAND,
|
||||
new CProcessCOMMAND(*GetConsoleWindow())) ? 0 : 1;
|
||||
}
|
||||
|
||||
/*
|
||||
nErrorCount += lpMsgProcessMgr->Register(WM_RYLUID_AUTOSTART, new CProcessRYLUID_AUTOSTART) ? 0 : 1;
|
||||
nErrorCount += lpMsgProcessMgr->Register(WM_RYLUID_QUIT, new CProcessRYLUID_QUIT) ? 0 : 1;
|
||||
*/
|
||||
}
|
||||
|
||||
return (0 == nErrorCount);
|
||||
}
|
||||
221
Server/RylServerProject/RylUIDServer/SendAgentPacket.cpp
Normal file
221
Server/RylServerProject/RylUIDServer/SendAgentPacket.cpp
Normal file
@@ -0,0 +1,221 @@
|
||||
#include "stdafx.h"
|
||||
#include "SendAgentPacket.h"
|
||||
#include "UIDAgentDispatch.h"
|
||||
|
||||
#include <Log/ServerLog.h>
|
||||
#include <Network/Session/Session.h>
|
||||
#include <Network/Packet/PacketCommand.h>
|
||||
#include <Network/Packet/WrapPacket.h>
|
||||
#include <Network/Packet/PacketStruct/ServerInfo.h>
|
||||
#include <Network/Packet/PacketStruct/ServerPacket.h>
|
||||
|
||||
#include <Stream/Buffer/BufferFactory.h>
|
||||
|
||||
class CSendUIDAgentDispatch
|
||||
{
|
||||
public:
|
||||
|
||||
CSendUIDAgentDispatch(const void* lpBuffer, size_t nLength) : m_lpBuffer(lpBuffer), m_nLength(nLength) { }
|
||||
~CSendUIDAgentDispatch() { }
|
||||
|
||||
bool operator() (unsigned long dwGroup, CPacketDispatch& packetDispatch)
|
||||
{
|
||||
if(0 != m_lpBuffer)
|
||||
{
|
||||
CBuffer* lpBuffer = CREATE_BUFFER(
|
||||
packetDispatch.GetSession().GetPolicy().GetBufferFactory(), m_nLength);
|
||||
|
||||
if(0 != lpBuffer)
|
||||
{
|
||||
memcpy(lpBuffer->wr_ptr(), m_lpBuffer, m_nLength);
|
||||
lpBuffer->wr_ptr(m_nLength);
|
||||
|
||||
packetDispatch.GetSession().SendPending(lpBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
const void* m_lpBuffer;
|
||||
size_t m_nLength;
|
||||
};
|
||||
|
||||
|
||||
bool AgentSendPacket::SendUserKill(char Group, unsigned long UserID)
|
||||
{
|
||||
GET_MULTI_DISPATCH(lpAgentDispatch, Group,
|
||||
CUIDAgentDispatch, CUIDAgentDispatch::GetDispatchTable());
|
||||
|
||||
if(0 == lpAgentDispatch)
|
||||
{
|
||||
ERRLOG1(g_Log, "<EFBFBD><EFBFBD>:%d <20><><EFBFBD>Ἴ<EFBFBD><E1BCBC> <20><><EFBFBD>ϱ<EFBFBD> <20><><EFBFBD><EFBFBD>", Group);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
CSendStream& SendStream = lpAgentDispatch->GetSendStream();
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktUK));
|
||||
if(0 != lpBuffer)
|
||||
{
|
||||
PktUK* lpUK = reinterpret_cast<PktUK*>(lpBuffer);
|
||||
|
||||
lpUK->m_dwServerID = 0;
|
||||
lpUK->m_dwUserID = UserID;
|
||||
lpUK->m_dwCharID = 0;
|
||||
|
||||
return SendStream.WrapHeader(sizeof(PktUK), CmdUserKill, 0, 0);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AgentSendPacket::SendUpdateUIDTable(char AgentGroup, char Cmd, unsigned long UserID, unsigned long Flag,
|
||||
int PlayTime, unsigned long dwCRMIndex1,
|
||||
char BillingType, unsigned short usState, unsigned short usErrorCode)
|
||||
{
|
||||
GET_MULTI_DISPATCH(lpAgentDispatch, AgentGroup,
|
||||
CUIDAgentDispatch, CUIDAgentDispatch::GetDispatchTable());
|
||||
|
||||
if(0 == lpAgentDispatch)
|
||||
{
|
||||
ERRLOG1(g_Log, "<EFBFBD><EFBFBD>:%d <20><><EFBFBD>Ἴ<EFBFBD><E1BCBC> <20><><EFBFBD>ϱ<EFBFBD> <20><><EFBFBD><EFBFBD>", AgentGroup);
|
||||
return false;
|
||||
}
|
||||
|
||||
CSendStream& SendStream = lpAgentDispatch->GetSendStream();
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktUUTAck));
|
||||
if(0 != lpBuffer)
|
||||
{
|
||||
PktUUTAck* lpUUTAck = reinterpret_cast<PktUUTAck*>(lpBuffer);
|
||||
|
||||
lpUUTAck->m_cCmd = Cmd;
|
||||
lpUUTAck->m_dwUserID = UserID;
|
||||
lpUUTAck->m_dwFlag = Flag;
|
||||
lpUUTAck->m_nPlayTime = PlayTime;
|
||||
lpUUTAck->m_dwCRMIndex1 = dwCRMIndex1;
|
||||
lpUUTAck->m_cstrBillingType = BillingType;
|
||||
|
||||
return SendStream.WrapHeader(sizeof(PktUUTAck), CmdUpdateUIDTable, usState, usErrorCode);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool AgentSendPacket::SendHanBTN(char cAgentGroup, unsigned long dwUID,
|
||||
unsigned char cRemainMinute, unsigned char cBillingType)
|
||||
{
|
||||
GET_MULTI_DISPATCH(lpAgentDispatch, cAgentGroup,
|
||||
CUIDAgentDispatch, CUIDAgentDispatch::GetDispatchTable());
|
||||
|
||||
if(0 == lpAgentDispatch)
|
||||
{
|
||||
ERRLOG1(g_Log, "<EFBFBD><EFBFBD>:%d <20><><EFBFBD>Ἴ<EFBFBD><E1BCBC> <20><><EFBFBD>ϱ<EFBFBD> <20><><EFBFBD><EFBFBD>", cAgentGroup);
|
||||
}
|
||||
else
|
||||
{
|
||||
CSendStream& SendStream = lpAgentDispatch->GetSendStream();
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktBTN));
|
||||
|
||||
if(0 != lpBuffer)
|
||||
{
|
||||
PktBTN* lpPktBTN = reinterpret_cast<PktBTN*>(lpBuffer);
|
||||
|
||||
lpPktBTN->m_dwUserID = dwUID;
|
||||
lpPktBTN->m_dwCharID = 0;
|
||||
lpPktBTN->m_dwServerID = 0;
|
||||
lpPktBTN->m_cRemainMinute = cRemainMinute;
|
||||
lpPktBTN->m_cBillingType = cBillingType;
|
||||
|
||||
return SendStream.WrapHeader(sizeof(PktBTN), CmdBillingTimeoutNotify, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool AgentSendPacket::SendHanUnitedBTN(const char* szID, const char* szIP, const char* szMsg)
|
||||
{
|
||||
PktHanBTN pktHanBTN;
|
||||
memset(&pktHanBTN, 0, sizeof(PktHanBTN));
|
||||
|
||||
pktHanBTN.m_dwIP = inet_addr(szIP);
|
||||
|
||||
_snprintf(pktHanBTN.m_szAccount, PktUUT::MaxAccountLen, "%s", szID);
|
||||
pktHanBTN.m_szAccount[PktUUT::MaxAccountLen - 1] = 0;
|
||||
|
||||
_snprintf(pktHanBTN.m_szMsg, PktHanBTN::MAX_HAN_BTN, "%s", szMsg);
|
||||
pktHanBTN.m_szMsg[PktHanBTN::MAX_HAN_BTN - 1] = 0;
|
||||
|
||||
if(PacketWrap::WrapHeader(reinterpret_cast<char*>(&pktHanBTN),
|
||||
sizeof(PktHanBTN), CmdHanBTNWarning, 0, 0))
|
||||
{
|
||||
CUIDAgentDispatch::GetDispatchTable().Process(
|
||||
CSendUIDAgentDispatch(&pktHanBTN, sizeof(PktHanBTN)));
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AgentSendPacket::SendHanUnitedUserKill(const char* szID, const char* szIP)
|
||||
{
|
||||
PktHanUserKill pktHanUserKill;
|
||||
memset(&pktHanUserKill, 0, sizeof(PktHanUserKill));
|
||||
|
||||
pktHanUserKill.m_dwIP = inet_addr(szIP);
|
||||
|
||||
_snprintf(pktHanUserKill.m_szAccount, PktUUT::MaxAccountLen, "%s", szID);
|
||||
pktHanUserKill.m_szAccount[PktUUT::MaxAccountLen - 1] = 0;
|
||||
|
||||
if(PacketWrap::WrapHeader(reinterpret_cast<char*>(&pktHanUserKill),
|
||||
sizeof(pktHanUserKill), CmdHanBTNUserKill, 0, 0))
|
||||
{
|
||||
CUIDAgentDispatch::GetDispatchTable().Process(
|
||||
CSendUIDAgentDispatch(&pktHanUserKill, sizeof(pktHanUserKill)));
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AgentSendPacket::SendHanUnitedUserKill(unsigned long dwAgentGroup, const char* szID, const char* szIP)
|
||||
{
|
||||
GET_MULTI_DISPATCH(lpAgentDispatch, dwAgentGroup,
|
||||
CUIDAgentDispatch, CUIDAgentDispatch::GetDispatchTable());
|
||||
|
||||
if(0 == lpAgentDispatch)
|
||||
{
|
||||
ERRLOG1(g_Log, "<EFBFBD><EFBFBD>:%d <20><><EFBFBD>Ἴ<EFBFBD><E1BCBC> <20><><EFBFBD>ϱ<EFBFBD> <20><><EFBFBD><EFBFBD>", dwAgentGroup);
|
||||
return false;
|
||||
}
|
||||
|
||||
CSendStream& SendStream = lpAgentDispatch->GetSendStream();
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktHanUserKill));
|
||||
if(0 != lpBuffer)
|
||||
{
|
||||
PktHanUserKill* lpHanUserKill = reinterpret_cast<PktHanUserKill*>(lpBuffer);
|
||||
|
||||
if(0 != szIP)
|
||||
{
|
||||
lpHanUserKill->m_dwIP = inet_addr(szIP);
|
||||
}
|
||||
else
|
||||
{
|
||||
lpHanUserKill->m_dwIP = PktHanUserKill::DISCONN_ALL_IP;
|
||||
}
|
||||
|
||||
_snprintf(lpHanUserKill->m_szAccount, PktUUT::MaxAccountLen, "%s", szID);
|
||||
lpHanUserKill->m_szAccount[PktUUT::MaxAccountLen - 1] = 0;
|
||||
|
||||
return SendStream.WrapHeader(sizeof(PktHanUserKill), CmdHanBTNUserKill, 0, 0);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
25
Server/RylServerProject/RylUIDServer/SendAgentPacket.h
Normal file
25
Server/RylServerProject/RylUIDServer/SendAgentPacket.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef _SEND_AGENT_PACKET_H_
|
||||
#define _SEND_AGENT_PACKET_H_
|
||||
|
||||
#include <winsock2.h>
|
||||
#include <windows.h>
|
||||
|
||||
namespace AgentSendPacket
|
||||
{
|
||||
// Ư<><C6AF> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
bool SendUserKill(char Group, unsigned long UserID);
|
||||
bool SendUpdateUIDTable(char AgentGroup, char Cmd, unsigned long UserID, unsigned long Flag,
|
||||
int PlayTime, unsigned long dwCRMIndex1, char BillingType,
|
||||
unsigned short usState, unsigned short usErrorCode);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> Ÿ<>Ӿƿ<D3BE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
bool SendHanBTN(char cAgentGroup, unsigned long dwUID,
|
||||
unsigned char cRemainMinute, unsigned char cBillingType);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
bool SendHanUnitedBTN(const char* szID, const char* szIP, const char* szMsg);
|
||||
bool SendHanUnitedUserKill(const char* szID, const char* szIP);
|
||||
bool SendHanUnitedUserKill(unsigned long dwAgentGroup, const char* szID, const char* szIP);
|
||||
};
|
||||
|
||||
#endif
|
||||
88
Server/RylServerProject/RylUIDServer/Sync.h
Normal file
88
Server/RylServerProject/RylUIDServer/Sync.h
Normal file
@@ -0,0 +1,88 @@
|
||||
#pragma once
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʴ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Windows <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>.
|
||||
|
||||
namespace Nave { namespace Sync {
|
||||
/*
|
||||
class CTest : public CMTSync<CTest>
|
||||
{
|
||||
public:
|
||||
void Test()
|
||||
{
|
||||
CTSync Sync;
|
||||
}
|
||||
};
|
||||
*/
|
||||
class CSync
|
||||
{
|
||||
public:
|
||||
CSync(VOID)
|
||||
{
|
||||
InitializeCriticalSection(&mSync);
|
||||
}
|
||||
|
||||
~CSync(VOID)
|
||||
{
|
||||
DeleteCriticalSection(&mSync);
|
||||
}
|
||||
|
||||
inline VOID Enter(VOID)
|
||||
{
|
||||
EnterCriticalSection(&mSync);
|
||||
}
|
||||
|
||||
inline VOID Leave(VOID)
|
||||
{
|
||||
LeaveCriticalSection(&mSync);
|
||||
}
|
||||
|
||||
private:
|
||||
CRITICAL_SECTION mSync;
|
||||
};
|
||||
|
||||
class CSSync
|
||||
{
|
||||
public:
|
||||
CSSync(LPVOID lpVoid)
|
||||
{
|
||||
m_pThis = (CSync*)lpVoid;
|
||||
m_pThis->Enter();
|
||||
}
|
||||
|
||||
~CSSync(VOID)
|
||||
{
|
||||
if(m_pThis)
|
||||
m_pThis->Leave();
|
||||
}
|
||||
|
||||
protected:
|
||||
CSync *m_pThis;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class CMTSync
|
||||
{
|
||||
friend class CTSync;
|
||||
public:
|
||||
class CTSync
|
||||
{
|
||||
public:
|
||||
CTSync(VOID)
|
||||
{
|
||||
T::mSync.Enter();
|
||||
}
|
||||
|
||||
~CTSync(VOID)
|
||||
{
|
||||
T::mSync.Leave();
|
||||
}
|
||||
};
|
||||
|
||||
private:
|
||||
static CSync mSync;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
CSync CMTSync<T>::mSync;
|
||||
|
||||
}}
|
||||
235
Server/RylServerProject/RylUIDServer/UIDAgentDispatch.cpp
Normal file
235
Server/RylServerProject/RylUIDServer/UIDAgentDispatch.cpp
Normal file
@@ -0,0 +1,235 @@
|
||||
#include "stdafx.h"
|
||||
#include "UserIDTable.h"
|
||||
#include "UIDAgentDispatch.h"
|
||||
#include "SendAgentPacket.h"
|
||||
|
||||
#include <Log/ServerLog.h>
|
||||
#include <Network/Session/Session.h>
|
||||
#include <Network/Packet/PacketCommand.h>
|
||||
#include <Network/Packet/WrapPacket.h>
|
||||
#include <Network/Packet/PacketStruct/ServerInfo.h>
|
||||
#include <Network/Packet/PacketStruct/ServerPacket.h>
|
||||
|
||||
#include <DB/DBComponent.h>
|
||||
#include <Utility/Setup/ServerSetup.h>
|
||||
|
||||
|
||||
enum UIDServerConst
|
||||
{
|
||||
MAX_PACKET_DISPATCH_PER_PULSE = 30
|
||||
};
|
||||
|
||||
|
||||
CUIDAgentDispatch::CUIDAgentDispatch(CSession& Session)
|
||||
: CRylServerDispatch(Session, MAX_PACKET_DISPATCH_PER_PULSE),
|
||||
m_Group(-1), m_bDisconnected(true)
|
||||
{
|
||||
memset(&m_Address, 0, sizeof(IN_ADDR));
|
||||
|
||||
InitUnitNum();
|
||||
InitFailNum();
|
||||
InitSucceedNum();
|
||||
}
|
||||
|
||||
|
||||
bool CUIDAgentDispatch::DispatchPacket(PktBase* lpPktBase)
|
||||
{
|
||||
bool bResult = false;
|
||||
|
||||
switch(lpPktBase->GetCmd())
|
||||
{
|
||||
case CmdSysServerLogin:
|
||||
bResult = ParseServerLogin(static_cast<PktSL*>(lpPktBase));
|
||||
break;
|
||||
|
||||
case CmdSysServerLogout:
|
||||
bResult = ParseServerLogout(lpPktBase);
|
||||
break;
|
||||
|
||||
case CmdUpdateUIDTable:
|
||||
bResult = ParseUpdateUIDTable(static_cast<PktUUT*>(lpPktBase));
|
||||
break;
|
||||
|
||||
default:
|
||||
// <20><>Ŷ Command<6E><64> invaild<6C><64><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. invalid<69><64> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ٽ<EFBFBD> <20>˻<EFBFBD><CBBB>ؼ<EFBFBD> vaild<6C><64> <20><>ġ<EFBFBD><C4A1> ã<>Ƴ<EFBFBD><C6B3><EFBFBD>.
|
||||
LogErrorPacket("<EFBFBD><EFBFBD>Ŷ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ŷ Ŀ<>ǵ尡 <20>߸<EFBFBD><DFB8>Ǿ<EFBFBD><C7BE><EFBFBD><EFBFBD>ϴ<EFBFBD>.", lpPktBase->GetCmd());
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CUIDAgentDispatch::Connected()
|
||||
{
|
||||
DETLOG2(g_Log, "DP:0x%p/IP:%s/Servergroup connected", this,
|
||||
GetRemoteAddr().get_addr_string());
|
||||
}
|
||||
|
||||
void CUIDAgentDispatch::Disconnected()
|
||||
{
|
||||
if(!m_bDisconnected)
|
||||
{
|
||||
bool bResult = false;
|
||||
|
||||
switch(CServerSetup::GetInstance().GetBillingType())
|
||||
{
|
||||
case CServerSetup::GamaBilling:
|
||||
// <20>Ѱ<EFBFBD><D1B0><EFBFBD>
|
||||
bResult = ProcessDisconnectHan();
|
||||
break;
|
||||
|
||||
case CServerSetup::YouxiLandBilling:
|
||||
// <20><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>
|
||||
bResult = ProcessDisconnectYouxiLand();
|
||||
break;
|
||||
|
||||
case CServerSetup::ROWGlobalBilling:
|
||||
// ROW<4F><57><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bResult = ProcessDisconnectROWGlobal();
|
||||
break;
|
||||
|
||||
case CServerSetup::JapanBilling:
|
||||
// <20>Ϻ<EFBFBD>
|
||||
bResult = ProcessDisconnectJapan();
|
||||
break;
|
||||
|
||||
case CServerSetup::GammaniaBilling:
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD>Ͼ<EFBFBD>
|
||||
// bResult = ProcessDisconnectGammania();
|
||||
break;
|
||||
|
||||
case CServerSetup::GamaUnitedBilling:
|
||||
// <20>Ѱ<EFBFBD><D1B0><EFBFBD> <20><><EFBFBD>պ<EFBFBD><D5BA><EFBFBD>
|
||||
bResult = ProcessDisconnectHanUnited();
|
||||
break;
|
||||
|
||||
default:
|
||||
ERRLOG1(g_Log, "Unknown Server Type!!! %d", CServerSetup::GetInstance().GetBillingType());
|
||||
break;
|
||||
};
|
||||
|
||||
CUserIDTable::GetInstance().RemoveUserOfCurrentAgent(m_Group);
|
||||
m_bDisconnected = true;
|
||||
}
|
||||
|
||||
if (-1 != m_Group)
|
||||
{
|
||||
GetDispatchTable().RemoveDispatch(m_Group);
|
||||
}
|
||||
|
||||
DETLOG2(g_Log, "DP:0x%p/IP:%s/Servergroup disconnected", this,
|
||||
GetRemoteAddr().get_addr_string());
|
||||
}
|
||||
|
||||
|
||||
bool CUIDAgentDispatch::ParseServerLogin(PktSL* lpPktSL)
|
||||
{
|
||||
if(lpPktSL->GetLen() != sizeof(PktSL))
|
||||
{
|
||||
// <20><>Ŷ <20><><EFBFBD><EFBFBD> <20>ٸ<EFBFBD><D9B8><EFBFBD> <20><><EFBFBD><EFBFBD>!
|
||||
return false;
|
||||
}
|
||||
|
||||
SERVER_ID ServerID = {0,};
|
||||
ServerID.dwID = lpPktSL->m_dwServerID;
|
||||
|
||||
m_Group = ServerID.sID.Group;
|
||||
m_Address = lpPktSL->m_Address;
|
||||
|
||||
if(!GetDispatchTable().SetDispatch(m_Group, this))
|
||||
{
|
||||
ERRLOG3(g_Log, "DP:0x%p/IP:%s/Duplicated servergroup login : %d",
|
||||
this, GetRemoteAddr().get_addr_string(), m_Group);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
m_bDisconnected = false;
|
||||
|
||||
// Ű<><C5B0> DB <20>ʱ<EFBFBD>ȭ
|
||||
/* if(CServerSetup::GetInstance().IsHangame())
|
||||
{
|
||||
unsigned long Result = 0;
|
||||
if(false == DBComponent::BillingDB::USPDisConnectLogOut(CDBSingleObject::GetInstance(), m_Group, &Result))
|
||||
{
|
||||
SERLOG2(g_Log, "%d <20><EFBFBD> <20>αƿ<D7BE> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:0x%08x", m_Group, Result);
|
||||
return false;
|
||||
}
|
||||
|
||||
SERLOG1(g_Log, "%d <20><EFBFBD> USPDisConnectLogOut ȣ<><C8A3> <20><><EFBFBD><EFBFBD>", m_Group);
|
||||
|
||||
if(false == DBComponent::BillingDB::USPServer_Start(CDBSingleObject::GetInstance(), m_Group, &Result))
|
||||
{
|
||||
SERLOG2(g_Log, "%d <20><EFBFBD> <20>αƿ<D7BE> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:0x%08x", m_Group, Result);
|
||||
return false;
|
||||
}
|
||||
|
||||
SERLOG1(g_Log, "%d <20><EFBFBD> USPServer_Start ȣ<><C8A3> <20><><EFBFBD><EFBFBD>", m_Group);
|
||||
}
|
||||
*/
|
||||
|
||||
DETLOG3(g_Log, "DP:0x%p/IP:%s/Servergroup login : %d",
|
||||
this, GetRemoteAddr().get_addr_string(), m_Group);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CUIDAgentDispatch::ParseServerLogout(PktBase* lpPktBase)
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD> <20>αƿ<D7BE> <20><>Ŷ<EFBFBD><C5B6> <20>Ҵ<DEBE>. <20>׳<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ֱ⸸ <20>ϸ<EFBFBD> <20>ȴ<EFBFBD>
|
||||
char* lpBuffer = m_SendStream.GetBuffer(sizeof(PktBase));
|
||||
|
||||
if(0 != lpBuffer)
|
||||
{
|
||||
m_SendStream.WrapHeader(sizeof(PktBase), CmdSysServerLogout, 0, 0);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CUIDAgentDispatch::ParseUpdateUIDTable(PktUUT* lpPktUUT)
|
||||
{
|
||||
bool bResult = false;
|
||||
|
||||
switch(CServerSetup::GetInstance().GetBillingType())
|
||||
{
|
||||
case CServerSetup::GamaBilling:
|
||||
// <20>Ѱ<EFBFBD><D1B0><EFBFBD>
|
||||
bResult = ProcessBillingHan(lpPktUUT);
|
||||
break;
|
||||
|
||||
case CServerSetup::YouxiLandBilling:
|
||||
// <20><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>
|
||||
bResult = ProcessBillingYouxiLand(lpPktUUT);
|
||||
break;
|
||||
|
||||
case CServerSetup::ROWGlobalBilling:
|
||||
// ROW<4F><57><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bResult = ProcessBillingROWGlobal(lpPktUUT);
|
||||
break;
|
||||
|
||||
case CServerSetup::JapanBilling:
|
||||
// <20>Ϻ<EFBFBD>
|
||||
bResult = ProcessBillingJapan(lpPktUUT);
|
||||
break;
|
||||
|
||||
case CServerSetup::GammaniaBilling:
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD>Ͼ<EFBFBD>
|
||||
// bResult = ProcessBillingGammania(lpPktUUT);
|
||||
break;
|
||||
|
||||
case CServerSetup::GamaUnitedBilling:
|
||||
// <20>Ѱ<EFBFBD><D1B0><EFBFBD> <20><><EFBFBD>պ<EFBFBD><D5BA><EFBFBD>
|
||||
bResult = ProcessBillingHanUnited(lpPktUUT);
|
||||
break;
|
||||
|
||||
default:
|
||||
ERRLOG1(g_Log, "Unknown Server Type!!! %d", CServerSetup::GetInstance().GetBillingType());
|
||||
break;
|
||||
};
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
85
Server/RylServerProject/RylUIDServer/UIDAgentDispatch.h
Normal file
85
Server/RylServerProject/RylUIDServer/UIDAgentDispatch.h
Normal file
@@ -0,0 +1,85 @@
|
||||
#ifndef _CUID_AGENT_DISPATCH_H_
|
||||
#define _CUID_AGENT_DISPATCH_H_
|
||||
|
||||
#include <Network/Dispatch/RylServerDispatch.h>
|
||||
#include <Network/Dispatch/MultiDispatchStorage.h>
|
||||
|
||||
// <20><>Ŷ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
struct PktSL;
|
||||
struct PktUUT;
|
||||
struct PktUK;
|
||||
struct PktBase;
|
||||
|
||||
class CUserNode;
|
||||
|
||||
class CUIDAgentDispatch : public CRylServerDispatch
|
||||
{
|
||||
public:
|
||||
|
||||
static CMultiDispatch& GetDispatchTable()
|
||||
{
|
||||
static CMultiDispatch multiDispatchTable;
|
||||
return multiDispatchTable;
|
||||
}
|
||||
|
||||
CUIDAgentDispatch(CSession& Session);
|
||||
|
||||
virtual void Connected();
|
||||
virtual void Disconnected();
|
||||
|
||||
IN_ADDR& GetAddress(void) { return m_Address; }
|
||||
char GetGroup(void) { return m_Group; }
|
||||
|
||||
void InitUnitNum(void) { m_nUnitNum = 0; }
|
||||
int GetUnitNum(void) const { return m_nUnitNum; }
|
||||
int IncreaseUnitNum(void) { return ++m_nUnitNum; }
|
||||
int DecreaseUnitNum(void) { return --m_nUnitNum; }
|
||||
|
||||
void InitSucceedNum(void) { m_nSucceedNum = 0; }
|
||||
|
||||
int GetSucceedNum(void) const { return m_nSucceedNum; }
|
||||
int IncreaseSucceedNum(void) { return ++m_nSucceedNum; }
|
||||
int DecreaseSucceedNum(void) { return --m_nSucceedNum; }
|
||||
|
||||
void InitFailNum(void) { m_nFailNum = 0; }
|
||||
|
||||
int GetFailNum(void) const { return m_nFailNum; }
|
||||
int IncreaseFailNum(void) { return ++m_nFailNum; }
|
||||
int DecreaseFailNum(void) { return --m_nFailNum; }
|
||||
|
||||
private:
|
||||
|
||||
bool ProcessBillingHan(PktUUT* lpPktUUT);
|
||||
bool ProcessBillingYouxiLand(PktUUT* lpPktUUT);
|
||||
// bool ProcessBillingGammania(PktUUT* lpPktUUT);
|
||||
bool ProcessBillingROWGlobal(PktUUT* lpPktUUT);
|
||||
bool ProcessBillingJapan(PktUUT* lpPktUUT);
|
||||
bool ProcessBillingHanUnited(PktUUT* lpPktUUT);
|
||||
|
||||
bool ProcessDisconnectHan();
|
||||
bool ProcessDisconnectYouxiLand();
|
||||
// bool ProcessDisconnectGammania();
|
||||
bool ProcessDisconnectROWGlobal();
|
||||
bool ProcessDisconnectJapan();
|
||||
bool ProcessDisconnectHanUnited();
|
||||
|
||||
virtual bool DispatchPacket(PktBase* lpPktBase);
|
||||
|
||||
// Packet Dispatch Functions
|
||||
bool ParseServerLogin(PktSL* lpPktSL);
|
||||
bool ParseServerLogout(PktBase* lpPktBase);
|
||||
bool ParseUpdateUIDTable(PktUUT* lpPktUUT);
|
||||
|
||||
// Send Functions
|
||||
bool SendUserKill(char Group, unsigned long UserID);
|
||||
|
||||
IN_ADDR m_Address;
|
||||
char m_Group;
|
||||
bool m_bDisconnected;
|
||||
|
||||
int m_nUnitNum;
|
||||
int m_nSucceedNum;
|
||||
int m_nFailNum;
|
||||
};
|
||||
|
||||
#endif
|
||||
105
Server/RylServerProject/RylUIDServer/UserIDTable.cpp
Normal file
105
Server/RylServerProject/RylUIDServer/UserIDTable.cpp
Normal file
@@ -0,0 +1,105 @@
|
||||
#include "stdAfx.h"
|
||||
#include <Log/ServerLog.h>
|
||||
#include "UserIDTable.h"
|
||||
|
||||
CUserNode::CUserNode(unsigned long dwUserID, unsigned long dwSessionID,
|
||||
unsigned long dwCharID, unsigned char cGroup, unsigned char cState)
|
||||
: m_dwUserID(dwUserID), m_dwSessionID(dwSessionID),
|
||||
m_dwCharID(dwCharID), m_cAgentGroup(cGroup), m_cState(cState)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
CUserNode::~CUserNode()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CUserNode::InitUserNode(unsigned long dwUserID, unsigned long dwSessionID,
|
||||
unsigned long dwCharID, unsigned char cGroup, unsigned char cState)
|
||||
{
|
||||
m_cAgentGroup = cGroup;
|
||||
m_cState = cState;
|
||||
m_dwSessionID = dwSessionID;
|
||||
m_dwUserID = dwUserID;
|
||||
m_dwCharID = dwCharID;
|
||||
}
|
||||
|
||||
|
||||
CUserIDTable& CUserIDTable::GetInstance()
|
||||
{
|
||||
static CUserIDTable userIDTable;
|
||||
return userIDTable;
|
||||
}
|
||||
|
||||
|
||||
CUserIDTable::CUserIDTable()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CUserIDTable::~CUserIDTable()
|
||||
{
|
||||
m_UIDTable.clear();
|
||||
}
|
||||
|
||||
|
||||
BOOL CUserIDTable::Insert(unsigned long dwUserID, const CUserNode& Node)
|
||||
{
|
||||
if(m_UIDTable.insert(std::make_pair(dwUserID, Node)).second)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
SERLOG1(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(0x%08x)<29><> <20><><EFBFBD>̺<EFBFBD><CCBA><EFBFBD> <20>ִµ<D6B4> <20><><EFBFBD><EFBFBD>", dwUserID);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
BOOL CUserIDTable::Erase(unsigned long dwUserID)
|
||||
{
|
||||
UIDTable::iterator itr = m_UIDTable.find(dwUserID);
|
||||
if(itr != m_UIDTable.end())
|
||||
{
|
||||
m_UIDTable.erase(itr);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
CUserNode* CUserIDTable::Find(unsigned long dwUserID)
|
||||
{
|
||||
UIDTable::iterator itr = m_UIDTable.find(dwUserID);
|
||||
return (itr != m_UIDTable.end()) ? (&itr->second) : 0;
|
||||
}
|
||||
|
||||
|
||||
int CUserIDTable::RemoveUserOfCurrentAgent(char Group)
|
||||
{
|
||||
int nNum = 0;
|
||||
INFLOG1(g_Log, "<EFBFBD><EFBFBD>(%d)<29><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>", Group);
|
||||
|
||||
UIDTable::iterator pos = m_UIDTable.begin();
|
||||
UIDTable::iterator end = m_UIDTable.end();
|
||||
|
||||
for(; pos != end; )
|
||||
{
|
||||
CUserNode& node = pos->second;
|
||||
|
||||
if(node.GetAgentGroup() == Group)
|
||||
{
|
||||
pos = m_UIDTable.erase(pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
++pos;
|
||||
}
|
||||
}
|
||||
|
||||
INFLOG2(g_Log, "<EFBFBD><EFBFBD>(%d)<29><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> %d", Group, nNum);
|
||||
return nNum;
|
||||
}
|
||||
|
||||
60
Server/RylServerProject/RylUIDServer/UserIDTable.h
Normal file
60
Server/RylServerProject/RylUIDServer/UserIDTable.h
Normal file
@@ -0,0 +1,60 @@
|
||||
#ifndef _UID_USER_ID_TABLE_H_
|
||||
#define _UID_USER_ID_TABLE_H_
|
||||
|
||||
/*
|
||||
<EFBFBD><EFBFBD><EFBFBD>߿<EFBFBD> DB<44><42> <20><> <20><> <20>κ<EFBFBD><CEBA>̴<EFBFBD>. <20>̰<EFBFBD><CCB0><EFBFBD> <20>ӽ÷γ<C3B7><CEB3><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
||||
*/
|
||||
|
||||
class CUserNode
|
||||
{
|
||||
private:
|
||||
|
||||
unsigned long m_dwSessionID;
|
||||
unsigned long m_dwUserID;
|
||||
unsigned long m_dwCharID;
|
||||
|
||||
unsigned char m_cAgentGroup;
|
||||
unsigned char m_cState;
|
||||
|
||||
public:
|
||||
|
||||
CUserNode(unsigned long dwUserID, unsigned long dwSessionID,
|
||||
unsigned long dwCharID, unsigned char cGroup, unsigned char cState);
|
||||
~CUserNode();
|
||||
|
||||
void InitUserNode(unsigned long dwUserID, unsigned long dwSessionID,
|
||||
unsigned long dwCharID, unsigned char cGroup, unsigned char cState);
|
||||
|
||||
unsigned char GetAgentGroup(void) const { return m_cAgentGroup; }
|
||||
unsigned char GetState(void) const { return m_cState; }
|
||||
|
||||
unsigned long GetSessionID(void) const { return m_dwSessionID; }
|
||||
unsigned long GetUID(void) const { return m_dwUserID; }
|
||||
unsigned long GetCID(void) const { return m_dwCharID; }
|
||||
};
|
||||
|
||||
|
||||
class CUserIDTable
|
||||
{
|
||||
public:
|
||||
|
||||
static CUserIDTable& GetInstance();
|
||||
|
||||
// interface
|
||||
BOOL Insert(unsigned long dwUserID, const CUserNode& Node);
|
||||
BOOL Erase(unsigned long dwUserID);
|
||||
CUserNode* Find(unsigned long dwUserID);
|
||||
|
||||
int RemoveUserOfCurrentAgent(char Group);
|
||||
|
||||
private:
|
||||
|
||||
CUserIDTable();
|
||||
~CUserIDTable();
|
||||
|
||||
typedef std::map<unsigned long, CUserNode> UIDTable;
|
||||
UIDTable m_UIDTable;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
8
Server/RylServerProject/RylUIDServer/stdafx.cpp
Normal file
8
Server/RylServerProject/RylUIDServer/stdafx.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// RylLoginServer.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
// TODO: reference any additional headers you need in STDAFX.H
|
||||
// and not in this file
|
||||
80
Server/RylServerProject/RylUIDServer/stdafx.h
Normal file
80
Server/RylServerProject/RylUIDServer/stdafx.h
Normal file
@@ -0,0 +1,80 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
|
||||
#pragma warning(disable:4800)
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD>˿<EFBFBD> <20><><EFBFBD>ǵ<EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (void*)0 <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>.
|
||||
#ifdef _DEBUG
|
||||
#define PERFORMANCE_CHECK(x) x
|
||||
#else
|
||||
#define PERFORMANCE_CHECK(x) x
|
||||
#endif
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define DEBUG_CRT_MEMORY(x) x
|
||||
#else
|
||||
#define DEBUG_CRT_MEMORY(x) (void*)0
|
||||
#endif
|
||||
|
||||
// Windows Header Files:
|
||||
#include <windows.h>
|
||||
// C RunTime Header Files
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include <memory.h>
|
||||
#include <tchar.h>
|
||||
|
||||
// TODO: reference additional headers your program requires here
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#include <winsock2.h>
|
||||
#include <mswsock.h>
|
||||
#include <iphlpapi.h> // for IP Help functions, that gets local IP address
|
||||
#include <ws2tcpip.h> // tcp/ip specific options
|
||||
#include <wsipx.h> // for IPX/SPX
|
||||
#include <wsnwlink.h>
|
||||
|
||||
// DB<44><42><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#include <msdasc.h> // OLE DB Service Component header
|
||||
#include <msdaguid.h> // OLE DB Root Enumerator
|
||||
#include <msdasql.h> // MSDASQL - Default provider
|
||||
#include <sqloledb.h> // MS SQL
|
||||
|
||||
// <20>⺻ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
#include <shellapi.h>
|
||||
#include <tchar.h>
|
||||
|
||||
// C <20>Լ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#include <cassert>
|
||||
#include <ctime>
|
||||
#include <cmath>
|
||||
#include <cstdio>
|
||||
#include <cctype>
|
||||
#include <cstring>
|
||||
#include <cstdarg>
|
||||
#include <cstddef>
|
||||
#include <cstdlib>
|
||||
|
||||
// STL <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#include <new>
|
||||
#include <set>
|
||||
#include <map>
|
||||
#include <hash_map>
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <string>
|
||||
#include <limits>
|
||||
#include <bitset>
|
||||
#include <complex>
|
||||
|
||||
#include <algorithm>
|
||||
#include <numeric>
|
||||
#include <utility>
|
||||
#include <functional>
|
||||
Reference in New Issue
Block a user