Cafu Engine
ClientInfo.hpp
1 /*
2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
5 */
6 
7 #ifndef CAFU_CLIENTINFO_HPP_INCLUDED
8 #define CAFU_CLIENTINFO_HPP_INCLUDED
9 
10 #include "Network/Network.hpp"
11 
12 
14 {
15  ClientInfoT(const NetAddressT& ClientAddress_, const std::string& PlayerName_, const std::string& ModelName_);
16 
17  void InitForNewWorld(unsigned long ClientEntityID);
18 
19 
20  enum ClientStateT { Online, Wait4MapInfoACK, Zombie };
21 
22  // Connection-related data
23  NetAddressT ClientAddress; ///< IP+Port of the client.
24  GameProtocol1T GameProtocol; ///< The network protocol instance we use for communication with the client.
25  ArrayT< ArrayT<char> > ReliableDatas; ///< Puffer für wichtige, zu bestätigende Messages an den Client.
26  float TimeSinceLastMessage; ///< Time that passed since the last message arrived (for time-outs and zombies).
27  float TimeSinceLastUpdate;
28 
29  // Client-related data
30  ClientStateT ClientState; ///< Online, Wait4MapInfoACK, Zombie, Download, ...
31  std::string PlayerName; ///< Player name (e.g. Thunderbird, Firefox, Mordred, ...).
32  std::string ModelName; ///< Model name (e.g. Trinity, T801, James, ...).
33 
34  // World-related data
35  unsigned long EntityID; ///< ID of our HumanPlayer entity.
36  unsigned int LastPlayerCommandNr; ///< The number of the last player command that we have received from the client.
37  unsigned long LastKnownFrameReceived; ///< Für Delta-Kompression: Letztes Frame, von dem wir wissen, das der Cl es empf. hat.
38  unsigned long BaseLineFrameNr;
39  ArrayT< ArrayT<unsigned long> > OldStatesPVSEntityIDs; ///< TODO: Replace type with `ArrayT<FrameInfoT>` ?
40 };
41 
42 #endif
NetAddressT ClientAddress
IP+Port of the client.
Definition: ClientInfo.hpp:23
unsigned long LastKnownFrameReceived
Für Delta-Kompression: Letztes Frame, von dem wir wissen, das der Cl es empf. hat.
Definition: ClientInfo.hpp:37
Network address consisting of an IP4 address and port number.
Definition: Network.hpp:98
This class implements a mixture of a reliable and unreliable, bi-directional network protocol for Caf...
Definition: Network.hpp:391
unsigned long EntityID
ID of our HumanPlayer entity.
Definition: ClientInfo.hpp:35
std::string PlayerName
Player name (e.g. Thunderbird, Firefox, Mordred, ...).
Definition: ClientInfo.hpp:31
GameProtocol1T GameProtocol
The network protocol instance we use for communication with the client.
Definition: ClientInfo.hpp:24
ArrayT< ArrayT< char > > ReliableDatas
Puffer für wichtige, zu bestätigende Messages an den Client.
Definition: ClientInfo.hpp:25
unsigned int LastPlayerCommandNr
The number of the last player command that we have received from the client.
Definition: ClientInfo.hpp:36
ArrayT< ArrayT< unsigned long > > OldStatesPVSEntityIDs
TODO: Replace type with ArrayT<FrameInfoT> ?
Definition: ClientInfo.hpp:39
float TimeSinceLastMessage
Time that passed since the last message arrived (for time-outs and zombies).
Definition: ClientInfo.hpp:26
Definition: ClientInfo.hpp:13
This is the base class for the concrete classes that implement the states of the client.
Definition: ClientState.hpp:18
std::string ModelName
Model name (e.g. Trinity, T801, James, ...).
Definition: ClientInfo.hpp:32
Definition: Renderer.hpp:16
ClientStateT ClientState
Online, Wait4MapInfoACK, Zombie, Download, ...
Definition: ClientInfo.hpp:30