GPR5100 - Rollback
Loading...
Searching...
No Matches
client.h
1#pragma once
2#include "packet_type.h"
3#include "game/game_manager.h"
4#include "graphics/graphics.h"
5
6namespace game
7{
13{
14public:
15 Client() : gameManager_(*this)
16 {
17
18 }
19 virtual void SetWindowSize(sf::Vector2u windowSize)
20 {
21 gameManager_.SetWindowSize(windowSize);
22 }
23
29 virtual void ReceivePacket(const Packet* packet);
30
31 void Update(sf::Time dt) override;
32protected:
33
34 ClientGameManager gameManager_;
35 ClientId clientId_ = INVALID_CLIENT_ID;
36 float pingTimer_ = -1.0f;
37 float currentPing_ = 0.0f;
38 static constexpr float pingPeriod_ = 0.3f;
39
40 float srtt_ = -1.0f;
41 float rttvar_ = 0.0f;
42 float rto_ = 1.0f;
43 static constexpr float k = 4.0f;
44 static constexpr float g = 100.0f;
45 static constexpr float alpha = 1.0f/8.0f;
46 static constexpr float beta = 1.0f/4.0f;
47};
48}
DrawImGuiInterface is an interface used by the Engine to be called when the game loop is drawing ImGu...
Definition: graphics.h:23
DrawInterface is an interface used by the Engine to be called when the game loop is drawing elements ...
Definition: graphics.h:12
SystemInterface is an interface to a game system that needs to begin, update and end by the Engine....
Definition: system.h:13
ClientGameManager is a class that inherits from GameManager by adding the visual part and specific im...
Definition: game_manager.h:62
Client is an interface of a player game manager and the net client interface (receive and send packet...
Definition: client.h:13
virtual void ReceivePacket(const Packet *packet)
ReceiveNetPacket is a method called by an app owning a client when receiving a packet....
Definition: client.cpp:13
PacketSenderInterface is a interface for any Server or Client who wants to send and receive packets.
Definition: packet_type.h:363
ClientId
ClientId is a type used to define the client identification. It is given by the server to clients.
Definition: game_globals.h:31
Packet is a interface that defines what a packet with a PacketType.
Definition: packet_type.h:37