summaryrefslogtreecommitdiff
path: root/src/net/eathena/guildhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-04-02 00:53:22 +0300
committerAndrei Karas <akaras@inbox.ru>2013-04-02 00:53:22 +0300
commit2f6f5950605e3ffe8054f3a2675f10032ca0aaf6 (patch)
tree8cbbc807f00bc4aeffc103058d223863c8de643f /src/net/eathena/guildhandler.cpp
parent28165cbeca05b74cf66f121757f21f4cb7cd381e (diff)
downloadmanaverse-2f6f5950605e3ffe8054f3a2675f10032ca0aaf6.tar.gz
manaverse-2f6f5950605e3ffe8054f3a2675f10032ca0aaf6.tar.bz2
manaverse-2f6f5950605e3ffe8054f3a2675f10032ca0aaf6.tar.xz
manaverse-2f6f5950605e3ffe8054f3a2675f10032ca0aaf6.zip
improve guildhandler class.
Diffstat (limited to 'src/net/eathena/guildhandler.cpp')
-rw-r--r--src/net/eathena/guildhandler.cpp33
1 files changed, 19 insertions, 14 deletions
diff --git a/src/net/eathena/guildhandler.cpp b/src/net/eathena/guildhandler.cpp
index 13c0a1f2e..481a74236 100644
--- a/src/net/eathena/guildhandler.cpp
+++ b/src/net/eathena/guildhandler.cpp
@@ -191,15 +191,15 @@ void GuildHandler::handleMessage(Net::MessageIn &msg)
}
}
-void GuildHandler::create(const std::string &name)
+void GuildHandler::create(const std::string &name) const
{
MessageOut msg(CMSG_GUILD_CREATE);
msg.writeInt32(0); // Unused
msg.writeString(name, 24);
}
-void GuildHandler::invite(int guildId A_UNUSED,
- const std::string &name A_UNUSED)
+void GuildHandler::invite(const int guildId A_UNUSED,
+ const std::string &name A_UNUSED) const
{
if (!actorSpriteManager)
return;
@@ -215,7 +215,8 @@ void GuildHandler::invite(int guildId A_UNUSED,
}
}
-void GuildHandler::invite(int guildId A_UNUSED, const Being *const being)
+void GuildHandler::invite(const int guildId A_UNUSED,
+ const Being *const being) const
{
if (!being)
return;
@@ -226,7 +227,8 @@ void GuildHandler::invite(int guildId A_UNUSED, const Being *const being)
msg.writeInt32(0); // Unused
}
-void GuildHandler::inviteResponse(int guildId, bool response)
+void GuildHandler::inviteResponse(const int guildId,
+ const bool response) const
{
MessageOut msg(CMSG_GUILD_INVITE_REPLY);
msg.writeInt32(guildId);
@@ -235,7 +237,7 @@ void GuildHandler::inviteResponse(int guildId, bool response)
msg.writeInt16(0); // Unused
}
-void GuildHandler::leave(int guildId)
+void GuildHandler::leave(const int guildId) const
{
if (!player_node)
return;
@@ -247,7 +249,8 @@ void GuildHandler::leave(int guildId)
msg.writeString("", 40); // Message
}
-void GuildHandler::kick(GuildMember *member, std::string reason)
+void GuildHandler::kick(const GuildMember *const member,
+ const std::string &reason) const
{
if (!member || !member->getGuild())
return;
@@ -259,19 +262,20 @@ void GuildHandler::kick(GuildMember *member, std::string reason)
msg.writeString(reason, 40); // Message
}
-void GuildHandler::chat(int guildId A_UNUSED, const std::string &text)
+void GuildHandler::chat(const int guildId A_UNUSED,
+ const std::string &text) const
{
if (!player_node)
return;
- std::string str = std::string(player_node->getName()).append(
+ const std::string str = std::string(player_node->getName()).append(
" : ").append(text);
MessageOut msg(CMSG_GUILD_MESSAGE);
msg.writeInt16(static_cast<uint16_t>(str.size() + 4));
msg.writeString(str, static_cast<int>(str.length()));
}
-void GuildHandler::memberList(int guildId A_UNUSED)
+void GuildHandler::memberList(const int guildId A_UNUSED) const
{
// TODO four types of info requests:
// 0 = basic info + alliance info
@@ -284,7 +288,7 @@ void GuildHandler::memberList(int guildId A_UNUSED)
msg.writeInt32(1); // Request member list
}
-void GuildHandler::info(int guildId A_UNUSED)
+void GuildHandler::info(const int guildId A_UNUSED)
{
// TODO four types of info requests:
// 0 = basic info + alliance info
@@ -298,7 +302,8 @@ void GuildHandler::info(int guildId A_UNUSED)
msg.writeInt32(0); // Request basic info
}
-void GuildHandler::changeMemberPostion(GuildMember *member, int level)
+void GuildHandler::changeMemberPostion(const GuildMember *const member,
+ const int level) const
{
if (!member || !member->getGuild())
return;
@@ -310,8 +315,8 @@ void GuildHandler::changeMemberPostion(GuildMember *member, int level)
msg.writeInt32(level); // pos
}
-void GuildHandler::changeNotice(int guildId, std::string msg1,
- std::string msg2)
+void GuildHandler::changeNotice(const int guildId, const std::string &msg1,
+ const std::string &msg2) const
{
MessageOut msg(CMSG_GUILD_CHANGE_NOTICE);
msg.writeInt32(guildId);