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>
57 lines
1.4 KiB
C++
57 lines
1.4 KiB
C++
#include "Global.h"
|
|
#include "DBcomponent.h"
|
|
#include "Nave/NFStringUtil.h"
|
|
|
|
namespace DBComponent
|
|
{
|
|
bool Test(NaveServer::NFDBComponent& DBComponent)
|
|
{
|
|
/*
|
|
char szQuery[NaveServer::NFDBComponent::QUERY_BUFFER_LEN];
|
|
|
|
if (_snprintf(szQuery, NaveServer::NFDBComponentQUERY_BUFFER_LEN - 1, "InsertUser %d, %d",
|
|
UserID_In, cOldServerGroupID))
|
|
{
|
|
if (DBComponent.ExecuteQuery(szQuery))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
*/
|
|
return false;
|
|
}
|
|
|
|
bool CheckAuthCode(NaveServer::NFDBComponent& DBComponent, const char* pCode, const char* pIP)
|
|
{
|
|
WCHAR szQuery[NaveServer::NFDBComponent::QUERY_BUFFER_LEN];
|
|
|
|
if (_snwprintf(szQuery, NaveServer::NFDBComponent::QUERY_BUFFER_LEN - 1,
|
|
L"AuthCode '%s', '%s'", Nave::ToUnicode(pCode).c_str(), Nave::ToUnicode(pIP).c_str()))
|
|
{
|
|
if (DBComponent.ExecuteQuery(szQuery))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
bool AddItemLog(NaveServer::NFDBComponent& DBComponent, unsigned long CreateID, unsigned long UID, unsigned long CID, unsigned short ItemPrototypeID, unsigned short Amount)
|
|
{
|
|
WCHAR szQuery[NaveServer::NFDBComponent::QUERY_BUFFER_LEN];
|
|
|
|
if (_snwprintf(szQuery, NaveServer::NFDBComponent::QUERY_BUFFER_LEN - 1,
|
|
L"INSERT INTO [ItemLog] (CreateID, UID, CID, ItemPrototypeID, Amount) VALUES (%d, %d, %d, %d, %d)",
|
|
CreateID, UID, CID, ItemPrototypeID, Amount))
|
|
{
|
|
if (DBComponent.ExecuteQuery(szQuery))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
} |