diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-05-02 23:26:04 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-05-02 23:26:04 +0300 |
commit | 5c9d41ce013205bdef4ebff837fadf2e0763401c (patch) | |
tree | b3bdf8563e8f512d0f43b274a968c8fb40adff9e /src | |
parent | 4741c7b959384ff9ca6b93d083a87d919ce3ba46 (diff) | |
download | mv-5c9d41ce013205bdef4ebff837fadf2e0763401c.tar.gz mv-5c9d41ce013205bdef4ebff837fadf2e0763401c.tar.bz2 mv-5c9d41ce013205bdef4ebff837fadf2e0763401c.tar.xz mv-5c9d41ce013205bdef4ebff837fadf2e0763401c.zip |
Add timeout option between connections to sub servers.
This can be usefull for bad and slow connections.
Diffstat (limited to 'src')
-rw-r--r-- | src/defaults.cpp | 1 | ||||
-rw-r--r-- | src/gui/setup_other.cpp | 3 | ||||
-rw-r--r-- | src/net/tmwa/network.cpp | 4 |
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); } } |