From 83353086bee03ee300dc240a34dbe370ae18bf8e Mon Sep 17 00:00:00 2001 From: Maru Date: Mon, 30 Oct 2017 01:17:49 -0200 Subject: [PATCH] Small acc creation fixes; --- src/servers/Server_REST/PlayerMinimal.cpp | 2 +- src/servers/Server_REST/SapphireAPI.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/servers/Server_REST/PlayerMinimal.cpp b/src/servers/Server_REST/PlayerMinimal.cpp index f7fc0d74..76292545 100644 --- a/src/servers/Server_REST/PlayerMinimal.cpp +++ b/src/servers/Server_REST/PlayerMinimal.cpp @@ -362,7 +362,7 @@ namespace Core { uint64_t PlayerMinimal::getNextUId64() const { - g_charaDb.execute( std::string( "INSERT INTO uniqueiddata( IdName ) VALUES( 'NOT_SET' );" ) ); + g_charaDb.directExecute( std::string( "INSERT INTO uniqueiddata( IdName ) VALUES( 'NOT_SET' );" ) ); auto res = g_charaDb.query( "SELECT LAST_INSERT_ID();" ); if( !res ) diff --git a/src/servers/Server_REST/SapphireAPI.cpp b/src/servers/Server_REST/SapphireAPI.cpp index 707f917a..d3181696 100644 --- a/src/servers/Server_REST/SapphireAPI.cpp +++ b/src/servers/Server_REST/SapphireAPI.cpp @@ -88,7 +88,7 @@ bool Core::Network::SapphireAPI::createAccount( const std::string& username, con // get account from login name auto pQR = g_charaDb.query( "SELECT account_id FROM accounts WHERE account_name = '" + username + "';" ); // found? - if( !pQR->next() ) + if( pQR->next() ) return false; // we are clear and can create a new account @@ -99,7 +99,7 @@ bool Core::Network::SapphireAPI::createAccount( const std::string& username, con uint32_t accountId = pQR->getUInt( 1 ) + 1; // store the account to the db - g_charaDb.execute( "INSERT INTO accounts (account_Id, account_name, account_pass, account_created) VALUE( " + + g_charaDb.directExecute( "INSERT INTO accounts (account_Id, account_name, account_pass, account_created) VALUE( " + std::to_string( accountId ) + ", '" + username + "', '" + pass + "', " +