1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-25 05:57:45 +00:00

Merge pull request #161 from itsMaru/SQL_REWRITE_OWN

Small acc creation fixes;
This commit is contained in:
Mordred 2017-10-30 22:06:51 +01:00 committed by GitHub
commit c41353cf4f
2 changed files with 3 additions and 3 deletions

View file

@ -362,7 +362,7 @@ namespace Core {
uint64_t PlayerMinimal::getNextUId64() const 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();" ); auto res = g_charaDb.query( "SELECT LAST_INSERT_ID();" );
if( !res ) if( !res )

View file

@ -88,7 +88,7 @@ bool Core::Network::SapphireAPI::createAccount( const std::string& username, con
// get account from login name // get account from login name
auto pQR = g_charaDb.query( "SELECT account_id FROM accounts WHERE account_name = '" + username + "';" ); auto pQR = g_charaDb.query( "SELECT account_id FROM accounts WHERE account_name = '" + username + "';" );
// found? // found?
if( !pQR->next() ) if( pQR->next() )
return false; return false;
// we are clear and can create a new account // 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; uint32_t accountId = pQR->getUInt( 1 ) + 1;
// store the account to the db // 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 ) + ", '" + std::to_string( accountId ) + ", '" +
username + "', '" + username + "', '" +
pass + "', " + pass + "', " +