summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/defaults.cpp1
-rw-r--r--src/gui/setup_other.cpp3
-rw-r--r--src/net/tmwa/network.cpp4
3 files changed, 8 insertions, 0 deletions
diff --git a/src/defaults.cpp b/src/defaults.cpp
index efd1c5fc6..d65e722de 100644
--- a/src/defaults.cpp
+++ b/src/defaults.cpp
@@ -253,6 +253,7 @@ DefaultsData* getConfigDefaults()
AddDEF(configData, "repeateInterval", SDL_DEFAULT_REPEAT_INTERVAL);
AddDEF(configData, "compresstextures", false);
AddDEF(configData, "rectangulartextures", true);
+ AddDEF(configData, "networksleep", 0);
return configData;
}
diff --git a/src/gui/setup_other.cpp b/src/gui/setup_other.cpp
index bf186b45a..2f86db8af 100644
--- a/src/gui/setup_other.cpp
+++ b/src/gui/setup_other.cpp
@@ -226,6 +226,9 @@ Setup_Other::Setup_Other()
"", "usefbo", this, "usefboEvent");
#endif
+ new SetupItemIntTextField(_("Network delay between sub servers"),
+ "", "networksleep", this, "networksleepEvent", 0, 10000);
+
new SetupItemCheckBox(_("Show background"), "", "showBackground",
this, "showBackgroundEvent");
diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp
index 956067f4a..c54972253 100644
--- a/src/net/tmwa/network.cpp
+++ b/src/net/tmwa/network.cpp
@@ -22,6 +22,7 @@
#include "net/tmwa/network.h"
+#include "configuration.h"
#include "logger.h"
#include "net/messagehandler.h"
@@ -191,6 +192,9 @@ void Network::disconnect()
// need call SDLNet_TCP_DelSocket?
SDLNet_TCP_Close(mSocket);
mSocket = nullptr;
+ int sleep = config.getIntValue("networksleep");
+ if (sleep > 0)
+ SDL_Delay(sleep);
}
}