OpenTTD Source 20260621-master-g720d10536d
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 class  NetworkRecvStatus : uint8_t {
  Okay , Desync , NewGRFMismatch , Savegame ,
  ClientQuit , MalformedPacket , ServerError , ServerFull ,
  ServerBanned , CloseQuery , ConnectionLost
}
 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.
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

enum class NetworkRecvStatus : uint8_t
strong

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

Enumerator
Okay 

Everything is okay.

Desync 

A desync did occur.

NewGRFMismatch 

We did not have the required NewGRFs.

Savegame 

Something went wrong (down)loading the savegame.

ClientQuit 

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

MalformedPacket 

We apparently send a malformed packet.

ServerError 

The server told us we made an error.

ServerFull 

The server is full.

ServerBanned 

The server has banned us.

CloseQuery 

Done querying the server.

ConnectionLost 

The connection is lost unexpectedly.

Definition at line 21 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 22 of file core.cpp.

References Debug.

Referenced by NetworkStartUp().

◆ NetworkCoreShutdown()

void NetworkCoreShutdown ( )

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

Definition at line 42 of file core.cpp.

Referenced by NetworkShutDown().