OpenTTD Source  12.0-beta2
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 NetworkServerSetCompanyPassword (CompanyID company_id, const std::string &password, bool already_hashed=true)
 Set/Reset a company password on the server end. More...
 
void NetworkServerUpdateCompanyPassworded (CompanyID company_id, bool passworded)
 Tell that a particular company is (not) passworded. 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

◆ 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 1634 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.

◆ NetworkServerSetCompanyPassword()

void NetworkServerSetCompanyPassword ( CompanyID  company_id,
const std::string &  password,
bool  already_hashed 
)

Set/Reset a company password on the server end.

Parameters
company_idID of the company the password should be changed for.
passwordThe new password.
already_hashedIs the given password already hashed?

Definition at line 1604 of file network_server.cpp.

References _network_company_states, _settings_client, _settings_game, GameSettings::game_creation, GenerateCompanyPasswordHash(), GameCreationSettings::generation_seed, Company::IsValidHumanID(), ClientSettings::network, NetworkSettings::network_id, NetworkServerUpdateCompanyPassworded(), and NetworkCompanyState::password.

Referenced by AdminCompanyUnlockCallback(), and NetworkChangeCompanyPassword().

◆ NetworkServerUpdateCompanyPassworded()

void NetworkServerUpdateCompanyPassworded ( CompanyID  company_id,
bool  passworded 
)

Tell that a particular company is (not) passworded.

Parameters
company_idThe company that got/removed the password.
passwordedWhether the password was received or removed.

Definition at line 1848 of file network_server.cpp.

References _network_company_passworded, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::GetIfValid(), NetworkAdminCompanyUpdate(), NetworkCompanyIsPassworded(), SB(), SetWindowClassesDirty(), and WC_COMPANY.

Referenced by NetworkAutoCleanCompanies(), NetworkServerNewCompany(), and NetworkServerSetCompanyPassword().

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.