FastEngine 0.9.3
A multiplayer oriented 2D engine made with Vulkan.
Loading...
Searching...
No Matches
Network

Everything related to network. More...

Classes

struct  fge::net::TransmissionPacket
 A packet with configurable options to transmit via a network thread. More...
 
struct  fge::net::OneWayLatencyPlanner
 A helper class that measure latency between client/server. More...
 
class  fge::net::Client
 Class that represent the identity of a client. More...
 
struct  fge::SceneNetEvent
 Structure that represent an network event related to Scene. More...
 
class  fge::NetworkTypeTasks
 Network type for the TaskHandler. More...
 
struct  fge::net::ClientListEvent
 Represents an event on the client list (client added, client removed, ...) More...
 
class  fge::net::ClientList
 A list of clients used by a server. More...
 
struct  fge::net::Identity
 A class to represent a client or server identity with an IP address and a port. More...
 
struct  fge::net::IdentityHash
 A class to hash an Identity (useful for std::unordered_map or other containers) More...
 
class  fge::net::IpAddress
 A class to represent an IP address. More...
 
class  fge::net::NetworkTypeBase
 Base class for a network type. More...
 
class  fge::net::NetworkType< T >
 The default network type for most trivial types. More...
 
class  fge::net::NetworkTypeScene
 The network type for a scene. More...
 
class  fge::net::NetworkTypeTag
 The network type for a tag. More...
 
class  fge::net::NetworkTypeSmoothVec2Float
 The network type for a vector2 float that wait for the error threshold in order to set the value (useful for smooth position sync) More...
 
class  fge::net::NetworkTypeSmoothFloat
 The network type for a float that wait for the error threshold in order to set the value. More...
 
class  fge::net::NetworkTypeProperty< T >
 The network type for a property. More...
 
class  fge::net::NetworkTypePropertyList< T >
 The network type for a property inside a list. More...
 
class  fge::net::NetworkTypeManual< T >
 The network type for a trivial type but triggered manually. More...
 
class  fge::net::NetworkTypeVector< T >
 The network type for a vector. More...
 
class  fge::net::NetworkTypeHandler
 A regroupment of network types. More...
 
class  fge::net::ProtocolPacket
 A special inheritance of Packet with a predefined communication protocol. More...
 
class  fge::net::PacketReorderer
 A packet reorderer. More...
 
class  fge::net::FluxPacket
 A received packet from a network flux. More...
 
class  fge::net::NetFluxUdp
 A network flux. More...
 
class  fge::net::ServerSideNetUdp
 A server side network manager. More...
 
class  fge::net::ClientSideNetUdp
 A client side network manager. More...
 
class  fge::net::Socket
 A base class wrapper for low-level network functions. More...
 
class  fge::net::SocketUdp
 A wrapper for UDP sockets inheriting from Socket. More...
 
class  fge::net::SocketTcp
 A wrapper for TCP sockets inheriting from Socket. More...
 
class  fge::net::SocketListenerTcp
 A wrapper for TCP listener sockets inheriting from Socket. More...
 

Typedefs

using fge::net::Skey = uint32_t
 The session key can be used to identify a client when connecting to a server.
 
using fge::net::Timestamp = uint16_t
 An timestamp represent modulated current time in milliseconds.
 
using fge::net::FullTimestamp = uint64_t
 An timestamp represent current time in milliseconds.
 
using fge::net::FullTimestampOffset = int64_t
 An timestamp offset.
 
using fge::net::Latency_ms = uint16_t
 An latency represent the latency of the client->server / server->client connection.
 
using fge::net::TransmissionPacketPtr = std::shared_ptr<TransmissionPacket>
 

Functions

FGE_API uint16_t fge::SwapHostNetEndian_16 (uint16_t n)
 Swap the endianness of a 16-bit integer.
 
FGE_API uint32_t fge::SwapHostNetEndian_32 (uint32_t n)
 Swap the endianness of a 32-bit integer.
 
FGE_API uint64_t fge::SwapHostNetEndian_64 (uint64_t n)
 Swap the endianness of a 64-bit integer.
 
FGE_API float fge::SwapHostNetEndian_f (float n)
 Swap the endianness of a float.
 
FGE_API double fge::SwapHostNetEndian_d (double n)
 Swap the endianness of a double.
 
FGE_API uint16_t fge::SwapEndian_16 (uint16_t n)
 Swap the endianness of a 16-bit integer.
 
FGE_API uint32_t fge::SwapEndian_32 (uint32_t n)
 Swap the endianness of a 32-bit integer.
 
FGE_API uint64_t fge::SwapEndian_64 (uint64_t n)
 Swap the endianness of a 64-bit integer.
 
FGE_API float fge::SwapEndian_f (float n)
 Swap the endianness of a float.
 
FGE_API double fge::SwapEndian_d (double n)
 Swap the endianness of a double.
 
FGE_API bool fge::IsBigEndian ()
 Check if the endianness of the system is big endian.
 
FGE_API uint32_t fge::net::GetSceneChecksum (fge::Scene &scene)
 Get a basic scene checksum.
 
FGE_API bool fge::net::WritePacketDataToFile (fge::net::Packet &pck, std::string const &file)
 Utility function to write packet data into a file.
 
bool fge::net::CheckSkey (fge::net::Packet &pck, fge::net::Skey skey)
 Shortcut function that will extract and compare the provided skey.
 
fge::net::Skey fge::net::GetSkey (fge::net::Packet &pck)
 Shortcut function that will extract the skey.
 

Detailed Description

Everything related to network.

Typedef Documentation

◆ FullTimestamp

using fge::net::FullTimestamp = uint64_t

An timestamp represent current time in milliseconds.

◆ FullTimestampOffset

An timestamp offset.

◆ Latency_ms

using fge::net::Latency_ms = uint16_t

An latency represent the latency of the client->server / server->client connection.

◆ Skey

using fge::net::Skey = uint32_t

The session key can be used to identify a client when connecting to a server.

◆ Timestamp

using fge::net::Timestamp = uint16_t

An timestamp represent modulated current time in milliseconds.

Function Documentation

◆ CheckSkey()

bool fge::net::CheckSkey ( fge::net::Packet & pck,
fge::net::Skey skey )
inline

Shortcut function that will extract and compare the provided skey.

Parameters
pckThe Packet
skeyAn skey that will be compared
Returns
true if the skey is the same and the packet is valid, false otherwise

◆ GetSceneChecksum()

FGE_API uint32_t fge::net::GetSceneChecksum ( fge::Scene & scene)

Get a basic scene checksum.

The checksum is computed with every ObjectSid.

Parameters
sceneThe scene
Returns
A 32bit checksum value

◆ GetSkey()

fge::net::Skey fge::net::GetSkey ( fge::net::Packet & pck)
inline

Shortcut function that will extract the skey.

Parameters
pckThe Packet
Returns
The extracted skey

◆ IsBigEndian()

FGE_API bool fge::IsBigEndian ( )

Check if the endianness of the system is big endian.

Returns
true if the endianness is big endian, false otherwise

◆ SwapEndian_16()

FGE_API uint16_t fge::SwapEndian_16 ( uint16_t n)

Swap the endianness of a 16-bit integer.

This function swap whatever the endianness of the value is.

Parameters
nThe value to swap
Returns
The maybe swapped value

◆ SwapEndian_32()

FGE_API uint32_t fge::SwapEndian_32 ( uint32_t n)

Swap the endianness of a 32-bit integer.

This function swap whatever the endianness of the value is.

Parameters
nThe value to swap
Returns
The maybe swapped value

◆ SwapEndian_64()

FGE_API uint64_t fge::SwapEndian_64 ( uint64_t n)

Swap the endianness of a 64-bit integer.

This function swap whatever the endianness of the value is.

Parameters
nThe value to swap
Returns
The maybe swapped value

◆ SwapEndian_d()

FGE_API double fge::SwapEndian_d ( double n)

Swap the endianness of a double.

This function swap whatever the endianness of the value is.

Parameters
nThe value to swap
Returns
The maybe swapped value

◆ SwapEndian_f()

FGE_API float fge::SwapEndian_f ( float n)

Swap the endianness of a float.

This function swap whatever the endianness of the value is.

Parameters
nThe value to swap
Returns
The maybe swapped value

◆ SwapHostNetEndian_16()

FGE_API uint16_t fge::SwapHostNetEndian_16 ( uint16_t n)

Swap the endianness of a 16-bit integer.

This function does nothing if the endianness is already big endian.

Parameters
nThe value to swap
Returns
The maybe swapped value

◆ SwapHostNetEndian_32()

FGE_API uint32_t fge::SwapHostNetEndian_32 ( uint32_t n)

Swap the endianness of a 32-bit integer.

This function does nothing if the endianness is already big endian.

Parameters
nThe value to swap
Returns
The maybe swapped value

◆ SwapHostNetEndian_64()

FGE_API uint64_t fge::SwapHostNetEndian_64 ( uint64_t n)

Swap the endianness of a 64-bit integer.

This function does nothing if the endianness is already big endian.

Parameters
nThe value to swap
Returns
The maybe swapped value

◆ SwapHostNetEndian_d()

FGE_API double fge::SwapHostNetEndian_d ( double n)

Swap the endianness of a double.

This function does nothing if the endianness is already little endian.

Parameters
nThe value to swap
Returns
The maybe swapped value

◆ SwapHostNetEndian_f()

FGE_API float fge::SwapHostNetEndian_f ( float n)

Swap the endianness of a float.

This function does nothing if the endianness is already little endian.

Parameters
nThe value to swap
Returns
The maybe swapped value

◆ WritePacketDataToFile()

FGE_API bool fge::net::WritePacketDataToFile ( fge::net::Packet & pck,
std::string const & file )

Utility function to write packet data into a file.

Parameters
pckThe Packet
fileThe file path that will contain the data
Returns
true if no error, false otherwise