Recast  1
Game with custom magic
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | List of all members
PlayersOnline Class Reference

#include <PlayersOnline.hpp>

Collaboration diagram for PlayersOnline:
Collaboration graph

Public Member Functions

 PlayersOnline (int playerCount)
 
 ~PlayersOnline ()
 
std::vector< Player * > getOnlinePlayers () const
 
PlayergetPlayerBySession (const std::string &session) const
 
std::string authPlayer (std::string login, std::string password)
 
void registerPlayer (std::string login, std::string password)
 
bool logout (const std::string &session)
 
int playersOnline () const
 

Constructor & Destructor Documentation

PlayersOnline::PlayersOnline ( int  playerCount)
inline
PlayersOnline::~PlayersOnline ( )

Member Function Documentation

string PlayersOnline::authPlayer ( std::string  login,
std::string  password 
)

Auth player on Server. Get all game data from SQLite On failed auth (if user is not in a table) throw InvalidLoginOrPassword On fulled server (maxPlayers == currentPlayers) throw ServerFullException

Warning
Can throw exception! Must be in try{}catch{} block
Parameters
loginuser login
passworduser password
Returns
session string

Here is the call graph for this function:

vector< Player * > PlayersOnline::getOnlinePlayers ( ) const
Player * PlayersOnline::getPlayerBySession ( const std::string &  session) const
bool PlayersOnline::logout ( const std::string &  session)

Remove user from user list and save that in SQLite

Parameters
session
Returns
int PlayersOnline::playersOnline ( ) const
inline
void PlayersOnline::registerPlayer ( std::string  login,
std::string  password 
)

Register player in SQLite. Can throw InvalidLoginOrPassword when login already exists

Parameters
loginnew login
passworduser password

The documentation for this class was generated from the following files: