From e1ee0c6843d2eb29da3085bd222ed1faa2139e2c Mon Sep 17 00:00:00 2001 From: NotAdam Date: Sun, 17 Mar 2019 21:07:00 +1100 Subject: [PATCH] minor consistency/code style fixes in sapphireapi --- src/api/SapphireAPI.cpp | 21 +++++++-------------- src/api/SapphireAPI.h | 6 +++--- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/src/api/SapphireAPI.cpp b/src/api/SapphireAPI.cpp index 25bd3f06..45f39a76 100644 --- a/src/api/SapphireAPI.cpp +++ b/src/api/SapphireAPI.cpp @@ -10,15 +10,8 @@ #include -Sapphire::Network::SapphireAPI::SapphireAPI() -{ - -} - -Sapphire::Network::SapphireAPI::~SapphireAPI() -{ - -} +Sapphire::Network::SapphireAPI::SapphireAPI() = default; +Sapphire::Network::SapphireAPI::~SapphireAPI() = default; bool Sapphire::Network::SapphireAPI::login( const std::string& username, const std::string& pass, std::string& sId ) { @@ -63,7 +56,7 @@ bool Sapphire::Network::SapphireAPI::login( const std::string& username, const s } -bool Sapphire::Network::SapphireAPI::insertSession( const uint32_t& accountId, std::string& sId ) +bool Sapphire::Network::SapphireAPI::insertSession( const uint32_t accountId, std::string& sId ) { // create session for the new sessionid and store to sessionlist auto pSession = std::make_shared< Session >(); @@ -106,9 +99,9 @@ bool Sapphire::Network::SapphireAPI::createAccount( const std::string& username, } -int -Sapphire::Network::SapphireAPI::createCharacter( const int& accountId, const std::string& name, const std::string& infoJson, - const int& gmRank ) +int Sapphire::Network::SapphireAPI::createCharacter( const uint32_t accountId, const std::string& name, + const std::string& infoJson, + const uint32_t gmRank ) { Sapphire::PlayerMinimal newPlayer; @@ -179,7 +172,7 @@ Sapphire::Network::SapphireAPI::createCharacter( const int& accountId, const std return newPlayer.getAccountId(); } -void Sapphire::Network::SapphireAPI::deleteCharacter( std::string name, uint32_t accountId ) +void Sapphire::Network::SapphireAPI::deleteCharacter( std::string name, const uint32_t accountId ) { PlayerMinimal deletePlayer; auto charList = getCharList( accountId ); diff --git a/src/api/SapphireAPI.h b/src/api/SapphireAPI.h index ca064968..33014d28 100644 --- a/src/api/SapphireAPI.h +++ b/src/api/SapphireAPI.h @@ -28,12 +28,12 @@ namespace Sapphire::Network bool createAccount( const std::string& username, const std::string& pass, std::string& sId ); - int32_t createCharacter( const int& accountId, const std::string& name, - const std::string& infoJson, const int& gmRank ); + int32_t createCharacter( uint32_t accountId, const std::string& name, + const std::string& infoJson, uint32_t gmRank ); void deleteCharacter( std::string name, uint32_t accountId ); - bool insertSession( const uint32_t& accountId, std::string& sId ); + bool insertSession( uint32_t accountId, std::string& sId ); std::vector< Sapphire::PlayerMinimal > getCharList( uint32_t accountId );