summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-10-22 14:41:26 +0000
committerrubidium <rubidium@openttd.org>2010-10-22 14:41:26 +0000
commit3a1a915c9af26759b121fb845b40708bc9db6cda (patch)
tree62d32f1365d5de0017ca38f0c29b92ff12ddfff4 /src
parent6e3a46d295d3ee96c678c8e2dce511f135b5d9aa (diff)
downloadopenttd-3a1a915c9af26759b121fb845b40708bc9db6cda.tar.xz
(svn r21008) -Change: don't make client reconnect waiting time depend on the company; in coop games that does not spread clients at all, and most companies have a low number causing it not to be spread out either. Use the ClientID instead. Based on a patch by dihedral.
Diffstat (limited to 'src')
-rw-r--r--src/network/network_client.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp
index 7cb76366b..719433def 100644
--- a/src/network/network_client.cpp
+++ b/src/network/network_client.cpp
@@ -911,11 +911,10 @@ DEF_GAME_RECEIVE_COMMAND(Client, PACKET_SERVER_SHUTDOWN)
DEF_GAME_RECEIVE_COMMAND(Client, PACKET_SERVER_NEWGAME)
{
- /* To trottle the reconnects a bit, every clients waits
- * his _local_company value before reconnecting
- * COMPANY_SPECTATOR is currently 255, so to avoid long wait periods
- * set the max to 10. */
- _network_reconnect = min(_local_company + 1, 10);
+ /* To trottle the reconnects a bit, every clients waits its
+ * Client ID modulo 16. This way reconnects should be spread
+ * out a bit. */
+ _network_reconnect = _network_own_client_id % 16;
_switch_mode_errorstr = STR_NETWORK_MESSAGE_SERVER_REBOOT;
return NETWORK_RECV_STATUS_SERVER_ERROR;