#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; } }