Project Alice
Loading...
Searching...
No Matches
network Namespace Reference

Classes

struct  client_data
 
struct  client_handshake_data
 
struct  local_addresses
 
struct  network_state
 
class  port_forwarder
 
struct  server_handshake_data
 
class  SHA512
 

Typedefs

typedef int socket_t
 
typedef unsigned long long uint64
 

Functions

std::string get_last_error_msg ()
 
void clear_socket (sys::state &state, client_data &client)
 
void log_player_nations (sys::state &state)
 
dcon::mp_player_id create_mp_player (sys::state &state, sys::player_name &name, sys::player_password_raw &password)
 
dcon::mp_player_id load_mp_player (sys::state &state, sys::player_name &name, sys::player_password_hash &password_hash, sys::player_password_salt &password_salt)
 
void update_mp_player_password (sys::state &state, dcon::mp_player_id player_id, sys::player_password_raw &password)
 
dcon::mp_player_id find_mp_player (sys::state &state, sys::player_name name)
 
dcon::mp_player_id find_country_player (sys::state &state, dcon::nation_id nation)
 
void client_send_handshake (sys::state &state)
 
int client_process_handshake (sys::state &state)
 
void server_send_handshake (sys::state &state, network::client_data &client)
 
void init (sys::state &state)
 
void notify_player_joins (sys::state &state, sys::player_name name, dcon::nation_id nation, sys::player_password_raw password)
 
void notify_player_joins (sys::state &state, network::client_data &client)
 
void notify_player_joins_discovery (sys::state &state, network::client_data &client)
 
void send_savegame (sys::state &state, network::client_data &client, bool hotjoin=false)
 
void notify_start_game (sys::state &state, network::client_data &client)
 
void full_reset_after_oos (sys::state &state)
 
int server_process_handshake (sys::state &state, network::client_data &client)
 
int server_process_commands (sys::state &state, network::client_data &client)
 
bool pause_game (sys::state &state)
 
bool unpause_game (sys::state &state)
 
void write_network_save (sys::state &state)
 
void broadcast_save_to_clients (sys::state &state, command::payload &c, uint8_t const *buffer, uint32_t length, sys::checksum_key const &k)
 
void broadcast_to_clients (sys::state &state, command::payload &c)
 
void send_and_receive_commands (sys::state &state)
 
void finish (sys::state &state, bool notify_host)
 
void remove_player (sys::state &state, sys::player_name name)
 
void kick_player (sys::state &state, client_data &client)
 
void ban_player (sys::state &state, client_data &client)
 
void switch_player (sys::state &state, dcon::nation_id new_n, dcon::nation_id old_n)
 
void place_host_player_after_saveload (sys::state &state)
 
void load_host_settings (sys::state &state)
 
void save_host_settings (sys::state &state)
 
void notify_player_joins (sys::state &state, sys::player_name name, dcon::nation_id nation)
 
void read_player_nations (sys::state &state, char const *start, char const *end) noexcept
 
void load_player_nations (sys::state &state) noexcept
 
void write_player_nations (sys::state &state) noexcept
 
void every_tick_checks (sys::state &state) noexcept
 

Variables

SHA512 sha512
 
constexpr short default_server_port = 1984
 
unsigned int const SEQUENCE_LEN = (1024 / 64)
 
size_t const HASH_LEN = 8
 
size_t const WORKING_VAR_LEN = 8
 
size_t const MESSAGE_SCHEDULE_LEN = 80
 
size_t const MESSAGE_BLOCK_SIZE = 1024
 
size_t const CHAR_LEN_BITS = 8
 
size_t const OUTPUT_LEN = 8
 
size_t const WORD_LEN = 8
 

Typedef Documentation

◆ socket_t

typedef int network::socket_t

Definition at line 31 of file network.hpp.

◆ uint64

typedef unsigned long long network::uint64

Definition at line 27 of file SHA512.hpp.

Function Documentation

◆ ban_player()

void network::ban_player ( sys::state state,
client_data client 
)

Definition at line 1634 of file network.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ broadcast_save_to_clients()

void network::broadcast_save_to_clients ( sys::state state,
command::payload c,
uint8_t const *  buffer,
uint32_t  length,
sys::checksum_key const &  k 
)

Definition at line 1301 of file network.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ broadcast_to_clients()

void network::broadcast_to_clients ( sys::state state,
command::payload c 
)

Definition at line 1324 of file network.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clear_socket()

void network::clear_socket ( sys::state state,
client_data client 
)

Definition at line 502 of file network.cpp.

Here is the caller graph for this function:

◆ client_process_handshake()

int network::client_process_handshake ( sys::state state)

Definition at line 750 of file network.cpp.

Here is the caller graph for this function:

◆ client_send_handshake()

void network::client_send_handshake ( sys::state state)

Definition at line 737 of file network.cpp.

Here is the caller graph for this function:

◆ create_mp_player()

dcon::mp_player_id network::create_mp_player ( sys::state state,
sys::player_name name,
sys::player_password_raw password 
)

Definition at line 662 of file network.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ every_tick_checks()

void network::every_tick_checks ( sys::state state)
inlinenoexcept

Definition at line 99 of file persistent_server_extensions.hpp.

Here is the call graph for this function:

◆ find_country_player()

dcon::mp_player_id network::find_country_player ( sys::state state,
dcon::nation_id  nation 
)

Definition at line 702 of file network.cpp.

Here is the caller graph for this function:

◆ find_mp_player()

dcon::mp_player_id network::find_mp_player ( sys::state state,
sys::player_name  name 
)

Definition at line 690 of file network.cpp.

Here is the caller graph for this function:

◆ finish()

void network::finish ( sys::state state,
bool  notify_host 
)

Definition at line 1568 of file network.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ full_reset_after_oos()

void network::full_reset_after_oos ( sys::state state)

Definition at line 1064 of file network.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_last_error_msg()

std::string network::get_last_error_msg ( )

Definition at line 278 of file network.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init()

void network::init ( sys::state state)

Definition at line 832 of file network.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kick_player()

void network::kick_player ( sys::state state,
client_data client 
)

Definition at line 1628 of file network.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_host_settings()

void network::load_host_settings ( sys::state state)

Definition at line 1686 of file network.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_mp_player()

dcon::mp_player_id network::load_mp_player ( sys::state state,
sys::player_name name,
sys::player_password_hash password_hash,
sys::player_password_salt password_salt 
)

Definition at line 674 of file network.cpp.

Here is the caller graph for this function:

◆ load_player_nations()

void network::load_player_nations ( sys::state state)
inlinenoexcept

Definition at line 66 of file persistent_server_extensions.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ log_player_nations()

void network::log_player_nations ( sys::state state)

Definition at line 527 of file network.cpp.

Here is the caller graph for this function:

◆ notify_player_joins() [1/3]

void network::notify_player_joins ( sys::state state,
network::client_data client 
)

Definition at line 918 of file network.cpp.

◆ notify_player_joins() [2/3]

void network::notify_player_joins ( sys::state state,
sys::player_name  name,
dcon::nation_id  nation 
)

◆ notify_player_joins() [3/3]

void network::notify_player_joins ( sys::state state,
sys::player_name  name,
dcon::nation_id  nation,
sys::player_password_raw  password 
)

Definition at line 895 of file network.cpp.

Here is the call graph for this function:

◆ notify_player_joins_discovery()

void network::notify_player_joins_discovery ( sys::state state,
network::client_data client 
)

Definition at line 922 of file network.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ notify_start_game()

void network::notify_start_game ( sys::state state,
network::client_data client 
)

Definition at line 1002 of file network.cpp.

◆ pause_game()

bool network::pause_game ( sys::state state)

Definition at line 1246 of file network.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ place_host_player_after_saveload()

void network::place_host_player_after_saveload ( sys::state state)

Definition at line 1667 of file network.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_player_nations()

void network::read_player_nations ( sys::state state,
char const *  start,
char const *  end 
)
inlinenoexcept

Definition at line 22 of file persistent_server_extensions.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ remove_player()

void network::remove_player ( sys::state state,
sys::player_name  name 
)

Definition at line 1613 of file network.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ save_host_settings()

void network::save_host_settings ( sys::state state)

Definition at line 1710 of file network.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_and_receive_commands()

void network::send_and_receive_commands ( sys::state state)

Definition at line 1368 of file network.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_savegame()

void network::send_savegame ( sys::state state,
network::client_data client,
bool  hotjoin = false 
)

Definition at line 943 of file network.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ server_process_commands()

int network::server_process_commands ( sys::state state,
network::client_data client 
)

Definition at line 1181 of file network.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ server_process_handshake()

int network::server_process_handshake ( sys::state state,
network::client_data client 
)

Definition at line 1131 of file network.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ server_send_handshake()

void network::server_send_handshake ( sys::state state,
network::client_data client 
)

Definition at line 807 of file network.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ switch_player()

void network::switch_player ( sys::state state,
dcon::nation_id  new_n,
dcon::nation_id  old_n 
)

Definition at line 1650 of file network.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unpause_game()

bool network::unpause_game ( sys::state state)

Definition at line 1261 of file network.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_mp_player_password()

void network::update_mp_player_password ( sys::state state,
dcon::mp_player_id  player_id,
sys::player_password_raw password 
)

Definition at line 683 of file network.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_network_save()

void network::write_network_save ( sys::state state)

Definition at line 1268 of file network.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_player_nations()

void network::write_player_nations ( sys::state state)
inlinenoexcept

Definition at line 80 of file persistent_server_extensions.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ CHAR_LEN_BITS

size_t const network::CHAR_LEN_BITS = 8

Definition at line 35 of file SHA512.hpp.

◆ default_server_port

constexpr short network::default_server_port = 1984
inlineconstexpr

Definition at line 26 of file network.hpp.

◆ HASH_LEN

size_t const network::HASH_LEN = 8

Definition at line 31 of file SHA512.hpp.

◆ MESSAGE_BLOCK_SIZE

size_t const network::MESSAGE_BLOCK_SIZE = 1024

Definition at line 34 of file SHA512.hpp.

◆ MESSAGE_SCHEDULE_LEN

size_t const network::MESSAGE_SCHEDULE_LEN = 80

Definition at line 33 of file SHA512.hpp.

◆ OUTPUT_LEN

size_t const network::OUTPUT_LEN = 8

Definition at line 36 of file SHA512.hpp.

◆ SEQUENCE_LEN

unsigned int const network::SEQUENCE_LEN = (1024 / 64)

Definition at line 30 of file SHA512.hpp.

◆ sha512

SHA512 network::sha512

Definition at line 60 of file network.cpp.

◆ WORD_LEN

size_t const network::WORD_LEN = 8

Definition at line 37 of file SHA512.hpp.

◆ WORKING_VAR_LEN

size_t const network::WORKING_VAR_LEN = 8

Definition at line 32 of file SHA512.hpp.