## Public API Reference

- Main Page
- Classes
- Files

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# iCelGameClient Struct Reference

The main object to manage the client game logic. More...

`#include <physicallayer/network.h>`

List of all members.

## Public Member Functions

virtual csTicks | ConvertServerClock (csTicks server_time) const =0
| Convert a time from the server clock to the client clock.
virtual iCelEntity * | GetMappedEntity (uint entity_id) const =0
| Return the entity on the client side that is network linked with an entity with ID entity_id on the server side.
virtual uint | GetMappedID (uint entity_id) const =0
| Return the ID of the entity on the client side that is network linked with an entity with ID entity_id on the server side.
virtual void | GetNetworkStats (celNetworkServerStats &stats) const =0
| Return the network stats of this client.
virtual celPlayer * | GetPlayer ()=0
| Return the current player associated with this client.
virtual void | LaunchClientEvent (celClientEventData &event_data)=0
| Ask the game client to send an event to the server.
virtual void | RegisterClientManager (celGameClientManager *manager)=0
| Register the manager of this client.
virtual void | SetMaximumBandwidth (size_t width)=0
| The maximum bandwidth of the network data transmission in bytes per second.
virtual void | SetNetworkPeriod (csTicks period)=0
| Specify the maximum frequency at which the client can send data.
virtual void | SetReady ()=0
| Indicate that the client has loaded everything and is ready to play.
virtual void | SetServerTimeOut (csTicks timeout)=0
| The client will consider itself connected to the server until the connection is broken during specified time.
virtual void | UpdatePlayer (celPlayer *player)=0
| Update the data of the current player.

## Detailed Description

The main object to manage the client game logic.

You can use it to:

- update the data of the player.
- convert a server clock or a server entity ID in client values.
- tell the system when the player is ready to play.
- send client events.
- set some options on the client.
- get some network statistics.

You should define and register a celGameClientManager which will catch the events from this client.

Definition at line 519 of file network.h.

## Member Function Documentation

virtual csTicks iCelGameClient::ConvertServerClock | ( | csTicks | server_time | ) | const`[pure virtual]`

| Convert a time from the server clock to the client clock.

virtual iCelEntity* iCelGameClient::GetMappedEntity | ( | uint | entity_id | ) | const`[pure virtual]`

| Return the entity on the client side that is network linked with an entity with ID entity_id on the server side.

virtual uint iCelGameClient::GetMappedID | ( | uint | entity_id | ) | const`[pure virtual]`

| Return the ID of the entity on the client side that is network linked with an entity with ID entity_id on the server side.

virtual void iCelGameClient::GetNetworkStats | ( | celNetworkServerStats & | stats | ) | const`[pure virtual]`

| Return the network stats of this client.

virtual celPlayer* iCelGameClient::GetPlayer | ( |  | ) | `[pure virtual]`

| Return the current player associated with this client.

virtual void iCelGameClient::LaunchClientEvent | ( | celClientEventData & | event_data | ) | `[pure virtual]`

| Ask the game client to send an event to the server.

virtual void iCelGameClient::RegisterClientManager | ( | celGameClientManager * | manager | ) | `[pure virtual]`

| Register the manager of this client. Only one manager can be registered at a time.

virtual void iCelGameClient::SetMaximumBandwidth | ( | size_t | width | ) | `[pure virtual]`

| The maximum bandwidth of the network data transmission in bytes per second. A bandwidth of 0 means that it is unlimited.

virtual void iCelGameClient::SetNetworkPeriod | ( | csTicks | period | ) | `[pure virtual]`

| Specify the maximum frequency at which the client can send data.

virtual void iCelGameClient::SetReady | ( |  | ) | `[pure virtual]`

| Indicate that the client has loaded everything and is ready to play.

virtual void iCelGameClient::SetServerTimeOut | ( | csTicks | timeout | ) | `[pure virtual]`

| The client will consider itself connected to the server until the connection is broken during specified time.

virtual void iCelGameClient::UpdatePlayer | ( | celPlayer * | player | ) | `[pure virtual]`

| Update the data of the current player. The server will check if the new data are valid and a subsequent celGameClientManager::PlayerUpdated will be called with the validated data.

The documentation for this struct was generated from the following file:

- physicallayer/network.h