2017-08-08 13:53:47 +02:00
|
|
|
#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 );
|
|
|
|
|
2017-09-11 18:59:50 +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 22:55:02 +02:00
|
|
|
bool insertSession( const uint32_t& accountId, std::string& sId );
|
|
|
|
|
2017-08-08 13:53:47 +02:00
|
|
|
std::vector<Core::PlayerMinimal> getCharList( uint32_t accountId );
|
|
|
|
|
|
|
|
bool checkNameTaken( std::string name );
|
|
|
|
|
|
|
|
uint32_t getNextCharId();
|
|
|
|
|
|
|
|
uint64_t getNextContentId();
|
|
|
|
|
2017-08-11 22:56:30 +01:00
|
|
|
int32_t checkSession( const std::string& sId );
|
2017-08-08 13:53:47 +02:00
|
|
|
|
|
|
|
bool removeSession( const std::string& sId );
|
|
|
|
|
|
|
|
SessionMap m_sessionMap;
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|