summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-16 16:34:42 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-16 16:34:42 +0300
commit8185a857a4d9152b3dda7f6b5649a27427010605 (patch)
tree13b06f5def1764c8061d406acd1bfa43159b39f0 /src
parent64597d0d8fafff56779fc9a107196465ce073b3a (diff)
downloadplus-8185a857a4d9152b3dda7f6b5649a27427010605.tar.gz
plus-8185a857a4d9152b3dda7f6b5649a27427010605.tar.bz2
plus-8185a857a4d9152b3dda7f6b5649a27427010605.tar.xz
plus-8185a857a4d9152b3dda7f6b5649a27427010605.zip
add server feature havePlayerStatusUpdate.
Diffstat (limited to 'src')
-rw-r--r--src/being/localplayer.cpp7
-rw-r--r--src/net/eathena/serverfeatures.cpp5
-rw-r--r--src/net/eathena/serverfeatures.h2
-rw-r--r--src/net/serverfeatures.h2
-rw-r--r--src/net/tmwa/serverfeatures.cpp5
-rw-r--r--src/net/tmwa/serverfeatures.h2
6 files changed, 21 insertions, 2 deletions
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp
index 237f21dc2..fd3acd4f9 100644
--- a/src/being/localplayer.cpp
+++ b/src/being/localplayer.cpp
@@ -68,6 +68,7 @@
#include "net/packetlimiter.h"
#include "net/pethandler.h"
#include "net/playerhandler.h"
+#include "net/serverfeatures.h"
#include "resources/iteminfo.h"
#include "resources/itemslot.h"
@@ -333,7 +334,9 @@ void LocalPlayer::slowLogic()
weightNoticeTime = 0;
}
- if (serverVersion < 4 && mEnableAdvert && !mBlockAdvert
+ if (!Net::getServerFeatures()->havePlayerStatusUpdate()
+ && mEnableAdvert
+ && !mBlockAdvert
&& mAdvertTime < cur_time)
{
uint8_t smile = BeingFlag::SPECIAL;
@@ -3222,7 +3225,7 @@ bool LocalPlayer::checAttackPermissions(const Being *const target)
void LocalPlayer::updateStatus() const
{
- if (serverVersion >= 4 && mEnableAdvert)
+ if (Net::getServerFeatures()->havePlayerStatusUpdate() && mEnableAdvert)
{
uint8_t status = 0;
if (mTradebot && shopWindow && !shopWindow->isShopEmpty())
diff --git a/src/net/eathena/serverfeatures.cpp b/src/net/eathena/serverfeatures.cpp
index d4c37927c..94af844b8 100644
--- a/src/net/eathena/serverfeatures.cpp
+++ b/src/net/eathena/serverfeatures.cpp
@@ -57,4 +57,9 @@ bool ServerFeatures::haveLangTab() const
return false;
}
+bool ServerFeatures::havePlayerStatusUpdate() const
+{
+ return false;
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/serverfeatures.h b/src/net/eathena/serverfeatures.h
index 35c348ecd..a11e73a40 100644
--- a/src/net/eathena/serverfeatures.h
+++ b/src/net/eathena/serverfeatures.h
@@ -43,6 +43,8 @@ class ServerFeatures final : public Net::ServerFeatures
bool haveServerHp() const override final;
bool haveLangTab() const override final;
+
+ bool havePlayerStatusUpdate() const override final;
};
} // namespace EAthena
diff --git a/src/net/serverfeatures.h b/src/net/serverfeatures.h
index ef61bdc16..f84464b5d 100644
--- a/src/net/serverfeatures.h
+++ b/src/net/serverfeatures.h
@@ -40,6 +40,8 @@ class ServerFeatures notfinal
virtual bool haveServerHp() const = 0;
virtual bool haveLangTab() const = 0;
+
+ virtual bool havePlayerStatusUpdate() const = 0;
};
} // namespace Net
diff --git a/src/net/tmwa/serverfeatures.cpp b/src/net/tmwa/serverfeatures.cpp
index 582ae4050..28f0a3cee 100644
--- a/src/net/tmwa/serverfeatures.cpp
+++ b/src/net/tmwa/serverfeatures.cpp
@@ -59,4 +59,9 @@ bool ServerFeatures::haveLangTab() const
return serverVersion >= 8;
}
+bool ServerFeatures::havePlayerStatusUpdate() const
+{
+ return serverVersion >= 4;
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/serverfeatures.h b/src/net/tmwa/serverfeatures.h
index 10c6dd899..87a1b61b0 100644
--- a/src/net/tmwa/serverfeatures.h
+++ b/src/net/tmwa/serverfeatures.h
@@ -43,6 +43,8 @@ class ServerFeatures final : public Net::ServerFeatures
bool haveServerHp() const override final;
bool haveLangTab() const override final;
+
+ bool havePlayerStatusUpdate() const override final;
};
} // namespace TmwAthena