1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-27 22:57:45 +00:00
sapphire/src/servers/sapphire_api/SapphireAPI.h

54 lines
1.1 KiB
C
Raw Normal View History

2017-08-08 13:53:47 +02:00
#ifndef _SAPPHIREAPI_H_
#define _SAPPHIREAPI_H_
#include <string>
#include <vector>
#include <map>
2018-10-26 11:01:41 +02:00
#include <memory>
2017-08-08 13:53:47 +02:00
#include "PlayerMinimal.h"
namespace Core {
class Session;
namespace Network {
class SapphireAPI
2017-08-08 13:53:47 +02:00
{
public:
SapphireAPI();
2017-08-08 13:53:47 +02:00
~SapphireAPI();
2017-08-08 13:53:47 +02:00
2018-10-25 12:44:51 +11:00
using SessionMap = std::map< std::string, std::shared_ptr< Session > >;
2017-08-08 13:53:47 +02:00
bool login( const std::string& username, const std::string& pass, std::string& sId );
2017-08-08 13:53:47 +02:00
bool createAccount( const std::string& username, const std::string& pass, std::string& sId );
2017-08-08 13:53:47 +02:00
int32_t
createCharacter( const int& accountId, const std::string& name, const std::string& infoJson, const int& gmRank );
2017-08-08 13:53:47 +02:00
void deleteCharacter( std::string name, uint32_t accountId );
2017-08-08 13:53:47 +02:00
bool insertSession( const uint32_t& accountId, std::string& sId );
2017-08-08 22:55:02 +02:00
std::vector< Core::PlayerMinimal > getCharList( uint32_t accountId );
2017-08-08 13:53:47 +02:00
bool checkNameTaken( std::string name );
2017-08-08 13:53:47 +02:00
uint32_t getNextCharId();
2017-08-08 13:53:47 +02:00
uint64_t getNextContentId();
2017-08-08 13:53:47 +02:00
int32_t checkSession( const std::string& sId );
2017-08-08 13:53:47 +02:00
bool removeSession( const std::string& sId );
2017-08-08 13:53:47 +02:00
SessionMap m_sessionMap;
2017-08-08 13:53:47 +02:00
};
}
2017-08-08 13:53:47 +02:00
}
2018-10-26 10:00:32 +02:00
#endif