GPR5100 - Rollback
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
game::Client Class Reference

Client is an interface of a player game manager and the net client interface (receive and send packets). A client needs an ID which is receive by the server through a packet. More...

#include <client.h>

Inheritance diagram for game::Client:
Inheritance graph
[legend]
Collaboration diagram for game::Client:
Collaboration graph
[legend]

Public Member Functions

virtual void SetWindowSize (sf::Vector2u windowSize)
 
virtual void ReceivePacket (const Packet *packet)
 ReceiveNetPacket is a method called by an app owning a client when receiving a packet. It is the same one for simulated and network client. More...
 
void Update (sf::Time dt) override
 
- Public Member Functions inherited from core::DrawInterface
virtual void Draw (sf::RenderTarget &renderTarget)=0
 
- Public Member Functions inherited from core::DrawImGuiInterface
virtual void DrawImGui ()=0
 
- Public Member Functions inherited from game::PacketSenderInterface
virtual void SendReliablePacket (std::unique_ptr< Packet > packet)=0
 
virtual void SendUnreliablePacket (std::unique_ptr< Packet > packet)=0
 
- Public Member Functions inherited from core::SystemInterface
virtual void Begin ()=0
 
virtual void Update (sf::Time dt)=0
 
virtual void End ()=0
 

Protected Attributes

ClientGameManager gameManager_
 
ClientId clientId_ = INVALID_CLIENT_ID
 
float pingTimer_ = -1.0f
 
float currentPing_ = 0.0f
 
float srtt_ = -1.0f
 
float rttvar_ = 0.0f
 
float rto_ = 1.0f
 

Static Protected Attributes

static constexpr float pingPeriod_ = 0.3f
 
static constexpr float k = 4.0f
 
static constexpr float g = 100.0f
 
static constexpr float alpha = 1.0f/8.0f
 
static constexpr float beta = 1.0f/4.0f
 

Detailed Description

Client is an interface of a player game manager and the net client interface (receive and send packets). A client needs an ID which is receive by the server through a packet.

Member Function Documentation

◆ ReceivePacket()

void game::Client::ReceivePacket ( const Packet packet)
virtual

ReceiveNetPacket is a method called by an app owning a client when receiving a packet. It is the same one for simulated and network client.

Parameters
packetA non-owning pointer to a packet (you don't need to care about deleting it

Reimplemented in game::NetworkClient, and game::SimulationClient.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Update()

void game::Client::Update ( sf::Time  dt)
overridevirtual

Implements core::SystemInterface.


The documentation for this class was generated from the following files: