/* NewGRF check and authorized states should be handled almost instantly.
* So give them some lee-way, likewise for the query with inactive. */
if (lag > _settings_client.network.max_init_time) {
IConsolePrintF(CC_ERROR, "Client #%d is dropped because it took longer than %d ticks to start the joining process", cs->client_id, _settings_client.network.max_init_time);
cs->SendError(NETWORK_ERROR_TIMEOUT_COMPUTER);
continue;
}
break;
case NetworkClientSocket::STATUS_MAP_WAIT:
/* Send every two seconds a packet to the client, to make sure
* he knows the server is still there; just someone else is
* it knows the server is still there; just someone else is
* still receiving the map. */
if (std::chrono::steady_clock::now() > cs->last_packet + std::chrono::seconds(2)) {
cs->SendWait();
/* We need to reset the timer, as otherwise we will be
* spamming the client. Strictly speaking this variable
* tracks when we last received a packet from the client,
* but as he is waiting, he will not send us any till we
* but as it is waiting, it will not send us any till we
/* Downloading the map... this is the amount of time since starting the saving. */
if (lag > _settings_client.network.max_download_time) {
IConsolePrintF(CC_ERROR, "Client #%d is dropped because it took longer than %d ticks to download the map", cs->client_id, _settings_client.network.max_download_time);
cs->SendError(NETWORK_ERROR_TIMEOUT_MAP);
continue;
}
src/network/network_server.h
➞
Show inline comments
@@ -63,25 +63,25 @@ public:
STATUS_ACTIVE, ///< The client is active within in the game.
STATUS_END, ///< Must ALWAYS be on the end of this list!! (period).
};
byte lag_test; ///< Byte used for lag-testing the client
byte last_token; ///< The last random token we did send to verify the client is listening
uint32 last_token_frame; ///< The last frame we received the right token
ClientStatus status; ///< Status of this client
CommandQueue outgoing_queue; ///< The command-queue awaiting delivery
size_t receive_limit; ///< Amount of bytes that we can receive at this moment
struct PacketWriter *savegame; ///< Writer used to write the savegame.
NetworkAddress client_address; ///< IP-address of the client (so he can be banned)
NetworkAddress client_address; ///< IP-address of the client (so they can be banned)
/* The company can build on the next tile, so wait till (s)hedoes. */
/* The company can build on the next tile, so wait till they do. */
v->cur_speed = 0;
return false;
}
} else if (IsNormalRoadTile(v->tile) && GetDisallowedRoadDirections(v->tile) != DRD_NONE) {
v->cur_speed = 0;
return false;
} else {
tile = v->tile;
}
}
/* Get position data for first frame on the new tile */
src/saveload/ai_sl.cpp
➞
Show inline comments
@@ -89,25 +89,25 @@ static void Load_AIPL()
if (!config->HasScript()) {
if (strcmp(_ai_saveload_name, "%_dummy") != 0) {
DEBUG(script, 0, "The savegame has an AI by the name '%s', version %d which is no longer available.", _ai_saveload_name, _ai_saveload_version);
DEBUG(script, 0, "A random other AI will be loaded in its place.");
} else {
DEBUG(script, 0, "The savegame had no AIs available at the time of saving.");
DEBUG(script, 0, "A random available AI will be loaded now.");
}
} else {
DEBUG(script, 0, "The savegame has an AI by the name '%s', version %d which is no longer available.", _ai_saveload_name, _ai_saveload_version);
DEBUG(script, 0, "The latest version of that AI has been loaded instead, but it'll not get the savegame data as it's incompatible.");
}
/* Make sure the AI doesn't get the saveload data, as he was not the
/* Make sure the AI doesn't get the saveload data, as it was not the
* writer of the saveload data in the first place */
_ai_saveload_version = -1;
}
}
config->StringToSettings(_ai_saveload_settings);
/* Start the AI directly if it was active in the savegame */
if (Company::IsValidAiID(index)) {
AI::StartNew(index, false);
AI::Load(index, _ai_saveload_version);
}
src/saveload/game_sl.cpp
➞
Show inline comments
@@ -81,25 +81,25 @@ static void Load_GSDT()
if (!config->HasScript()) {
if (strcmp(_game_saveload_name, "%_dummy") != 0) {
DEBUG(script, 0, "The savegame has an GameScript by the name '%s', version %d which is no longer available.", _game_saveload_name, _game_saveload_version);
DEBUG(script, 0, "This game will continue to run without GameScript.");
} else {
DEBUG(script, 0, "The savegame had no GameScript available at the time of saving.");
DEBUG(script, 0, "This game will continue to run without GameScript.");
}
} else {
DEBUG(script, 0, "The savegame has an GameScript by the name '%s', version %d which is no longer available.", _game_saveload_name, _game_saveload_version);
DEBUG(script, 0, "The latest version of that GameScript has been loaded instead, but it'll not get the savegame data as it's incompatible.");
}
/* Make sure the GameScript doesn't get the saveload data, as he was not the
/* Make sure the GameScript doesn't get the saveload data, as it was not the
* writer of the saveload data in the first place */