53 static const Uint16 _messages[] = {
76 Log::info(
"Received CPMSG_GUILD_CREATE_RESPONSE");
91 Log::info(
"Received CPMSG_GUILD_INVITE_RESPONSE");
92 const unsigned char response = msg.
readInt8();
114 Log::info(
"Received CPMSG_GUILD_ACCEPT_RESPONSE");
124 Log::info(
"Received CPMSG_GUILD_GET_MEMBERS_RESPONSE");
155 Log::info(
"Received CPMSG_GUILD_UPDATE_LIST");
199 Log::info(
"Received CPMSG_GUILD_INVITED");
210 Log::info(
"Received CPMSG_GUILD_PROMOTE_MEMBER_RESPONSE");
226 Log::info(
"Received CPMSG_GUILD_REJOIN");
233 Log::info(
"Received CPMSG_GUILD_QUIT_RESPONSE");
250 Log::info(
"Received CPMSG_GUILD_KICK_NOTIFICATION");
260 player.c_str(), guild->getName().c_str()));
283 auto *channel =
new Channel(channelId, guildName, announcement);
285 channel->getTab()->chatLog(
strprintf(
_(
"Topic: %s"), announcement.c_str()),
ChannelManager * channelManager
void setOnline(bool online)
Set the avatar's online status.
const std::string & getName() const
Returns the name of the being.
void addGuild(Guild *guild)
Adds a guild to the being.
void removeGuild(int id)
Removers a guild from the being.
Guild * getGuild(const std::string &guildName) const
Returns a pointer to the specified guild that the being is in.
Channel * findByName(const std::string &name) const
void addChannel(Channel *channel)
void removeChannel(Channel *channel)
GuildMember * addMember(int id, const std::string &name)
Adds member to the list.
void setName(const std::string &name)
Set the guild's name.
GuildMember * getMember(int id) const
Find a member by ID.
void setRights(short rights)
static Guild * getGuild(int id)
void removeMember(GuildMember *member)
Removes a member from the guild.
void send(const ManaServ::MessageOut &msg)
Sends a message.
void kick(GuildMember *member, std::string reason=std::string()) override
void changeMemberPostion(GuildMember *member, int level) override
void inviteResponse(int guidId, bool response) override
void invite(int guildId, const std::string &name) override
void endAlliance(int guildId, int otherGuildId) override
void chat(int guildId, const std::string &text) override
void memberList(int guildId) override
void requestAllianceResponse(int guildId, int otherGuildId, bool response) override
void joinedGuild(MessageIn &msg)
void handleMessage(MessageIn &msg) override
void requestAlliance(int guildId, int otherGuildId) override
void leave(int guildId) override
void create(const std::string &name) override
Used for parsing an incoming message from manaserv.
uint16_t readInt16()
Reads an unsigned 16-bit integer from the message.
unsigned int getUnreadLength() const
Returns the length of unread data.
std::string readString(int length=-1)
Reads a string.
uint16_t getId() const
Returns the message ID.
uint8_t readInt8()
Reads an unsigned 8-bit integer from the message.
Used for building an outgoing message to manaserv.
void writeInt16(uint16_t value)
Writes an unsigned 16-bit integer to the message.
void writeInt8(uint8_t value)
Writes an unsigned 8-bit integer to the message.
void writeString(const std::string &string, int length=-1)
Writes a string.
virtual void memberList(int guildId)=0
const uint16_t * handledMessages
void showGuildInvite(const std::string &guildName, int guildId, const std::string &inviterName)
void serverNotice(const std::string &message)
SocialWindow * socialWindow
LocalPlayer * local_player
Net::GuildHandler * guildHandler
void info(const char *log_text,...) LOG_PRINTF_ATTR
@ GUILD_EVENT_ONLINE_PLAYER
@ GUILD_EVENT_LEAVING_PLAYER
@ GUILD_EVENT_OFFLINE_PLAYER
Connection * chatServerConnection
@ CPMSG_GUILD_ACCEPT_RESPONSE
@ CPMSG_GUILD_CREATE_RESPONSE
@ PCMSG_GUILD_GET_MEMBERS
@ CPMSG_GUILD_KICK_NOTIFICATION
@ CPMSG_GUILD_PROMOTE_MEMBER_RESPONSE
@ CPMSG_GUILD_UPDATE_LIST
@ CPMSG_GUILD_QUIT_RESPONSE
@ CPMSG_GUILD_INVITE_RESPONSE
@ CPMSG_GUILD_GET_MEMBERS_RESPONSE
GuildHandler * getGuildHandler()
std::string strprintf(char const *format,...)
A safe version of sprintf that returns a std::string of the result.