From 2dc33d6d6b20364fff5cdc74e2f6875124318e09 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 20 May 2015 20:04:42 +0300 Subject: eathena: impliment packet CMSG_GUILD_CHANGE_EMBLEM. --- src/net/eathena/guildhandler.cpp | 10 ++++++++++ src/net/eathena/guildhandler.h | 2 ++ src/net/guildhandler.h | 2 ++ src/net/tmwa/guildhandler.cpp | 4 ++++ src/net/tmwa/guildhandler.h | 2 ++ 5 files changed, 20 insertions(+) diff --git a/src/net/eathena/guildhandler.cpp b/src/net/eathena/guildhandler.cpp index bcd13afab..e7f61218d 100644 --- a/src/net/eathena/guildhandler.cpp +++ b/src/net/eathena/guildhandler.cpp @@ -507,4 +507,14 @@ void GuildHandler::breakGuild(const std::string &name) const outMsg.writeString(name, 40, "name"); } +void GuildHandler::changeEmblem(std::string emblem) const +{ + createOutPacket(CMSG_GUILD_CHANGE_EMBLEM); + if (emblem.size() > 200) + emblem = emblem.substr(0, 200); + const int sz = emblem.size(); + outMsg.writeInt16(sz + 4, "len"); + outMsg.writeString(emblem, sz, "emblem"); +} + } // namespace EAthena diff --git a/src/net/eathena/guildhandler.h b/src/net/eathena/guildhandler.h index d74bcd82a..d3eb21664 100644 --- a/src/net/eathena/guildhandler.h +++ b/src/net/eathena/guildhandler.h @@ -88,6 +88,8 @@ class GuildHandler final : public Ea::GuildHandler, public MessageHandler void breakGuild(const std::string &name) const override final; + void changeEmblem(std::string emblem) const override final; + protected: static void processGuildUpdateCoords(Net::MessageIn &msg); diff --git a/src/net/guildhandler.h b/src/net/guildhandler.h index fbef8726e..3cd2da282 100644 --- a/src/net/guildhandler.h +++ b/src/net/guildhandler.h @@ -85,6 +85,8 @@ class GuildHandler notfinal virtual void breakGuild(const std::string &name) const = 0; + virtual void changeEmblem(std::string emblem) const = 0; + virtual void clear() const = 0; virtual ChatTab *getTab() const = 0; diff --git a/src/net/tmwa/guildhandler.cpp b/src/net/tmwa/guildhandler.cpp index 678afafa6..4f6404872 100644 --- a/src/net/tmwa/guildhandler.cpp +++ b/src/net/tmwa/guildhandler.cpp @@ -451,4 +451,8 @@ void GuildHandler::breakGuild(const std::string &name A_UNUSED) const { } +void GuildHandler::changeEmblem(std::string emblem A_UNUSED) const +{ +} + } // namespace TmwAthena diff --git a/src/net/tmwa/guildhandler.h b/src/net/tmwa/guildhandler.h index 3f800a560..16a04cc14 100644 --- a/src/net/tmwa/guildhandler.h +++ b/src/net/tmwa/guildhandler.h @@ -88,6 +88,8 @@ class GuildHandler final : public Ea::GuildHandler, public MessageHandler void breakGuild(const std::string &name) const override final; + void changeEmblem(std::string emblem) const override final; + protected: static void processGuildPositionInfo(Net::MessageIn &msg); -- cgit v1.2.3-70-g09d2