diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-11-27 23:00:00 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-11-27 23:00:00 +0300 |
commit | b02e3369653bddc4f4af677de16dac131945e7b7 (patch) | |
tree | fe2e0f84acea8accb0e08a2ca2f2b607e4f5d030 | |
parent | cdd3c77337a6bbff0d51d174663867463db8cf15 (diff) | |
download | manaplus-b02e3369653bddc4f4af677de16dac131945e7b7.tar.gz manaplus-b02e3369653bddc4f4af677de16dac131945e7b7.tar.bz2 manaplus-b02e3369653bddc4f4af677de16dac131945e7b7.tar.xz manaplus-b02e3369653bddc4f4af677de16dac131945e7b7.zip |
Fix showing group name in online list for legacy server.
-rw-r--r-- | src/gui/onlineplayer.h | 8 | ||||
-rw-r--r-- | src/gui/windows/whoisonline.cpp | 17 | ||||
-rw-r--r-- | src/net/eathena/playerrecv.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/playerrecv.cpp | 2 |
4 files changed, 19 insertions, 10 deletions
diff --git a/src/gui/onlineplayer.h b/src/gui/onlineplayer.h index 219a473da..a97c2104e 100644 --- a/src/gui/onlineplayer.h +++ b/src/gui/onlineplayer.h @@ -36,12 +36,12 @@ class OnlinePlayer final const signed char level, const GenderT gender, const signed char version, - const unsigned char group) : + const int group) : mNick(nick), mText(), + mGroup(group), mStatus(status), mLevel(level), - mGroup(group), mVersion(version), mGender(gender), mIsGM(false) @@ -78,12 +78,12 @@ class OnlinePlayer final std::string mText; + int mGroup; + unsigned char mStatus; signed char mLevel; - unsigned char mGroup; - signed char mVersion; GenderT mGender; diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp index bc16397ed..61e2bc21a 100644 --- a/src/gui/windows/whoisonline.cpp +++ b/src/gui/windows/whoisonline.cpp @@ -55,7 +55,9 @@ #include "net/playerhandler.h" #include "net/serverfeatures.h" +#ifdef TMWA_SUPPORT #include "resources/db/groupdb.h" +#endif // TMWA_SUPPORT #include "utils/foreach.h" #include "utils/gettext.h" @@ -473,7 +475,7 @@ void WhoIsOnline::loadWebList() OnlinePlayer *const player = new OnlinePlayer(nick, CAST_U8(255), level, - Gender::UNSPECIFIED, -1, 0); + Gender::UNSPECIFIED, -1, -1); mOnlinePlayers.insert(player); mOnlineNicks.insert(nick); @@ -872,14 +874,17 @@ void OnlinePlayer::setText(std::string color) } } - if (GroupDb::getShowBadge(mGroup)) +#ifdef TMWA_SUPPORT + if (mGroup != -1 && GroupDb::getShowBadge(mGroup)) { const std::string name = GroupDb::getName(mGroup); mText.append(strprintf("(%s) ", name.c_str())); } - else if ((mStatus != 255 && ((mStatus & BeingFlag::GM) != 0)) || mIsGM) + else +#endif { - mText.append("(GM) "); + if ((mStatus != 255 && ((mStatus & BeingFlag::GM) != 0)) || mIsGM) + mText.append("(GM) "); } if (mLevel > 0) @@ -890,8 +895,10 @@ void OnlinePlayer::setText(std::string color) else if (mGender == Gender::MALE) mText.append("\u2642"); - if (GroupDb::getHighlightName(mGroup) && color == "0") +#ifdef TMWA_SUPPORT + if (mGroup != -1 && GroupDb::getHighlightName(mGroup) && color == "0") color = "2"; +#endif if (mStatus > 0 && mStatus != 255) { diff --git a/src/net/eathena/playerrecv.cpp b/src/net/eathena/playerrecv.cpp index 51abbfdc3..c1a23f8ca 100644 --- a/src/net/eathena/playerrecv.cpp +++ b/src/net/eathena/playerrecv.cpp @@ -481,7 +481,7 @@ void PlayerRecv::processOnlineList(Net::MessageIn &msg) gender = Gender::FEMALE; } arr.push_back(new OnlinePlayer(static_cast<const char*>(buf), - status, level, gender, ver, 0)); + status, level, gender, ver, -1)); buf += strlen(buf) + 1; } diff --git a/src/net/tmwa/playerrecv.cpp b/src/net/tmwa/playerrecv.cpp index d088c3c54..6233fa949 100644 --- a/src/net/tmwa/playerrecv.cpp +++ b/src/net/tmwa/playerrecv.cpp @@ -40,6 +40,8 @@ #include "debug.h" +extern unsigned int tmwServerVersion; + namespace TmwAthena { |