diff options
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/network_gui.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 3e4a4b050..65ecb3b99 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -31,6 +31,7 @@ #include "../core/geometry_func.hpp" #include "../genworld.h" #include "../map_type.h" +#include "../guitimer_func.h" #include "../widgets/network_widget.h" @@ -234,6 +235,7 @@ protected: Scrollbar *vscroll; ///< vertical scrollbar of the list of servers QueryString name_editbox; ///< Client name editbox. QueryString filter_editbox; ///< Editbox for filter on servers + GUITimer requery_timer; ///< Timer for network requery int lock_offset; ///< Left offset for lock icon. int blot_offset; ///< Left offset for green/yellow/red compatibility icon. @@ -480,6 +482,8 @@ public: this->server = this->last_joined; if (this->last_joined != NULL) NetworkUDPQueryServer(this->last_joined->address); + this->requery_timer.SetInterval(MILLISECONDS_PER_TICK); + this->servers.SetListing(this->last_sorting); this->servers.SetSortFuncs(this->sorter_funcs); this->servers.SetFilterFuncs(this->filter_funcs); @@ -903,8 +907,11 @@ public: this->vscroll->SetCapacityFromWidget(this, WID_NG_MATRIX); } - virtual void OnTick() + virtual void OnRealtimeTick(uint delta_ms) { + if (!this->requery_timer.Elapsed(delta_ms)) return; + this->requery_timer.SetInterval(MILLISECONDS_PER_TICK); + NetworkGameListRequery(); } }; |