From f14d35ee3f1b5319a423a1efd8366ac524382ac2 Mon Sep 17 00:00:00 2001 From: rawng Date: Fri, 7 Aug 2015 18:54:41 -0400 Subject: Add server feature haveNewGuild --- src/net/tmwa/guildhandler.cpp | 17 ++++++++++++++--- src/net/tmwa/serverfeatures.cpp | 5 +++++ src/net/tmwa/serverfeatures.h | 2 ++ 3 files changed, 21 insertions(+), 3 deletions(-) (limited to 'src/net/tmwa') diff --git a/src/net/tmwa/guildhandler.cpp b/src/net/tmwa/guildhandler.cpp index 41d169395..4bd0e800c 100644 --- a/src/net/tmwa/guildhandler.cpp +++ b/src/net/tmwa/guildhandler.cpp @@ -398,9 +398,20 @@ void GuildHandler::processGuildMemberLogin(Net::MessageIn &msg) void GuildHandler::processGuildExpulsion(Net::MessageIn &msg) { - const std::string nick = msg.readString(24, "name"); - msg.readString(40, "reason"); - msg.readString(24, "kicker name"); + std::string nick; + if (serverFeatures->haveNewGuild()) + { + nick = msg.readString(24, "name"); + msg.readString(40, "reason"); + msg.readString(24, "kicker name"); + } + else + { + msg.readInt16("len?"); + nick = msg.readString(24, "name?"); + msg.skip(24, "player name"); + msg.readString(44, "message"); + } processGuildExpulsionContinue(nick); } diff --git a/src/net/tmwa/serverfeatures.cpp b/src/net/tmwa/serverfeatures.cpp index c32dac11e..a277a15f1 100644 --- a/src/net/tmwa/serverfeatures.cpp +++ b/src/net/tmwa/serverfeatures.cpp @@ -229,4 +229,9 @@ bool ServerFeatures::haveTeamId() const return tmwServerVersion > 0; } +bool ServerFeatures::haveNewGuild() const +{ + return tmwServerVersion > 0; +} + } // namespace TmwAthena diff --git a/src/net/tmwa/serverfeatures.h b/src/net/tmwa/serverfeatures.h index 383d048b4..e13d67250 100644 --- a/src/net/tmwa/serverfeatures.h +++ b/src/net/tmwa/serverfeatures.h @@ -111,6 +111,8 @@ class ServerFeatures final : public Net::ServerFeatures bool haveChangePassword() const override final; bool haveTeamId() const override final; + + bool haveNewGuild() const override final; }; } // namespace TmwAthena -- cgit v1.2.3-70-g09d2