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:
79
Server/AdminTool/AdminToolLibrary/dbcomponent/AuthDB.cpp
Normal file
79
Server/AdminTool/AdminToolLibrary/dbcomponent/AuthDB.cpp
Normal file
@@ -0,0 +1,79 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "AuthDB.h"
|
||||
#include "../Parser/ServerInfo.h"
|
||||
#include <Log/ServerLog.h>
|
||||
#include <Network/Protocol/Ryl_AdminMgrProtocol.h>
|
||||
|
||||
|
||||
unsigned long CAuthDB::GetUIDFromAccount(char* szAccountName)
|
||||
{
|
||||
const char* szNation = CServerInfo::GetInstance().GetValue("NATION");
|
||||
if (NULL == szNation)
|
||||
{
|
||||
ERRLOG0(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ÿ<><C5B8><EFBFBD><EFBFBD> <20><><EFBFBD>µ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
char szQuery[MAX_QUERY_LENGTH];
|
||||
if (0 == strcmp("KOREA", szNation))
|
||||
{
|
||||
_snprintf(szQuery, MAX_QUERY_LENGTH,
|
||||
"SELECT uid, strID FROM TblRylUserInfo WHERE strID = '%s'", szAccountName);
|
||||
}
|
||||
else
|
||||
{
|
||||
_snprintf(szQuery, MAX_QUERY_LENGTH,
|
||||
"EXEC dbo.sp_SearchUserAccount NULL, '%s'", szAccountName);
|
||||
}
|
||||
|
||||
unsigned long dwUID = 0;
|
||||
|
||||
const int nBufferSize = sizeof(int) + PktAdminMgr::MAX_ACCOUNT;
|
||||
char szBuffer[nBufferSize];
|
||||
ZeroMemory(szBuffer, nBufferSize);
|
||||
|
||||
if (false == ExecuteQueryGetData(szQuery, szBuffer))
|
||||
{
|
||||
ERRLOG2(g_Log, "UID<EFBFBD><EFBFBD> <20><><EFBFBD>µ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>. Account: %s, Err: %s", szAccountName, GetErrorString());
|
||||
return 0;
|
||||
}
|
||||
|
||||
memcpy(&dwUID, szBuffer, sizeof(unsigned int));
|
||||
return dwUID;
|
||||
}
|
||||
|
||||
bool CAuthDB::GetAccountFromUID(unsigned long dwUID, void* lpGetData)
|
||||
{
|
||||
const char* szNation = CServerInfo::GetInstance().GetValue("NATION");
|
||||
if (NULL == szNation)
|
||||
{
|
||||
ERRLOG0(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ÿ<><C5B8><EFBFBD><EFBFBD> <20><><EFBFBD>µ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
char szQuery[MAX_QUERY_LENGTH];
|
||||
if (0 == strcmp("KOREA", szNation))
|
||||
{
|
||||
_snprintf(szQuery, MAX_QUERY_LENGTH,
|
||||
"SELECT uid, strID FROM TblRylUserInfo WHERE uid = %u", dwUID);
|
||||
}
|
||||
else
|
||||
{
|
||||
_snprintf(szQuery, MAX_QUERY_LENGTH,
|
||||
"EXEC dbo.sp_SearchUserAccount %u, NULL", dwUID);
|
||||
}
|
||||
|
||||
const int nBufferSize = sizeof(int) + PktAdminMgr::MAX_ACCOUNT;
|
||||
char szBuffer[nBufferSize];
|
||||
ZeroMemory(szBuffer, nBufferSize);
|
||||
|
||||
if (true == ExecuteQueryGetData(szQuery, szBuffer))
|
||||
{
|
||||
memcpy(lpGetData, szBuffer + sizeof(int), PktAdminMgr::MAX_ACCOUNT);
|
||||
return true;
|
||||
}
|
||||
|
||||
ERRLOG2(g_Log, "Account<EFBFBD><EFBFBD> <20><><EFBFBD>µ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>. UID: %u, Err: %s", dwUID, GetErrorString());
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user