mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 22:57:45 +00:00
52 lines
1.1 KiB
C
52 lines
1.1 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 );
|
||
|
|
||
|
int createCharacter( const int& accountId, const std::string& name, const std::string& infoJson );
|
||
|
|
||
|
void deleteCharacter( std::string name, uint32_t accountId );
|
||
|
|
||
|
std::vector<Core::PlayerMinimal> getCharList( uint32_t accountId );
|
||
|
|
||
|
bool checkNameTaken( std::string name );
|
||
|
|
||
|
uint32_t getNextCharId();
|
||
|
|
||
|
uint64_t getNextContentId();
|
||
|
|
||
|
int checkSession( const std::string& sId );
|
||
|
|
||
|
bool removeSession( const std::string& sId );
|
||
|
|
||
|
SessionMap m_sessionMap;
|
||
|
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
|
||
|
#endif
|