summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-05 18:32:40 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-06 01:18:57 +0300
commit223641a3057a5abf0113440601e3b6330287d68b (patch)
tree609fb10397974a6e05fd18019b15f24c71beb8b9
parent487d3be4cc8761e5697d4fb95d85e9da8dcaa42e (diff)
downloadmv-223641a3057a5abf0113440601e3b6330287d68b.tar.gz
mv-223641a3057a5abf0113440601e3b6330287d68b.tar.bz2
mv-223641a3057a5abf0113440601e3b6330287d68b.tar.xz
mv-223641a3057a5abf0113440601e3b6330287d68b.zip
Use server features for online list.
-rw-r--r--src/gui/windows/whoisonline.cpp9
-rw-r--r--src/gui/windows/whoisonline.h1
2 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp
index 61a588f00..57d36e57c 100644
--- a/src/gui/windows/whoisonline.cpp
+++ b/src/gui/windows/whoisonline.cpp
@@ -51,6 +51,7 @@
#include "net/net.h"
#include "net/packetlimiter.h"
#include "net/playerhandler.h"
+#include "net/serverfeatures.h"
#include "utils/gettext.h"
#include "utils/sdlhelper.h"
@@ -111,8 +112,8 @@ WhoIsOnline::WhoIsOnline() :
mAllowUpdate(true),
mShowLevel(false),
mUpdateOnlineList(config.getBoolValue("updateOnlineList")),
-
- mGroupFriends(true)
+ mGroupFriends(true),
+ mServerSideList(Net::getServerFeatures()->haveOnlineList())
{
mCurlError[0] = 0;
setWindowName("WhoIsOnline");
@@ -588,7 +589,7 @@ int WhoIsOnline::downloadThread(void *ptr)
void WhoIsOnline::download()
{
- if (serverVersion < 3)
+ if (!mServerSideList)
{
mDownloadComplete = true;
if (mThread && SDL_GetThreadID(mThread))
@@ -681,7 +682,7 @@ void WhoIsOnline::action(const ActionEvent &event)
{
if (event.getId() == "update")
{
- if (serverVersion < 3)
+ if (!mServerSideList)
{
if (mDownloadStatus == UPDATE_COMPLETE)
{
diff --git a/src/gui/windows/whoisonline.h b/src/gui/windows/whoisonline.h
index 504013712..17890b9a7 100644
--- a/src/gui/windows/whoisonline.h
+++ b/src/gui/windows/whoisonline.h
@@ -168,6 +168,7 @@ class WhoIsOnline final : public Window,
bool mShowLevel;
bool mUpdateOnlineList;
bool mGroupFriends;
+ bool mServerSideList;
};
extern WhoIsOnline *whoIsOnline;