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:
67
Server/AdminTool/AdminToolLibrary/dbcomponent/BillingDB.cpp
Normal file
67
Server/AdminTool/AdminToolLibrary/dbcomponent/BillingDB.cpp
Normal file
@@ -0,0 +1,67 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "BillingDB.h"
|
||||
#include <Log/ServerLog.h>
|
||||
|
||||
bool CBillingDB::CheckLogin(unsigned long dwServerGroup, unsigned long dwUID)
|
||||
{
|
||||
// edith 2009.08.14 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><D7BC><EFBFBD> (ROW_Activity DB<44><42><EFBFBD><EFBFBD>)
|
||||
char szQuery[MAX_QUERY_LENGTH];
|
||||
_snprintf(szQuery, MAX_QUERY_LENGTH,
|
||||
"SELECT UID FROM TblCurrentUser WHERE UID = %d AND tinyServerID = %d",
|
||||
dwUID, dwServerGroup);
|
||||
|
||||
unsigned long dwGetUID = 0;
|
||||
|
||||
if (true == ExecuteQueryGetData(szQuery, &dwGetUID))
|
||||
{
|
||||
if(0 == dwGetUID)
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD> <20><>.
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned long CBillingDB::GetUIDFromAccount(char* szAccountName)
|
||||
{
|
||||
// edith 2009.08.14 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><D7BC><EFBFBD> (ROW_Activity DB<44><42><EFBFBD><EFBFBD>)
|
||||
char szQuery[MAX_QUERY_LENGTH];
|
||||
_snprintf(szQuery, MAX_QUERY_LENGTH,
|
||||
"SELECT TOP 1 UID FROM TblCurrentUser WHERE strClientID = '%s'", szAccountName);
|
||||
// "SELECT TOP 1 UID FROM TblCurrentUser_log WHERE strClientID = '%s'", szAccountName);
|
||||
|
||||
unsigned long dwUID = 0;
|
||||
|
||||
if (false == ExecuteQueryGetData(szQuery, &dwUID))
|
||||
{
|
||||
ERRLOG2(g_Log, "UID<EFBFBD><EFBFBD> <20><><EFBFBD>µ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>. Account: %s, Err: %s", szAccountName, GetErrorString());
|
||||
return 0;
|
||||
}
|
||||
|
||||
return dwUID;
|
||||
}
|
||||
|
||||
bool CBillingDB::GetAccountFromUID(unsigned long dwUID, void* lpGetData)
|
||||
{
|
||||
// edith 2009.08.14 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><D7BC><EFBFBD> (ROW_Activity DB<44><42><EFBFBD><EFBFBD>)
|
||||
char szQuery[MAX_QUERY_LENGTH];
|
||||
_snprintf(szQuery, MAX_QUERY_LENGTH,
|
||||
"SELECT TOP 1 strClientID FROM TblCurrentUser WHERE UID = %u", dwUID);
|
||||
// "SELECT TOP 1 strClientID FROM TblCurrentUser_log WHERE UID = %u", dwUID);
|
||||
|
||||
if (false == ExecuteQueryGetData(szQuery, lpGetData))
|
||||
{
|
||||
ERRLOG2(g_Log, "Account<EFBFBD><EFBFBD> <20><><EFBFBD>µ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>. UID: %u, Err: %s", dwUID, GetErrorString());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user