diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-07 19:16:16 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-07 19:16:16 +0300 |
commit | ef190a13443d1ae9522c98ac5fab5a8c6181cda1 (patch) | |
tree | b1b27007a030ca2aca5e71863385544f40117577 /src | |
parent | d3cdfdb52f031d6974d72e61914a073cb2995d34 (diff) | |
download | plus-ef190a13443d1ae9522c98ac5fab5a8c6181cda1.tar.gz plus-ef190a13443d1ae9522c98ac5fab5a8c6181cda1.tar.bz2 plus-ef190a13443d1ae9522c98ac5fab5a8c6181cda1.tar.xz plus-ef190a13443d1ae9522c98ac5fab5a8c6181cda1.zip |
eathena: fix party tab creation.
Diffstat (limited to 'src')
-rw-r--r-- | src/net/ea/partyhandler.cpp | 7 | ||||
-rw-r--r-- | src/net/ea/partyhandler.h | 2 | ||||
-rw-r--r-- | src/net/eathena/partyhandler.cpp | 21 | ||||
-rw-r--r-- | src/net/tmwa/partyhandler.cpp | 4 |
4 files changed, 21 insertions, 13 deletions
diff --git a/src/net/ea/partyhandler.cpp b/src/net/ea/partyhandler.cpp index 5c5aaf80b..60356cf61 100644 --- a/src/net/ea/partyhandler.cpp +++ b/src/net/ea/partyhandler.cpp @@ -324,4 +324,11 @@ ChatTab *PartyHandler::getTab() const return partyTab; } +void PartyHandler::createTab() const +{ + Ea::partyTab = new Ea::PartyTab(chatWindow); + if (config.getBoolValue("showChatHistory")) + Ea::partyTab->loadFromLogFile("#Party"); +} + } // namespace Ea diff --git a/src/net/ea/partyhandler.h b/src/net/ea/partyhandler.h index fbe77d376..c5cf606b4 100644 --- a/src/net/ea/partyhandler.h +++ b/src/net/ea/partyhandler.h @@ -79,6 +79,8 @@ class PartyHandler notfinal : public Net::PartyHandler void processPartySettingsContinue(const int16_t exp, const int16_t item); + void createTab() const; + protected: Net::PartyShare::Type mShareExp; Net::PartyShare::Type mShareItems; diff --git a/src/net/eathena/partyhandler.cpp b/src/net/eathena/partyhandler.cpp index 2a91722ef..8cd864ea0 100644 --- a/src/net/eathena/partyhandler.cpp +++ b/src/net/eathena/partyhandler.cpp @@ -261,9 +261,7 @@ void PartyHandler::processPartySettings(Net::MessageIn &msg) if (!chatWindow) return; - Ea::partyTab = new Ea::PartyTab(chatWindow); - if (config.getBoolValue("showChatHistory")) - Ea::partyTab->loadFromLogFile("#Party"); + createTab(); } msg.readInt32("party exp"); @@ -282,6 +280,9 @@ void PartyHandler::processPartyInfo(Net::MessageIn &msg) const logger->log1("error: party empty in SMSG_PARTY_INFO"); Ea::taParty = Party::getParty(1); } + if (!Ea::partyTab) + createTab(); + if (Ea::taParty) { if (Ea::taParty->getNumberOfElements() > 1) @@ -305,9 +306,9 @@ void PartyHandler::processPartyInfo(Net::MessageIn &msg) const if (Ea::taParty) Ea::taParty->clearMembers(); - const int length = msg.readInt16(); + const int length = msg.readInt16("len"); if (Ea::taParty) - Ea::taParty->setName(msg.readString(24)); + Ea::taParty->setName(msg.readString(24, "party name")); const int count = (length - 28) / 46; if (localPlayer && Ea::taParty) @@ -318,11 +319,11 @@ void PartyHandler::processPartyInfo(Net::MessageIn &msg) const for (int i = 0; i < count; i++) { - const int id = msg.readInt32(); - std::string nick = msg.readString(24); - std::string map = msg.readString(16); - const bool leader = msg.readUInt8() == 0U; - const bool online = msg.readUInt8() == 0U; + const int id = msg.readInt32("account id"); + std::string nick = msg.readString(24, "nick"); + std::string map = msg.readString(16, "map name"); + const bool leader = msg.readUInt8("leader") == 0U; + const bool online = msg.readUInt8("online") == 0U; if (Ea::taParty) { diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp index 0caaace29..c5564c94b 100644 --- a/src/net/tmwa/partyhandler.cpp +++ b/src/net/tmwa/partyhandler.cpp @@ -219,9 +219,7 @@ void PartyHandler::processPartySettings(Net::MessageIn &msg) if (!chatWindow) return; - Ea::partyTab = new Ea::PartyTab(chatWindow); - if (config.getBoolValue("showChatHistory")) - Ea::partyTab->loadFromLogFile("#Party"); + createTab(); } // These seem to indicate the sharing mode for exp and items |