Network code documentation for my turn-based game
1.0
Loading...
Searching...
No Matches
network
include
packet.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
types.h
"
4
5
#include <SFML/Network/Packet.hpp>
6
7
enum class
PacketType
: std::int8_t {
8
kNone
= 0,
9
KNotReady
,
10
kClientIdentification
,
11
kJoinLobby
,
12
KStartGame
,
13
kNewTurn
,
14
KCueBallVelocity
,
15
kEndGame
,
16
kEloUpdated
,
17
};
18
24
struct
ClientPacket
{
25
sf::Packet
data
{};
26
Port
client_port
= 0;
27
};
28
29
sf::Packet&
operator<<
(sf::Packet& packet,
const
PacketType
& type);
30
sf::Packet&
operator>>
(sf::Packet& packet,
PacketType
& type);
operator<<
sf::Packet & operator<<(sf::Packet &packet, const PacketType &type)
operator>>
sf::Packet & operator>>(sf::Packet &packet, PacketType &type)
PacketType
PacketType
Definition
packet.h:7
PacketType::kEloUpdated
@ kEloUpdated
PacketType::kNone
@ kNone
PacketType::kClientIdentification
@ kClientIdentification
PacketType::kEndGame
@ kEndGame
PacketType::KStartGame
@ KStartGame
PacketType::KNotReady
@ KNotReady
PacketType::kJoinLobby
@ kJoinLobby
PacketType::KCueBallVelocity
@ KCueBallVelocity
PacketType::kNewTurn
@ kNewTurn
ClientPacket
ClientPacket is an object containing data that a client wishes to send to the server and its remote p...
Definition
packet.h:24
ClientPacket::data
sf::Packet data
Definition
packet.h:25
ClientPacket::client_port
Port client_port
Definition
packet.h:26
types.h
Port
std::uint16_t Port
Definition
types.h:19
Generated by
1.10.0