|
Message Manager
C4Messages.h
class Player
Represents a machine connected to a multiplayer game.
Definition
class Player : public MapElement<Player>, public GraphNode<Player, Channel>, public LinkTarget<Player>, public Completable<Player>
Member Functions
Constructor
explicit Player(PlayerKey key);
Parameters
key |
The unique player ID assigned to the player. The server always uses the special key kPlayerServer.
|
Description
Player objects represent machines in a multiplayer game.
NOTE. It is not necessary to explicitly construct Player objects. The Message Manager creates new player objects automatically for itself and new clients as they join a game.
|
The Message Manager maintains a list of players that can be accessed by calling the MessageMgr::GetFirstPlayer function or MessageMgr::GetPlayer function. Messages can be sent to a player by calling the Player::SendMessage function. It is also possible to send messages by calling the MessageMgr::SendMessage function, specifying the player key corresponding to the intended recipient.
Base Classes
MapElement<Player> |
All Player objects area stored in a map maintained by the Message Manager.
|
GraphNode<Player, Channel> |
Player objects are stored in a graph structure that determines how voice chat messages are distributed.
|
LinkTarget<Player> |
Used internally by the Message Manager.
|
Completable<Player> |
Used for file transfers. The completion procedure is called when a file transfer completes or results in an error.
|
See Also
MessageMgr
|