3#include <SFML/Network/TcpSocket.hpp>
4#include <SFML/Network/UdpSocket.hpp>
7#include "network/debug_db.h"
27 enum class PacketSource
32 void Begin()
override;
34 void Update(sf::Time dt)
override;
38 void DrawImGui()
override;
40 void Draw(sf::RenderTarget& renderTarget)
override;
42 void SendReliablePacket(std::unique_ptr<Packet> packet)
override;
44 void SendUnreliablePacket(std::unique_ptr<Packet> packet)
override;
49 void ReceiveNetPacket(sf::Packet& packet, PacketSource source);
50 sf::UdpSocket udpSocket_;
51 sf::TcpSocket tcpSocket_;
53 std::string serverAddress_ =
"localhost";
54 unsigned short serverTcpPort_ = 12345;
55 unsigned short serverUdpPort_ = 0;
58 State currentState_ = State::NONE;
61 DebugDatabase debugDb_;
Client is an interface of a player game manager and the net client interface (receive and send packet...
Definition: client.h:13
NetworkClient is a network client that uses SFML sockets.
Definition: network_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: network_client.cpp:238
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