Defined in:Encapsulates a callback function that sends initial game state in a multiplayer game.
class StateSender : public ListElement<StateSender>
StateSender(SenderCallback *callback, void *cookie);
||A pointer to the state-sending callback function.|
||A pointer to application-defined data that is passed to the state-sending callback function.|
StateSenderclass encapsulates a callback function that is called whenever a new client machine joins a multiplayer game. All state-sending callback functions are called immediately after the Message Manager sends the
kPlayerInitializedevent to the
Application::HandlePlayerEventfunction on the server machine. The function pointed to by the
callbackparameter should have the following prototype.
The state-sending callback function should send any necessary messages to the player specified by the
typedef void SenderCallback(Player *to, void *);
toparameter in order to synchronize some kind of initial game state.
The World Manager installs a state-sending callback function that sends initial controller state messages to a new client. A controller can send initial game state messages by overriding the
||Used internally by the Message Manager.|