![]() |
Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
|
#include "precompiled.h"#include "NetServer.h"#include "NetClient.h"#include "NetEnet.h"#include "NetMessage.h"#include "NetSession.h"#include "NetServerTurnManager.h"#include "NetStats.h"#include "lib/external_libraries/enet.h"#include "lib/types.h"#include "network/StunClient.h"#include "ps/CLogger.h"#include "ps/ConfigDB.h"#include "ps/GUID.h"#include "ps/Hashing.h"#include "ps/Profile.h"#include "ps/Threading.h"#include "scriptinterface/ScriptContext.h"#include "scriptinterface/ScriptInterface.h"#include "scriptinterface/JSON.h"#include "simulation2/Simulation2.h"#include "simulation2/system/TurnManager.h"#include <miniupnpc/miniwget.h>#include <miniupnpc/miniupnpc.h>#include <miniupnpc/upnpcommands.h>#include <miniupnpc/upnperrors.h>#include <set>#include <string>
Macros | |
| #define | MAX_CLIENTS 41 |
| Number of peers to allocate for the enet host. More... | |
| #define | DEFAULT_SERVER_NAME L"Unnamed Server" |
Functions | |
| static CStr | DebugName (CNetServerSession *session) |
Variables | |
| constexpr int | CHANNEL_COUNT = 1 |
| constexpr int | FAILED_PASSWORD_TRIES_BEFORE_BAN = 3 |
| static const int | HOST_SERVICE_TIMEOUT = 50 |
| enet_host_service timeout (msecs). More... | |
| constexpr u32 | 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... | |
| CNetServer * | g_NetServer = NULL |
| Global network server for the standard game. More... | |
| #define DEFAULT_SERVER_NAME L"Unnamed Server" |
| #define MAX_CLIENTS 41 |
Number of peers to allocate for the enet host.
Limited by ENET_PROTOCOL_MAXIMUM_PEER_ID (4096).
At most 8 players, 32 observers and 1 temporary connection to send the "server full" disconnect-reason.
|
static |
|
constexpr |
|
constexpr |
| CNetServer* g_NetServer = NULL |
Global network server for the standard game.
|
static |
enet_host_service timeout (msecs).
Smaller numbers may hurt performance; larger numbers will hurt latency responding to messages from game thread.
|
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)