Object that helps the server manage players. More...
#include <srv-players.h>
Classes | |
struct | iterator_t |
Public Member Functions | |
virtual | ~PlayerManager (void) throw () |
virtual void | updatePlayer (IN player_rec_t &pr)=0 |
virtual bool | getPlayerByHostAndPlayerId (IN conn_id_t udpConnId, IN int playerId, OUT player_rec_t &pr)=0 |
virtual void | getIterator (IN conn_id_t udpConnId, OUT iterator_t &iterator)=0 |
requests a new iterator. if hostId is null, iterates over all hosts | |
virtual bool | getNextPlayer (IO iterator_t &iterator, OUT player_rec_t &pr)=0 |
returns the player for this iteration, and increments iterator | |
Static Public Member Functions | |
static smart_ptr< PlayerManager > | create (IN smart_ptr< UserManager > &userMgr) |
Object that helps the server manage players.
Players are humans connecting from a remote host, ideally they will sign in as local users as well. There could be multiple players on the same user account. See also rules_players
Iteration is a best effort. If there are other insertions/deletions while you are iterating, then you may miss some players. But if you keep trying to iterate (within the message pump, etc.) you will eventually get through all players. Never count on getting to all players in a single loop, since other threads may be adding/removin players at the same time.
NOTE: (to implementers) all methods should be threadsafe!
Definition at line 123 of file srv-players.h.