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

minor consistency/code style fixes in sapphireapi

This commit is contained in:
NotAdam 2019-03-17 21:07:00 +11:00
parent f1469a554c
commit e1ee0c6843
2 changed files with 10 additions and 17 deletions

View file

@ -10,15 +10,8 @@
#include <Database/DatabaseDef.h> #include <Database/DatabaseDef.h>
Sapphire::Network::SapphireAPI::SapphireAPI() Sapphire::Network::SapphireAPI::SapphireAPI() = default;
{ Sapphire::Network::SapphireAPI::~SapphireAPI() = default;
}
Sapphire::Network::SapphireAPI::~SapphireAPI()
{
}
bool Sapphire::Network::SapphireAPI::login( const std::string& username, const std::string& pass, std::string& sId ) 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 // create session for the new sessionid and store to sessionlist
auto pSession = std::make_shared< Session >(); auto pSession = std::make_shared< Session >();
@ -106,9 +99,9 @@ bool Sapphire::Network::SapphireAPI::createAccount( const std::string& username,
} }
int int Sapphire::Network::SapphireAPI::createCharacter( const uint32_t accountId, const std::string& name,
Sapphire::Network::SapphireAPI::createCharacter( const int& accountId, const std::string& name, const std::string& infoJson, const std::string& infoJson,
const int& gmRank ) const uint32_t gmRank )
{ {
Sapphire::PlayerMinimal newPlayer; Sapphire::PlayerMinimal newPlayer;
@ -179,7 +172,7 @@ Sapphire::Network::SapphireAPI::createCharacter( const int& accountId, const std
return newPlayer.getAccountId(); 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; PlayerMinimal deletePlayer;
auto charList = getCharList( accountId ); auto charList = getCharList( accountId );

View file

@ -28,12 +28,12 @@ namespace Sapphire::Network
bool createAccount( const std::string& username, const std::string& pass, std::string& sId ); bool createAccount( const std::string& username, const std::string& pass, std::string& sId );
int32_t createCharacter( const int& accountId, const std::string& name, int32_t createCharacter( uint32_t accountId, const std::string& name,
const std::string& infoJson, const int& gmRank ); const std::string& infoJson, uint32_t gmRank );
void deleteCharacter( std::string name, uint32_t accountId ); 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 ); std::vector< Sapphire::PlayerMinimal > getCharList( uint32_t accountId );