# network_type.h File Reference

Types used for networking. More...

`#include "core/game.h"`

Go to the source code of this file.

## Data Structures

struct | NetworkCompanyStats
| Simple calculated statistics of a company. More...
struct | NetworkCompanyState
| Some state information of a company, especially for servers. More...

## Typedefs

typedef uint8 | ClientIndex
| Indices into the client tables.

## Enumerations

enum | { MAX_CLIENTS = 255, MAX_CLIENT_SLOTS = 256, NETWORK_VEHICLE_TYPES = 5, NETWORK_STATION_TYPES = 5 }
enum | ClientID { INVALID_CLIENT_ID = 0, CLIENT_ID_SERVER = 1, CLIENT_ID_FIRST = 2 }
| 'Unique' identifier to be given to clients More...
enum | NetworkPasswordType { NETWORK_GAME_PASSWORD, NETWORK_COMPANY_PASSWORD }
enum | DestType { DESTTYPE_BROADCAST, DESTTYPE_TEAM, DESTTYPE_CLIENT }
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 }
| Actions that can be used for NetworkTextMessage.

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
}

## Detailed Description

Types used for networking.

Definition in file network_type.h.

## Enumeration Type Documentation

anonymous enum

Enumerator:

  MAX_CLIENTS | How many clients can we have.
  MAX_CLIENT_SLOTS | 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.
  NETWORK_VEHICLE_TYPES | How many vehicle/station types we put over the network.

Definition at line 19 of file network_type.h.

enum 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 36 of file network_type.h.

enum DestType

Enumerator:

  DESTTYPE_BROADCAST | Send message/notice to all clients (All).
  DESTTYPE_TEAM | Send message/notice to everyone playing the same company (Team).
  DESTTYPE_CLIENT | Send message/notice to only a certain client (Private).

Definition at line 65 of file network_type.h.