OpenTTD Source
20241124-master-g9399a92a4f
|
Types used for networking. More...
#include "../core/enum_type.hpp"
Go to the source code of this file.
Data Structures | |
struct | NetworkCompanyStats |
Simple calculated statistics of a company. More... | |
class | NetworkAuthorizedKeys |
Simple helper to (more easily) manage authorized keys. More... | |
Typedefs | |
typedef uint8_t | ClientIndex |
Indices into the client tables. | |
typedef uint8_t | AdminIndex |
Indices into the admin tables. | |
Enumerations | |
enum | NetworkVehicleType { NETWORK_VEH_TRAIN = 0 , NETWORK_VEH_LORRY , NETWORK_VEH_BUS , NETWORK_VEH_PLANE , NETWORK_VEH_SHIP , NETWORK_VEH_END } |
Vehicletypes in the order they are send in info packets. | |
enum | ServerGameType : uint8_t { SERVER_GAME_TYPE_LOCAL = 0 , SERVER_GAME_TYPE_PUBLIC , SERVER_GAME_TYPE_INVITE_ONLY } |
Game type the server can be using. More... | |
enum | ClientID : uint32_t { INVALID_CLIENT_ID = 0 , CLIENT_ID_SERVER = 1 , CLIENT_ID_FIRST = 2 } |
'Unique' identifier to be given to clients More... | |
enum | DestType : uint8_t { DESTTYPE_BROADCAST , DESTTYPE_TEAM , DESTTYPE_CLIENT } |
Destination of our chat messages. More... | |
enum | NetworkAction { NETWORK_ACTION_JOIN , NETWORK_ACTION_LEAVE , NETWORK_ACTION_SERVER_MESSAGE , NETWORK_ACTION_CHAT , NETWORK_ACTION_CHAT_COMPANY , NETWORK_ACTION_CHAT_CLIENT , NETWORK_ACTION_GIVE_MONEY , NETWORK_ACTION_NAME_CHANGE , NETWORK_ACTION_COMPANY_SPECTATOR , NETWORK_ACTION_COMPANY_JOIN , NETWORK_ACTION_COMPANY_NEW , NETWORK_ACTION_KICKED , NETWORK_ACTION_EXTERNAL_CHAT } |
Actions that can be used for NetworkTextMessage. More... | |
enum | NetworkErrorCode { NETWORK_ERROR_GENERAL , NETWORK_ERROR_DESYNC , NETWORK_ERROR_SAVEGAME_FAILED , NETWORK_ERROR_CONNECTION_LOST , NETWORK_ERROR_ILLEGAL_PACKET , NETWORK_ERROR_NEWGRF_MISMATCH , NETWORK_ERROR_NOT_AUTHORIZED , NETWORK_ERROR_NOT_EXPECTED , NETWORK_ERROR_WRONG_REVISION , NETWORK_ERROR_NAME_IN_USE , NETWORK_ERROR_WRONG_PASSWORD , NETWORK_ERROR_COMPANY_MISMATCH , NETWORK_ERROR_KICKED , NETWORK_ERROR_CHEATER , NETWORK_ERROR_FULL , NETWORK_ERROR_TOO_MANY_COMMANDS , NETWORK_ERROR_TIMEOUT_PASSWORD , NETWORK_ERROR_TIMEOUT_COMPUTER , NETWORK_ERROR_TIMEOUT_MAP , NETWORK_ERROR_TIMEOUT_JOIN , NETWORK_ERROR_INVALID_CLIENT_NAME , NETWORK_ERROR_NOT_ON_ALLOW_LIST , NETWORK_ERROR_NO_AUTHENTICATION_METHOD_AVAILABLE , NETWORK_ERROR_END } |
The error codes we send around in the protocols. More... | |
Variables | |
static const uint | MAX_CLIENTS = 255 |
How many clients can we have. | |
static const uint | MAX_CLIENT_SLOTS = 256 |
The number of slots; must be at least 1 more than MAX_CLIENTS. More... | |
static const AdminIndex | MAX_ADMINS = 16 |
Maximum number of allowed admins. | |
static const AdminIndex | INVALID_ADMIN_ID = UINT8_MAX |
An invalid admin marker. | |
Types used for networking.
Definition in file network_type.h.
enum ClientID : uint32_t |
'Unique' identifier to be given to clients
Enumerator | |
---|---|
INVALID_CLIENT_ID | Client is not part of anything. |
CLIENT_ID_SERVER | Servers always have this ID. |
CLIENT_ID_FIRST | The first client ID. |
Definition at line 49 of file network_type.h.
enum DestType : uint8_t |
Destination of our chat messages.
Definition at line 79 of file network_type.h.
enum NetworkAction |
Actions that can be used for NetworkTextMessage.
Definition at line 90 of file network_type.h.
enum NetworkErrorCode |
The error codes we send around in the protocols.
Definition at line 110 of file network_type.h.
enum ServerGameType : uint8_t |
Game type the server can be using.
Used on the network protocol to communicate with Game Coordinator.
Definition at line 42 of file network_type.h.
|
static |
The number of slots; must be at least 1 more than MAX_CLIENTS.
It must furthermore be less than or equal to 256 as client indices (sent over the network) are 8 bits. It needs 1 more for the dedicated server.
Definition at line 23 of file network_type.h.