Classes | Public Member Functions | Static Public Member Functions

aesop::PlayerManager Class Reference
[Players and Player Management]

Object that helps the server manage players. More...

#include <srv-players.h>

Inheritance diagram for aesop::PlayerManager:
Inheritance graph

List of all members.


struct  iterator_t

Public Member Functions

virtual ~PlayerManager (void) throw ()
virtual void updatePlayer (player_rec_t &pr)=0
virtual bool getPlayerByHostAndPlayerId (conn_id_t udpConnId, int playerId, player_rec_t &pr)=0
virtual void getIterator (conn_id_t udpConnId, iterator_t &iterator)=0
 requests a new iterator. if hostId is null, iterates over all hosts
virtual bool getNextPlayer (iterator_t &iterator, player_rec_t &pr)=0
 returns the player for this iteration, and increments iterator

Static Public Member Functions

static smart_ptr< PlayerManagercreate (smart_ptr< UserManager > &userMgr)

Detailed Description

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.

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