iCelGameFactory Struct Reference
A factory to manage game sessions. More...
#include <physicallayer/network.h>
Public Member Functions | |
virtual bool | CloseGame ()=0 |
The player leaves the current game or playback. | |
virtual bool | ConnectGame (celGameInfo *game_info, celPlayer *player)=0 |
Connect the player to the game specified in game_info. | |
virtual bool | CreateNewGame (celNetworkGameType game_type, celGameInfo *game_info, celPlayer *player=0)=0 |
Create a new game, ie at least a server, but also a client if a player is provided. | |
virtual iCelGame * | GetCurrentGame () const =0 |
Return the current game or 0 if no game is available. | |
virtual csString | GetGameName () const =0 |
Return the name of the game. | |
virtual csString | GetProtocolVersion () const =0 |
Return the network protocol version used by this application. | |
virtual void | RegisterGameFactoryManager (celGameFactoryManager *manager)=0 |
Register a manager for this game factory. | |
virtual void | SetGameName (csString game_name)=0 |
Set the name of the game. | |
virtual void | SetProtocolVersion (const csString protocol_version)=0 |
Set the name of the network protocol version used by this application. | |
virtual void | StartPlayBackGame (csString filename, csTicks start_time, csTicks stop_time)=0 |
Start a game where incoming events are read from a file from start_time to stop_time. | |
virtual void | StartRecordingGame (csString filename)=0 |
Incoming events are recorded in a file. | |
virtual void | StartSearchForGameList (celNetworkGameType game_type, celGameInfo *filter=0)=0 |
Start to search for the list of available games with the same game name, protocol version and game type. | |
virtual void | StopRecordingGame ()=0 |
Incoming events are no more recorded in a file. | |
virtual void | StopSearchForGameList ()=0 |
Stop searching for the list of available games. |
Detailed Description
A factory to manage game sessions.You can use it to:
- set and get the name of the game and of the network protocol version.
- search for available games, connect to them or create a new game.
- record the events of the game and playback them.
There should be only one game factory in an application.
Definition at line 101 of file network.h.
Member Function Documentation
|
The player leaves the current game or playback. If a server was also set, it will be closed.
|
|
Connect the player to the game specified in game_info. If a game is already running, it will be closed before the new game is launched. The game_info field must contain the necessary data to find the server, ie a game_id field previously returned by celGameFactoryManager::GameInfoReceived, or the ip_address and port_nb fields. If the game factory was searching for games, it will stop its search.
|
|
Create a new game, ie at least a server, but also a client if a player is provided. Only one game can be created at a time, so if a game is already running, it will be closed before the new game is launched. If the game factory was searching for games, it will stop its search.
|
|
Return the current game or 0 if no game is available.
|
|
Return the name of the game. Client and server instances can talk together only if they have the same game name and protocol version. |
|
Return the network protocol version used by this application. Client and server instances can talk together only if they have the same game name and protocol version. |
|
Register a manager for this game factory. The manager will be notified when events are thrown from the game factory. Only one manager can be registered at a time. A manager must be registered before any operation on the factory. |
|
Set the name of the game. Client and server instances can talk together only if they have the same game name and protocol version. A game name must be set before any operation on the factory.
|
|
Set the name of the network protocol version used by this application. Client and server instances can talk together only if they have the same game name and protocol version. A protocol version must be set before any operation on the factory. The protocol version should be changed each time something has been changed in the network protocol of the game, ie in the meaning of the network events, like changes in the implementation of the network plugin, the selection of property classes of the entities, the client and server events, the network links and the baselines.
|
|
Start a game where incoming events are read from a file from start_time to stop_time. CloseGame can be used to stop the playback. If the game factory was searching for available games or if a game was running, they will be stopped. |
|
Incoming events are recorded in a file. A game must previously be running. |
|
Start to search for the list of available games with the same game name, protocol version and game type. The registered celGameFactoryManager will be notified through celGameFactoryManager::GameInfoReceived each time a game has been found. A celGameInfo object can be provided to filter the games.
|
|
Incoming events are no more recorded in a file.
|
|
Stop searching for the list of available games. No more celGameFactoryManager::GameInfoReceived will be raised. |
The documentation for this struct was generated from the following file:
- physicallayer/network.h
Generated for CEL: Crystal Entity Layer by doxygen 1.4.6