Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
NetClient.cpp File Reference
#include "precompiled.h"
#include "NetClient.h"
#include "lib/byte_order.h"
#include "lib/config2.h"
#include "lib/debug.h"
#include "lib/external_libraries/enet.h"
#include "lib/status.h"
#include "lib/utf8.h"
#include "lobby/XmppClient.h"
#include "network/NetClientSession.h"
#include "network/NetClientTurnManager.h"
#include "network/NetEnet.h"
#include "network/NetFileTransfer.h"
#include "network/NetMessage.h"
#include "network/NetProtocol.h"
#include "network/StunClient.h"
#include "ps/CLogger.h"
#include "ps/CStr.h"
#include "ps/Game.h"
#include "ps/Hashing.h"
#include "ps/Profile.h"
#include "ps/Threading.h"
#include "scriptinterface/JSON.h"
#include "scriptinterface/Context.h"
#include "scriptinterface/Interface.h"
#include "simulation2/Simulation2.h"
#include "simulation2/system/TurnManager.h"
#include <SDL_timer.h>
#include <algorithm>
#include <functional>
#include <iterator>
#include <js/GCAPI.h>
#include <js/Promise.h>
#include <js/TracingAPI.h>
#include <map>
#include <memory>
#include <sstream>
#include <utility>
Include dependency graph for NetClient.cpp:

Variables

constexpr std::uint32_t NETWORK_BAD_PING = DEFAULT_TURN_LENGTH * COMMAND_DELAY_MP / 2
 Once ping goes above turn length * command delay, the game will start 'freezing' for other clients while we catch up. More...
 
CNetClient * g_NetClient = NULL
 Global network client for the standard game. More...
 

Variable Documentation

◆ g_NetClient

CNetClient* g_NetClient = NULL

Global network client for the standard game.

◆ NETWORK_BAD_PING

constexpr std::uint32_t NETWORK_BAD_PING = DEFAULT_TURN_LENGTH * COMMAND_DELAY_MP / 2
constexpr

Once ping goes above turn length * command delay, the game will start 'freezing' for other clients while we catch up.

Since commands are sent client -> server -> client, divide by 2. (duplicated in NetServer.cpp to avoid having to fetch the constants in a header file)