GPR5100 - Rollback
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions
packet_type.h File Reference
#include <SFML/Network/Packet.hpp>
#include "game/game_globals.h"
#include <memory>
#include <chrono>
Include dependency graph for packet_type.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  game::Packet
 Packet is a interface that defines what a packet with a PacketType. More...
 
struct  game::TypedPacket< type >
 TypedPacket is a template class that sets the packetType of Packet automatically at construction with the given type. More...
 
struct  game::JoinPacket
 JoinPacket is a TCP Packet that is sent by a client to the server to join a game. More...
 
struct  game::JoinAckPacket
 JoinAckPacket is a TCP Packet that is sent by the server to the client to answer a join packet. More...
 
struct  game::SpawnPlayerPacket
 SpawnPlayerPacket is a TCP Packet sent by the server to all clients to notify of the spawn of a new player. More...
 
struct  game::PlayerInputPacket
 PlayerInputPacket is a UDP Packet sent by the player client and then replicated by the server to all clients to share the currentFrame and all the previous ones player inputs. More...
 
struct  game::StartGamePacket
 StartGamePacket is a TCP Packet send by the server to start a game at a given time. More...
 
struct  game::ValidateFramePacket
 ValidateFramePacket is an UDP packet that is sent by the server to validate the last physics state of the world. More...
 
struct  game::WinGamePacket
 WinGamePacket is a TCP Packet sent by the server to notify the clients that a certain player has won. More...
 
struct  game::PingPacket
 PingPacket is an UDP Packet sent by the client to the server and resend by the server to measure the RTT between the client and the server. More...
 
class  game::PacketSenderInterface
 PacketSenderInterface is a interface for any Server or Client who wants to send and receive packets. More...
 

Typedefs

using game::PhysicsState = std::uint16_t
 PhysicsState is the type of the physics state checksum.
 

Enumerations

enum class  PacketType : std::uint8_t {
  JOIN = 0u , SPAWN_PLAYER , INPUT , SPAWN_BULLET ,
  VALIDATE_STATE , START_GAME , JOIN_ACK , WIN_GAME ,
  PING , NONE
}
 

Functions

sf::Packet & game::operator<< (sf::Packet &packetReceived, Packet &packet)
 
sf::Packet & game::operator>> (sf::Packet &packetReceived, Packet &packet)
 
template<typename T , size_t N>
sf::Packet & game::operator<< (sf::Packet &packet, const std::array< T, N > &t)
 
template<typename T , size_t N>
sf::Packet & game::operator>> (sf::Packet &packet, std::array< T, N > &t)
 
sf::Packet & game::operator<< (sf::Packet &packet, const JoinPacket &joinPacket)
 
sf::Packet & game::operator>> (sf::Packet &packet, JoinPacket &joinPacket)
 
sf::Packet & game::operator<< (sf::Packet &packet, const JoinAckPacket &spawnPlayerPacket)
 
sf::Packet & game::operator>> (sf::Packet &packet, JoinAckPacket &joinPacket)
 
sf::Packet & game::operator<< (sf::Packet &packet, const SpawnPlayerPacket &spawnPlayerPacket)
 
sf::Packet & game::operator>> (sf::Packet &packet, SpawnPlayerPacket &spawnPlayerPacket)
 
sf::Packet & game::operator<< (sf::Packet &packet, const PlayerInputPacket &playerInputPacket)
 
sf::Packet & game::operator>> (sf::Packet &packet, PlayerInputPacket &playerInputPacket)
 
sf::Packet & game::operator<< (sf::Packet &packet, const ValidateFramePacket &validateFramePacket)
 
sf::Packet & game::operator>> (sf::Packet &packet, ValidateFramePacket &ValidateFramePacket)
 
sf::Packet & game::operator<< (sf::Packet &packet, const WinGamePacket &winGamePacket)
 
sf::Packet & game::operator>> (sf::Packet &packet, WinGamePacket &winGamePacket)
 
sf::Packet & game::operator<< (sf::Packet &packet, const PingPacket &pingPacket)
 
sf::Packet & game::operator>> (sf::Packet &packet, PingPacket &pingPacket)
 
void game::GeneratePacket (sf::Packet &packet, Packet &sendingPacket)
 
std::unique_ptr< Packet > game::GenerateReceivedPacket (sf::Packet &packet)