OpenTTD Source  20240919-master-gdf0233f4c2
network_server.h File Reference
#include "network_internal.h"
#include "core/tcp_listen.h"

Go to the source code of this file.

Data Structures

class  ServerNetworkGameSocketHandler
 Class for handling the server side of the game connection. More...
 

Typedefs

typedef ServerNetworkGameSocketHandler NetworkClientSocket
 Make the code look slightly nicer/simpler.
 
typedef Pool< NetworkClientSocket, ClientIndex, 8, MAX_CLIENT_SLOTS, PT_NCLIENTNetworkClientSocketPool
 Pool with all client sockets.
 

Functions

void NetworkServer_Tick (bool send_frame)
 This is called every tick if this is a _network_server. More...
 
void ChangeNetworkRestartTime (bool reset)
 Reset the automatic network restart time interval. More...
 

Variables

NetworkClientSocketPool _networkclientsocket_pool
 Make very sure the preconditions given in network_type.h are actually followed. More...
 

Detailed Description

Server part of the network protocol.

Definition in file network_server.h.

Function Documentation

◆ ChangeNetworkRestartTime()

void ChangeNetworkRestartTime ( bool  reset)

Reset the automatic network restart time interval.

Parameters
resetWhether to reset the timer to zero.

Definition at line 1853 of file network_server.cpp.

References _network_restart_map_timer, _network_server, _settings_client, ClientSettings::network, NetworkSettings::restart_hours, and TimerGameRealtime::UNPAUSED.

Referenced by NetworkOnGameStart().

◆ NetworkServer_Tick()

void NetworkServer_Tick ( bool  send_frame)

This is called every tick if this is a _network_server.

Parameters
send_frameWhether to send the frame to the clients.

Definition at line 1685 of file network_server.cpp.

References _frame_counter, _last_sync_frame, _settings_client, NetworkSettings::bytes_per_frame, NetworkSettings::bytes_per_frame_burst, ClientSettings::network, and NetworkSettings::sync_freq.

Variable Documentation

◆ _networkclientsocket_pool

NetworkClientSocketPool _networkclientsocket_pool

Make very sure the preconditions given in network_type.h are actually followed.

Yes... The pool with clients.