diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-02-20 15:35:36 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-02-20 15:35:36 +0300 |
commit | 130ad803401e9d582a2118d9bc92b984222b00f1 (patch) | |
tree | 007c13fcabe6754c3fb50265fa665f6bd616e938 /src/net/tmwa | |
parent | 16121e499c734c00c714abd0998c24f4845329c3 (diff) | |
download | ManaVerse-130ad803401e9d582a2118d9bc92b984222b00f1.tar.gz ManaVerse-130ad803401e9d582a2118d9bc92b984222b00f1.tar.bz2 ManaVerse-130ad803401e9d582a2118d9bc92b984222b00f1.tar.xz ManaVerse-130ad803401e9d582a2118d9bc92b984222b00f1.zip |
eathena: add support for online list packets.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r-- | src/net/tmwa/playerhandler.cpp | 65 | ||||
-rw-r--r-- | src/net/tmwa/playerhandler.h | 1 |
2 files changed, 0 insertions, 66 deletions
diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index e7b5deb6c..f5ccad489 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -22,17 +22,11 @@ #include "net/tmwa/playerhandler.h" -#include "configuration.h" - -#include "being/beingflag.h" #include "being/localplayer.h" #include "enums/being/attributes.h" -#include "gui/onlineplayer.h" - #include "gui/windows/statuswindow.h" -#include "gui/windows/whoisonline.h" #include "net/tmwa/inventoryhandler.h" #include "net/tmwa/messageout.h" @@ -247,65 +241,6 @@ void PlayerHandler::setMemo() const { } -void PlayerHandler::processOnlineList(Net::MessageIn &msg) -{ - if (!whoIsOnline) - return; - - BLOCK_START("PlayerHandler::processOnlineList") - const int size = msg.readInt16("len") - 4; - std::vector<OnlinePlayer*> arr; - - if (!size) - { - if (whoIsOnline) - whoIsOnline->loadList(arr); - BLOCK_END("PlayerHandler::processOnlineList") - return; - } - - char *const start = reinterpret_cast<char*>(msg.readBytes(size, "nicks")); - if (!start) - { - BLOCK_END("PlayerHandler::processOnlineList") - return; - } - - const char *buf = start; - - int addVal = 3; - - while (buf - start + 1 < size - && *(buf + static_cast<size_t>(addVal))) - { - unsigned char status = *buf; - buf ++; - unsigned char level = *buf; - buf ++; - unsigned char ver = *buf; - buf ++; - - unsigned char gender = Gender::UNSPECIFIED; - if (config.getBoolValue("showgender")) - { - if (status & BeingFlag::GENDER_MALE) - gender = Gender::MALE; - else if (status & BeingFlag::GENDER_OTHER) - gender = Gender::OTHER; - else - gender = Gender::FEMALE; - } - arr.push_back(new OnlinePlayer(static_cast<const char*>(buf), - status, level, gender, ver)); - buf += strlen(buf) + 1; - } - - if (whoIsOnline) - whoIsOnline->loadList(arr); - delete [] start; - BLOCK_END("PlayerHandler::processOnlineList") -} - void PlayerHandler::updateStatus(const uint8_t status) const { createOutPacket(CMSG_SET_STATUS); diff --git a/src/net/tmwa/playerhandler.h b/src/net/tmwa/playerhandler.h index b2d103a65..1ca4c0ab8 100644 --- a/src/net/tmwa/playerhandler.h +++ b/src/net/tmwa/playerhandler.h @@ -52,7 +52,6 @@ class PlayerHandler final : public MessageHandler, public Ea::PlayerHandler const int direction) const override final; void changeAction(const BeingAction::Action &action) const override final; - static void processOnlineList(Net::MessageIn &msg); void requestOnlineList() const override final; void updateStatus(const uint8_t status) const override final; |