PGE API 0.4
PR00F's Game Engine full documentation
Loading...
Searching...
No Matches
pge_network Namespace Reference

These packet and message structs are sent between server and clients. More...

Detailed Description

These packet and message structs are sent between server and clients.

Different endianness is not considered as an issue because all machines expected to use this have same endianness for now. In case this changes in the future, use a lib like cereal to easily solve endianness issue.

Since we tx/rx/memcpy these structs, we have expectations of their memory layout, so we keep them POD as defined by C++11/14/17:

"A pointer to a standard-layout class may be converted (with reinterpret_cast) to a pointer to its first non-static data member and vice versa. If a standard-layout union holds two or more standard-layout structs, it is permitted to inspect the common initial part of them. The macro offsetof is only guaranteed to be usable with standard-layout classes." (https://en.cppreference.com/w/cpp/types/is_standard_layout)

"Objects of trivially-copyable types that are not potentially-overlapping subobjects are the only C++ objects that may be safely copied with std::memcpy or serialized to/from binary files with std::ofstream::write() / std::ifstream::read()." (https://en.cppreference.com/w/cpp/types/is_trivially_copyable)

Classes

struct  MsgApp
 
struct  MsgAppArea
 
struct  MsgClientAppVersionFromClient
 
struct  MsgUserConnectedServerSelf
 
struct  MsgUserDisconnectedFromServer
 
class  PgeClient
 The primary interface to client networking functionality. More...
 
class  PgeClientStub
 The primary interface to stubbed client networking functionality. More...
 
class  PgeIClient
 The primary interface to client networking functionality. More...
 
class  PgeINetwork
 The primary interface to networking functionality. More...
 
class  PgeIServer
 The primary interface to server networking functionality. More...
 
class  PgeIServerClient
 PGE Network Client and Server Common Interface class. More...
 
class  PgeNetwork
 The primary interface to networking functionality. More...
 
class  PgeNetworkStub
 The primary interface to stubbed networking functionality. More...
 
struct  PgePacket
 PgePacket is the carrier of information over the network. More...
 
class  PgeServer
 The primary interface to server networking functionality. More...
 
class  PgeServerStub
 The primary interface to stubbed server networking functionality. More...
 

Typedefs

typedef uint32_t PgeNetworkConnectionHandle
 
typedef uint8_t TByte
 

Enumerations

enum class  PgePktId : uint32_t { UserConnectedServerSelf = 0 , UserDisconnectedFromServer , ClientAppVersion , Application }
 

Variables

constexpr PgeNetworkConnectionHandle ServerConnHandle = 0
 

Typedef Documentation

◆ PgeNetworkConnectionHandle

Definition at line 54 of file PgePacket.h.

◆ TByte

typedef uint8_t pge_network::TByte

Definition at line 120 of file PgePacket.h.

Enumeration Type Documentation

◆ PgePktId

enum class pge_network::PgePktId : uint32_t
strong
Enumerator
UserConnectedServerSelf 
UserDisconnectedFromServer 
ClientAppVersion 
Application 

Definition at line 60 of file PgePacket.h.

Variable Documentation

◆ ServerConnHandle

PgeNetworkConnectionHandle pge_network::ServerConnHandle = 0
constexpr

Definition at line 58 of file PgePacket.h.