Types used for networking.
More...
Go to the source code of this file.
|
| using | ClientPoolID = PoolID<uint16_t, struct ClientPoolIDTag, MAX_CLIENTS + 1 , 0xFFFF> |
| | Indices into the client related pools.
|
| using | AdminID = PoolID<uint8_t, struct AdminIDTag, 16, 0xFF> |
| | Indices into the admin tables.
|
|
| enum class | NetworkVehicleType : uint8_t {
Train = 0
, Truck
, Bus
, Aircraft
,
Ship
, End
} |
| | Vehicletypes in the order they are send in info packets. More...
|
| enum class | ServerGameType : uint8_t { Local = 0
, Public
, InviteOnly
} |
| | 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 class | NetworkChatDestinationType : uint8_t { Broadcast
, Team
, Client
} |
| | Destination of our chat messages. More...
|
| enum class | NetworkAction : uint8_t {
ClientJoin
, ClientLeave
, ServerMessage
, ChatBroadcast
,
ChatTeam
, ChatClient
, GiveMoney
, ClientNameChange
,
CompanySpectator
, CompanyJoin
, CompanyNew
, ClientKicked
,
ChatExternal
} |
| | Actions that can be used for NetworkTextMessage. More...
|
| enum class | NetworkErrorCode : uint8_t {
General
, Desync
, SavegameFailed
, ConnectionLost
,
IllegalPacket
, NewGRFMismatch
, NotAuthorized
, NotExpected
,
WrongRevision
, NameInUse
, WrongPassword
, CompanyMismatch
,
Kicked
, Cheater
, ServerFull
, TooManyCommands
,
TimeoutPassword
, TimeoutComputer
, TimeoutMap
, TimeoutJoin
,
InvalidClientName
, NotOnAllowList
, NoAuthenticationMethodAvailable
} |
| | The error codes we send around in the protocols. More...
|
|
| static const uint | MAX_CLIENTS = 255 |
| | How many clients can we have.
|
Types used for networking.
Definition in file network_type.h.
◆ AdminID
◆ ClientPoolID
Indices into the client related pools.
Definition at line 50 of file network_type.h.
◆ ClientID
'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 43 of file network_type.h.
◆ NetworkAction
Actions that can be used for NetworkTextMessage.
- Warning
- The values of the enum items are part of the admin network API. Only append at the end.
| Enumerator |
|---|
| ClientJoin | A client joined the server.
|
| ClientLeave | A client left the server.
|
| ServerMessage | The server sent a message.
|
| ChatBroadcast | A chat broadcast to all clients.
|
| ChatTeam | A chat sent to all clients of a team/company.
|
| ChatClient | A chat sent to a specific client.
|
| GiveMoney | A company was given money.
|
| ClientNameChange | A client changed their name.
|
| CompanySpectator | A client joined the spectators.
|
| CompanyJoin | A client joined an existing company.
|
| CompanyNew | A client created an joined a new company.
|
| ClientKicked | A client got kicked.
|
| ChatExternal | An external application sent a message over the admin port.
|
Definition at line 79 of file network_type.h.
◆ NetworkChatDestinationType
Destination of our chat messages.
- Warning
- The values of the enum items are part of the admin network API. Only append at the end.
| Enumerator |
|---|
| Broadcast | Send message/notice to all clients (All).
|
| Team | Send message/notice to everyone playing the same company (Team).
|
| Client | Send message/notice to only a certain client (Private).
|
Definition at line 69 of file network_type.h.
◆ NetworkErrorCode
The error codes we send around in the protocols.
- Warning
- The values of the enum items are part of the admin network API. Only append at the end.
| Enumerator |
|---|
| General | Fallback error code in case nothing matches.
|
| Desync | Client tells that they desynced.
|
| SavegameFailed | Client tells they could not load the savegame.
|
| ConnectionLost | Connection to the client was lost.
|
| IllegalPacket | A packet was received that has invalid content.
|
| NewGRFMismatch | Client does not have the right NewGRFs.
|
| NotAuthorized | The client tried to do something there are not authorized to.
|
| NotExpected | The request/packet was not expected in the current state.
|
| WrongRevision | The client is using the wrong revision.
|
| NameInUse | The client has a duplicate name (and we couldn't make it unique).
|
| WrongPassword | The client entered a wrong password.
|
| CompanyMismatch | The client was impersonating another company.
|
| Kicked | The client got kicked.
|
| Cheater | The client is trying control companies in a way they are not supposed to.
|
| ServerFull | The server is full.
|
| TooManyCommands | The client has sent too many commands in a short time.
|
| TimeoutPassword | The client has timed out providing a password.
|
| TimeoutComputer | The client has timed out because the computer could not keep up with the server.
|
| TimeoutMap | The client has timed out because it took too long to download the map.
|
| TimeoutJoin | The client has timed out because getting up to speed with the server failed.
|
| InvalidClientName | The client tried to set an invalid name.
|
| NotOnAllowList | The client is not on the allow list.
|
| NoAuthenticationMethodAvailable | The client and server could not find a common authentication method.
|
Definition at line 99 of file network_type.h.
◆ NetworkVehicleType
Vehicletypes in the order they are send in info packets.
| Enumerator |
|---|
| Train | A train.
|
| Truck | A road vehicle that stops at truck stops.
|
| Bus | A road vehicle that stops at bus stops.
|
| Aircraft | An airplane or helicopter.
|
| Ship | A ship.
|
| End | End marker for array sizes.
|
Definition at line 22 of file network_type.h.
◆ ServerGameType
Game type the server can be using.
Used on the network protocol to communicate with Game Coordinator.
| Enumerator |
|---|
| Local | Do not communicate with the game coordinator.
|
| Public | The game is publicly accessible.
|
| InviteOnly | The game can be accessed if you know the invite code.
|
Definition at line 36 of file network_type.h.
◆ MAX_CLIENTS
| const uint MAX_CLIENTS = 255 |
|
static |