OpenTTD Source: src/network/network_server.h File Reference

OpenTTD Source 15.0-RC2

Data Structures | Typedefs | Functions | Variables
network_server.h File Reference

Server part of the network protocol. More...

`#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.
using | NetworkClientSocketPool = Pool< NetworkClientSocket, ClientPoolID, 8, PoolType::NetworkClient >
| Pool with all client sockets.

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

## Variables
NetworkClientSocketPool | _networkclientsocket_pool

## Detailed Description

Server part of the network protocol.

Definition in file network_server.h.

## Typedef Documentation

## ◆ NetworkClientSocket

typedef ServerNetworkGameSocketHandler NetworkClientSocket

Make the code look slightly nicer/simpler.

Definition at line 18 of file network_server.h.

## ◆ NetworkClientSocketPool

using NetworkClientSocketPool = Pool<NetworkClientSocket, ClientPoolID, 8, PoolType::NetworkClient>

Pool with all client sockets.

Definition at line 20 of file network_server.h.

## Function Documentation

## ◆ ChangeNetworkRestartTime()

void ChangeNetworkRestartTime | ( | bool | reset | ) |

Reset the automatic network restart time interval.

Parameters

  reset | Whether to reset the timer to zero.

Definition at line 1847 of file network_server.cpp.

References _network_restart_map_timer, _network_server, _settings_client, ClientSettings::network, NetworkSettings::restart_hours, IntervalTimer< TTimerType >::SetInterval(), 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_frame | Whether to send the frame to the clients.

Definition at line 1679 of file network_server.cpp.

References _frame_counter, _last_sync_frame, _settings_client, NetworkSettings::bytes_per_frame, NetworkSettings::bytes_per_frame_burst, CC_WARNING, Ticks::DAY_TICKS, IConsolePrint(), NetworkSettings::max_download_time, NetworkSettings::max_init_time, NetworkSettings::max_join_time, NetworkSettings::max_lag_time, NetworkSettings::max_password_time, MILLISECONDS_PER_TICK, ClientSettings::network, NetworkHandleCommandQueue(), and NetworkSettings::sync_freq.