Leviathan  0.8.0.0
Leviathan game engine
CommonNetwork.h
Go to the documentation of this file.
1 // Leviathan Game Engine
2 // Copyright (c) 2012-2016 Henri Hyyryläinen
3 #pragma once
4 
5 #include <stdint.h>
6 
8 
9 namespace Leviathan {
10 
11 // magic numbers
12 constexpr uint16_t LEVIATHAN_NORMAL_PACKET = 0x4C6E;
13 
14 constexpr uint16_t LEVIATHAN_ACK_PACKET = 0x4C61;
15 
16 constexpr uint8_t NORMAL_RESPONSE_TYPE = 0x12;
17 
18 constexpr uint8_t NORMAL_REQUEST_TYPE = 0x28;
19 
20 
22 enum class NETWORKED_TYPE {
23 
24  Client,
25  Server,
26  Master,
28  Error
29 };
30 
32 
35  Unified
36 
39  // Timed,
40  //
43  // PacketsAfterReceived
44 };
45 
46 
47 
49 enum class RECEIVE_GUARANTEE {
50 
52  None,
53 
55  ResendOnce,
56 
59  Critical
60 };
61 
64 
66  Undecided,
67 
71  None,
72 
75  Standard
76 
78 };
79 
82 
84  None,
85  Localhost,
87  LAN,
88  Whitelist,
89  Invite,
90  Friends,
92  Custom
93 };
94 
96 enum class SERVER_STATUS : uint8_t {
97 
98  Starting,
99  Running,
100  Shutdown,
101  Restart
102 };
103 
106 
110 
113  Unsupported,
114 
116  ServerFull,
117 
120 
124 
127 
130 
133 };
134 
137 
140 
143 
145  Done
146 };
147 
148 } // namespace Leviathan
All values above this are application specific types.
Everyone can join the server.
Packet is sent once and if lost won't be resent.
constexpr uint8_t NORMAL_RESPONSE_TYPE
Definition: CommonNetwork.h:16
RECEIVE_GUARANTEE
Controls whether a packet is critical.
Definition: CommonNetwork.h:49
constexpr uint16_t LEVIATHAN_ACK_PACKET
Definition: CommonNetwork.h:14
The connection has not reached Secured state.
SERVER_ACCEPTED_TYPE
Defines what request the server accepted and any potential data.
SERVER_JOIN_RESTRICT
Allows servers to control who can join.
Definition: CommonNetwork.h:81
Server has accepted the request and will handle it soon.
constexpr uint16_t LEVIATHAN_NORMAL_PACKET
Definition: CommonNetwork.h:12
The server has used a custom rule to disallow this.
unsigned char uint8_t
Definition: core.h:38
Only set when the derived class forgot to set it.
NETWORKED_TYPE
Type of networked application.
Definition: CommonNetwork.h:22
Packet will get a single resend.
unsigned short uint16_t
Definition: core.h:39
SERVER_STATUS
Allows servers to tell clients what they are doing.
Definition: CommonNetwork.h:96
constexpr uint8_t NORMAL_REQUEST_TYPE
Definition: CommonNetwork.h:18
The client has already connected to the server, and must disconnect before trying again.
NETWORK_RESPONSE_INVALIDREASON
Defines in what way a request was invalid can also define why a server disallowed a request.
The access mask controls which registered functions and classes a script sees.
Definition: GameModule.h:12
CONNECTION_ENCRYPTION
State of a connection's encryption.
Definition: CommonNetwork.h:63
Server has accepted your join request.
The client has made a request with invalid or unsupported options.
Server has maximum number of players.