1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-27 06:47:45 +00:00
sapphire/src/servers/Server_REST/SapphireAPI.h
2017-09-11 18:59:50 +02:00

54 lines
No EOL
1.2 KiB
C++

#ifndef _SAPPHIREAPI_H_
#define _SAPPHIREAPI_H_
#include <string>
#include <vector>
#include <map>
#include <boost/shared_ptr.hpp>
#include "PlayerMinimal.h"
namespace Core
{
class Session;
namespace Network
{
class SapphireAPI
{
public:
SapphireAPI();
~SapphireAPI();
typedef std::map< std::string, boost::shared_ptr< Session > > SessionMap;
bool login( 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, const std::string& infoJson, const int& gmRank );
void deleteCharacter( std::string name, uint32_t accountId );
bool insertSession( const uint32_t& accountId, std::string& sId );
std::vector<Core::PlayerMinimal> getCharList( uint32_t accountId );
bool checkNameTaken( std::string name );
uint32_t getNextCharId();
uint64_t getNextContentId();
int32_t checkSession( const std::string& sId );
bool removeSession( const std::string& sId );
SessionMap m_sessionMap;
};
}
}
#endif