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>
50 lines
1.1 KiB
C++
50 lines
1.1 KiB
C++
#include <stdio.h>
|
|
#include "NFDBComponent.h"
|
|
|
|
namespace NaveServer {
|
|
|
|
NFDBComponent::NFDBComponent(void)
|
|
{
|
|
|
|
}
|
|
|
|
NFDBComponent::~NFDBComponent()
|
|
{
|
|
}
|
|
|
|
bool NFDBComponent::Connect(LPCWSTR szDBServerName, LPCWSTR szDBName,
|
|
LPCWSTR szDBAccount, LPCWSTR szDBPass,
|
|
NFOleDB::ConnType connType)
|
|
{
|
|
swprintf(m_LastMessage, L"DB¿¡ ·Î±×ÀÎÇÕ´Ï´Ù : %s, DB : %s, Account : %s, Password : %s", szDBServerName, szDBName, szDBAccount, szDBPass);
|
|
|
|
if (!ConnectSQLServer(szDBServerName, szDBName, szDBAccount, szDBPass, connType))
|
|
{
|
|
swprintf(m_LastMessage, L"DB Connect failed : %s", GetErrorString());
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
|
|
bool NFDBComponent::Select(const WCHAR *Query_In, void** lpLoginTable_Out,
|
|
int Size_In, int StartNum_In, int RowNum_In, int *GetRowNum_Out)
|
|
{
|
|
if (StartNum_In == 0 && !ExecuteQuery(Query_In))
|
|
{
|
|
swprintf(m_LastMessage, L"Execute DB Query failed : %s", GetErrorString());
|
|
}
|
|
else if (!GetData((void **)lpLoginTable_Out, Size_In, RowNum_In, GetRowNum_Out))
|
|
{
|
|
swprintf(m_LastMessage, L"Get DBdata failed : %s", GetErrorString());
|
|
}
|
|
else
|
|
{
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
} |