R-Type 0.1
Loading...
Searching...
No Matches
NetworkEvent.hpp
1#pragma once
2
3#include <cstdint>
4
5namespace rtype::events {
15 std::uint32_t clientId = 0;
16 std::uint32_t playerNetworkId = 0;
17 std::uint32_t serverTick = 0;
18};
19
24 std::uint8_t reason = 0;
25};
26
31 std::vector<std::uint8_t> data;
32};
33
38 std::uint32_t serverTick;
39 std::uint32_t networkId;
40 std::uint16_t entityType;
41 float positionX;
42 float positionY;
43 float rotation;
44};
45
47} // namespace rtype::events
Published when the server accepted the handshake.
Definition NetworkEvent.hpp:14
std::uint32_t clientId
Connection id given by the server.
Definition NetworkEvent.hpp:15
std::uint32_t serverTick
Server tick at connection time.
Definition NetworkEvent.hpp:17
std::uint32_t playerNetworkId
Network id of the local ship.
Definition NetworkEvent.hpp:16
Published when the server refused the handshake.
Definition NetworkEvent.hpp:23
std::uint8_t reason
Refusal reason.
Definition NetworkEvent.hpp:24
Decoded CreateEntity message in world units.
Definition NetworkEvent.hpp:37
float positionY
Vertical position in pixels.
Definition NetworkEvent.hpp:42
std::uint32_t serverTick
Server tick at sending time.
Definition NetworkEvent.hpp:38
float rotation
Rotation in radians.
Definition NetworkEvent.hpp:43
std::uint16_t entityType
Archetype id of the entity blueprint.
Definition NetworkEvent.hpp:40
float positionX
Horizontal position in pixels.
Definition NetworkEvent.hpp:41
std::uint32_t networkId
Identifier of the entity.
Definition NetworkEvent.hpp:39
Asks the network client to send raw bytes to the server.
Definition NetworkEvent.hpp:30
std::vector< std::uint8_t > data
Datagram to send.
Definition NetworkEvent.hpp:31