Nexus Engine  v0.0.1
Loading...
Searching...
No Matches
Packet.cppm File Reference
#include <Platform/DLL/Export.hpp>
#include "Packet.inl"
import std;
import NE.Engine.Core.Types;
Include dependency graph for Packet.cppm:

Classes

struct  Nexus::Network::PacketHeader
class  Nexus::Network::Packet

Namespaces

namespace  Nexus
namespace  Nexus::Network
namespace  Nexus::Network::Wire
 Wire values are always sent big-endian.

Enumerations

enum class  Nexus::Network::PacketType : uint16 {
  Nexus::Network::ClientHello , Nexus::Network::ServerHello , Nexus::Network::PlayerInput , Nexus::Network::PlayerState ,
  Nexus::Network::SpawnEntity , Nexus::Network::DestroyEntity , Nexus::Network::ChatMessage
}

Functions

template<std::integral T>
constexpr T Nexus::Network::Wire::HostToBigEndian (T value) noexcept
template<std::integral T>
constexpr T Nexus::Network::Wire::BigEndianToHost (T value) noexcept
template<std::integral T>
void Nexus::Network::Wire::Append (std::vector< byte > &buffer, T value)
template<std::integral T>
bool Nexus::Network::Wire::Read (std::span< const byte > data, usize &offset, T &out)

Variables

constexpr usize Nexus::Network::HEADER_SIZE = sizeof(uint32) + sizeof(PacketType) + sizeof(uint32)
constexpr uint32 Nexus::Network::MAX_PAYLOAD_SIZE = 1u << 20
constexpr usize Nexus::Network::MAX_FRAME_SIZE = HEADER_SIZE + static_cast<usize>(MAX_PAYLOAD_SIZE)