summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-16 13:54:33 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-16 13:54:33 +0300
commitce87c6e969dd2af24e50341e6da86918d4cf52a6 (patch)
tree273468e1e26c75bfcff3fc02b823b166f8dd5cac /src
parent5b8f189276b3883253de31d5e7bbbf897d34c85b (diff)
downloadplus-ce87c6e969dd2af24e50341e6da86918d4cf52a6.tar.gz
plus-ce87c6e969dd2af24e50341e6da86918d4cf52a6.tar.bz2
plus-ce87c6e969dd2af24e50341e6da86918d4cf52a6.tar.xz
plus-ce87c6e969dd2af24e50341e6da86918d4cf52a6.zip
Use some tmwa related code in whoisonline only if build for tmwa.
Diffstat (limited to 'src')
-rw-r--r--src/gui/windows/whoisonline.cpp8
-rw-r--r--src/gui/windows/whoisonline.h5
2 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp
index 54e82c846..7772f04b3 100644
--- a/src/gui/windows/whoisonline.cpp
+++ b/src/gui/windows/whoisonline.cpp
@@ -350,6 +350,7 @@ void WhoIsOnline::loadList(const std::vector<OnlinePlayer*> &list)
mEnemy.clear();
}
+#ifdef TMWA_SUPPORT
void WhoIsOnline::loadWebList()
{
if (!mMemoryBuffer)
@@ -585,6 +586,7 @@ int WhoIsOnline::downloadThread(void *ptr)
wio->mDownloadStatus = UPDATE_ERROR;
return 0;
}
+#endif
void WhoIsOnline::download()
{
@@ -593,6 +595,7 @@ void WhoIsOnline::download()
if (PacketLimiter::limitPackets(PACKET_ONLINELIST))
playerHandler->requestOnlineList();
}
+#ifdef TMWA_SUPPORT
else if (mWebList)
{
mDownloadComplete = true;
@@ -605,6 +608,7 @@ void WhoIsOnline::download()
if (mThread == nullptr)
mDownloadStatus = UPDATE_ERROR;
}
+#endif
}
void WhoIsOnline::logic()
@@ -639,6 +643,7 @@ void WhoIsOnline::slowLogic()
}
}
+#ifdef TMWA_SUPPORT
switch (mDownloadStatus)
{
case UPDATE_ERROR:
@@ -674,6 +679,7 @@ void WhoIsOnline::slowLogic()
default:
break;
}
+#endif
BLOCK_END("WhoIsOnline::slowLogic")
}
@@ -681,6 +687,7 @@ void WhoIsOnline::action(const ActionEvent &event)
{
if (event.getId() == "update")
{
+#ifdef TMWA_SUPPORT
if (!mServerSideList)
{
if (mDownloadStatus == UPDATE_COMPLETE)
@@ -699,6 +706,7 @@ void WhoIsOnline::action(const ActionEvent &event)
}
}
else
+#endif
{
if (PacketLimiter::limitPackets(PACKET_ONLINELIST))
{
diff --git a/src/gui/windows/whoisonline.h b/src/gui/windows/whoisonline.h
index a1cafa8ae..1a8f1c1c9 100644
--- a/src/gui/windows/whoisonline.h
+++ b/src/gui/windows/whoisonline.h
@@ -64,10 +64,12 @@ class WhoIsOnline final : public Window,
void postInit() override final;
+#ifdef TMWA_SUPPORT
/**
* Loads and display online list from the memory buffer.
*/
void loadWebList();
+#endif
void loadList(const std::vector<OnlinePlayer*> &list);
@@ -108,6 +110,8 @@ class WhoIsOnline final : public Window,
void handlerPlayerRelation(const std::string &nick,
OnlinePlayer *const player);
+
+#ifdef TMWA_SUPPORT
/**
* The thread function that download the files.
*/
@@ -119,6 +123,7 @@ class WhoIsOnline final : public Window,
static size_t memoryWrite(void *ptr, size_t size,
size_t nmemb,
FILE *stream);
+#endif
const std::string prepareNick(const std::string &restrict nick,
const int level,