summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-01-28 21:00:12 +0300
committerAndrei Karas <akaras@inbox.ru>2012-01-28 21:00:12 +0300
commita93722a53e2d50466dfd5512c4a6a1c3dfc60fb1 (patch)
treeb4ade374e591f520ae49b1dcb3317b19d503f089 /src/localplayer.cpp
parente5695ad6c41d4deb79504998b2bc5caeb1e61285 (diff)
downloadmv-a93722a53e2d50466dfd5512c4a6a1c3dfc60fb1.tar.gz
mv-a93722a53e2d50466dfd5512c4a6a1c3dfc60fb1.tar.bz2
mv-a93722a53e2d50466dfd5512c4a6a1c3dfc60fb1.tar.xz
mv-a93722a53e2d50466dfd5512c4a6a1c3dfc60fb1.zip
Add support for processing player statuses in evol server.
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 3df4a3214..bd69d785f 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -354,7 +354,8 @@ void LocalPlayer::logic()
}
}
- if (mEnableAdvert && !mBlockAdvert && mAdvertTime < cur_time)
+ if (serverVersion < 4 && mEnableAdvert && !mBlockAdvert
+ && mAdvertTime < cur_time)
{
Uint8 smile = FLAG_SPECIAL;
if (mTradebot && shopWindow && !shopWindow->isShopEmpty())
@@ -3442,6 +3443,7 @@ void LocalPlayer::setAway(const std::string &message)
if (!message.empty())
config.setValue("afkMessage", message);
changeAwayMode();
+ updateStatus();
}
void LocalPlayer::setPseudoAway(const std::string &message)
@@ -4207,11 +4209,30 @@ const char *LocalPlayer::getVarItem(const char **arr, unsigned index,
return arr[sz];
}
+void LocalPlayer::updateStatus()
+{
+ if (serverVersion >= 4 && mEnableAdvert)
+ {
+ Uint8 status = 0;
+ if (mTradebot && shopWindow && !shopWindow->isShopEmpty())
+ status += FLAG_SHOP;
+
+ if (mAwayMode || mPseudoAwayMode)
+ status += FLAG_AWAY;
+
+ if (mInactive)
+ status += FLAG_INACTIVE;
+
+ Net::getPlayerHandler()->updateStatus(status);
+ }
+}
+
void AwayListener::action(const gcn::ActionEvent &event)
{
if (event.getId() == "ok" && player_node && player_node->getAway())
{
player_node->changeAwayMode();
+ player_node->updateStatus();
if (outfitWindow)
outfitWindow->unwearAwayOutfit();
if (miniStatusWindow)