SimulationClient is a Client that uses simulated sockets with a direct reference to the server.
More...
#include <simulation_client.h>
|
|
| SimulationClient (SimulationServer &server) |
| |
| void | Begin () override |
| |
| void | Update (sf::Time dt) override |
| |
| void | End () override |
| |
| void | Draw (sf::RenderTarget &window) override |
| |
| void | SendUnreliablePacket (std::unique_ptr< Packet > packet) override |
| |
| void | SendReliablePacket (std::unique_ptr< Packet > packet) override |
| |
| void | ReceivePacket (const Packet *packet) override |
| | 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 | DrawImGui () override |
| |
|
void | SetPlayerInput (PlayerInput input) |
| |
|
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 |
| |
|
virtual void | Draw (sf::RenderTarget &renderTarget)=0 |
| |
|
virtual void | DrawImGui ()=0 |
| |
|
virtual void | SendReliablePacket (std::unique_ptr< Packet > packet)=0 |
| |
|
virtual void | SendUnreliablePacket (std::unique_ptr< Packet > packet)=0 |
| |
|
virtual void | Begin ()=0 |
| |
|
virtual void | Update (sf::Time dt)=0 |
| |
|
virtual void | End ()=0 |
| |
|
|
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 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 |
| |
SimulationClient is a Client that uses simulated sockets with a direct reference to the server.
◆ Begin()
| void game::SimulationClient::Begin |
( |
| ) |
|
|
overridevirtual |
◆ Draw()
| void game::SimulationClient::Draw |
( |
sf::RenderTarget & |
window | ) |
|
|
overridevirtual |
◆ DrawImGui()
| void game::SimulationClient::DrawImGui |
( |
| ) |
|
|
overridevirtual |
◆ End()
| void game::SimulationClient::End |
( |
| ) |
|
|
overridevirtual |
◆ ReceivePacket()
| void game::SimulationClient::ReceivePacket |
( |
const Packet * |
packet | ) |
|
|
overridevirtual |
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
-
| packet | A non-owning pointer to a packet (you don't need to care about deleting it |
Reimplemented from game::Client.
◆ SendReliablePacket()
| void game::SimulationClient::SendReliablePacket |
( |
std::unique_ptr< Packet > |
packet | ) |
|
|
overridevirtual |
◆ SendUnreliablePacket()
| void game::SimulationClient::SendUnreliablePacket |
( |
std::unique_ptr< Packet > |
packet | ) |
|
|
overridevirtual |
◆ Update()
| void game::SimulationClient::Update |
( |
sf::Time |
dt | ) |
|
|
overridevirtual |
The documentation for this class was generated from the following files:
- G:/Development/SAE/921/GPR5100_Rollback/game/include/network/simulation_client.h
- G:/Development/SAE/921/GPR5100_Rollback/game/src/network/simulation_client.cpp