OpenTTD Source  20241108-master-g80f628063a
core.h File Reference

Base for all network types (UDP and TCP) More...

#include "../../newgrf_config.h"
#include "../network_crypto.h"
#include "config.h"

Go to the source code of this file.

Data Structures

class  NetworkSocketHandler
 SocketHandler for all network sockets in OpenTTD. More...
 

Enumerations

enum  NetworkRecvStatus {
  NETWORK_RECV_STATUS_OKAY , NETWORK_RECV_STATUS_DESYNC , NETWORK_RECV_STATUS_NEWGRF_MISMATCH , NETWORK_RECV_STATUS_SAVEGAME ,
  NETWORK_RECV_STATUS_CLIENT_QUIT , NETWORK_RECV_STATUS_MALFORMED_PACKET , NETWORK_RECV_STATUS_SERVER_ERROR , NETWORK_RECV_STATUS_SERVER_FULL ,
  NETWORK_RECV_STATUS_SERVER_BANNED , NETWORK_RECV_STATUS_CLOSE_QUERY , NETWORK_RECV_STATUS_CONNECTION_LOST
}
 Status of a network client; reasons why a client has quit. More...
 

Functions

bool NetworkCoreInitialize ()
 Initializes the network core (as that is needed for some platforms. More...
 
void NetworkCoreShutdown ()
 Shuts down the network core (as that is needed for some platforms.
 

Detailed Description

Base for all network types (UDP and TCP)

Definition in file core.h.

Enumeration Type Documentation

◆ NetworkRecvStatus

Status of a network client; reasons why a client has quit.

Enumerator
NETWORK_RECV_STATUS_OKAY 

Everything is okay.

NETWORK_RECV_STATUS_DESYNC 

A desync did occur.

NETWORK_RECV_STATUS_NEWGRF_MISMATCH 

We did not have the required NewGRFs.

NETWORK_RECV_STATUS_SAVEGAME 

Something went wrong (down)loading the savegame.

NETWORK_RECV_STATUS_CLIENT_QUIT 

The connection is lost gracefully. Other clients are already informed of this leaving client.

NETWORK_RECV_STATUS_MALFORMED_PACKET 

We apparently send a malformed packet.

NETWORK_RECV_STATUS_SERVER_ERROR 

The server told us we made an error.

NETWORK_RECV_STATUS_SERVER_FULL 

The server is full.

NETWORK_RECV_STATUS_SERVER_BANNED 

The server has banned us.

NETWORK_RECV_STATUS_CLOSE_QUERY 

Done querying the server.

NETWORK_RECV_STATUS_CONNECTION_LOST 

The connection is lost unexpectedly.

Definition at line 23 of file core.h.

Function Documentation

◆ NetworkCoreInitialize()

bool NetworkCoreInitialize ( )

Initializes the network core (as that is needed for some platforms.

Returns
true if the core has been initialized, false otherwise

Definition at line 24 of file core.cpp.

References Debug.

Referenced by NetworkStartUp().