OpenTTD
Data Structures | Enumerations | Functions
core.h File Reference

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

#include "../../newgrf_config.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_CONN_LOST, 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
}
 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

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_CONN_LOST 

The connection is 'just' lost.

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.

Definition at line 26 of file core.h.

Function Documentation

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 33 of file core.cpp.

References DEBUG.

Referenced by NetworkStartUp().