GPR5100 - Rollback
Loading...
Searching...
No Matches
simulation_client.h
1#pragma once
2#include <memory>
3#include <network/client.h>
4#include <SFML/System/Time.hpp>
5
6#include "debug_db.h"
7
8namespace game
9{
10class SimulationServer;
11
15class SimulationClient final : public Client
16{
17public:
18 explicit SimulationClient(SimulationServer& server);
19
20 void Begin() override;
21 void Update(sf::Time dt) override;
22
23 void End() override;
24 void Draw(sf::RenderTarget& window) override;
25
26
27 void SendUnreliablePacket(std::unique_ptr<Packet> packet) override;
28 void SendReliablePacket(std::unique_ptr<Packet> packet) override;
29
30 void ReceivePacket(const Packet* packet) override;
31
32 void DrawImGui() override;
33 void SetPlayerInput(PlayerInput input);
34
35private:
36 SimulationServer& server_;
37#ifdef ENABLE_SQLITE
38 DebugDatabase debugDb_;
39#endif
40
41};
42}
Client is an interface of a player game manager and the net client interface (receive and send packet...
Definition: client.h:13
SimulationClient is a Client that uses simulated sockets with a direct reference to the server.
Definition: simulation_client.h:16
void ReceivePacket(const Packet *packet) override
ReceiveNetPacket is a method called by an app owning a client when receiving a packet....
Definition: simulation_client.cpp:111
SimulationServer is a Server that delays Packet internally before "receiving" them and then sends the...
Definition: simulation_server.h:25
std::uint8_t PlayerInput
PlayerInput is a type defining the input data from a player.
Definition: game_globals.h:103
Packet is a interface that defines what a packet with a PacketType.
Definition: packet_type.h:37