diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-08-13 21:46:01 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-08-13 21:46:01 +0300 |
commit | de337195bdbb72df1e56b630f0b83d394648bbb8 (patch) | |
tree | 014a3555c0f855ce77dbf0df5377e1783b870bf7 /src/net/tmwa | |
parent | 1289a09b48736324e97f5ce82d9cfee656e6cbe7 (diff) | |
download | plus-de337195bdbb72df1e56b630f0b83d394648bbb8.tar.gz plus-de337195bdbb72df1e56b630f0b83d394648bbb8.tar.bz2 plus-de337195bdbb72df1e56b630f0b83d394648bbb8.tar.xz plus-de337195bdbb72df1e56b630f0b83d394648bbb8.zip |
Add support for load all item slots with cards in char selection dialog (hercules).
Also removed some outdated evol color code.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r-- | src/net/tmwa/charserverhandler.cpp | 16 | ||||
-rw-r--r-- | src/net/tmwa/charserverhandler.h | 4 |
2 files changed, 7 insertions, 13 deletions
diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp index 9ab0b8cb0..12d698186 100644 --- a/src/net/tmwa/charserverhandler.cpp +++ b/src/net/tmwa/charserverhandler.cpp @@ -125,8 +125,7 @@ void CharServerHandler::handleMessage(Net::MessageIn &msg) } void CharServerHandler::readPlayerData(Net::MessageIn &msg, - Net::Character *const character, - const bool withColors) const + Net::Character *const character) const { if (!character) return; @@ -342,23 +341,18 @@ void CharServerHandler::processCharLogin(Net::MessageIn &msg) if (slots > 0 && slots < 30) loginData.characterSlots = static_cast<uint16_t>(slots); - const bool version = msg.readUInt8("version") == 1 && serverVersion > 0; - msg.skip(17, "unused"); + msg.skip(18, "unused"); delete_all(mCharacters); mCharacters.clear(); // Derive number of characters from message length - int count = (msg.getLength() - 24); - if (version) - count /= 120; - else - count /= 106; + const int count = (msg.getLength() - 24) / 106; for (int i = 0; i < count; ++i) { Net::Character *const character = new Net::Character; - readPlayerData(msg, character, version); + readPlayerData(msg, character); mCharacters.push_back(character); if (character->dummy) { @@ -444,7 +438,7 @@ void CharServerHandler::processCharCreate(Net::MessageIn &msg) { BLOCK_START("CharServerHandler::processCharCreate") Net::Character *const character = new Net::Character; - charServerHandler->readPlayerData(msg, character, false); + charServerHandler->readPlayerData(msg, character); mCharacters.push_back(character); updateCharSelectDialog(); diff --git a/src/net/tmwa/charserverhandler.h b/src/net/tmwa/charserverhandler.h index 3c4b0a715..11667481f 100644 --- a/src/net/tmwa/charserverhandler.h +++ b/src/net/tmwa/charserverhandler.h @@ -87,8 +87,8 @@ class CharServerHandler final : public MessageHandler, void changeSlot(const int oldSlot, const int newSlot) override final; void readPlayerData(Net::MessageIn &msg, - Net::Character *const character, - const bool withColors) const override final; + Net::Character *const character) + const override final; void ping() const override final; |