summaryrefslogtreecommitdiff
path: root/src/net/tmwa/guildhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-07-24 21:21:43 +0300
committerAndrei Karas <akaras@inbox.ru>2016-07-24 21:21:43 +0300
commit1e2dcd3872b4bf3bb6173688ffdfe21388517c9c (patch)
treedaf3c9f2ad85e7b88d539d8d9eab6cb5573065c8 /src/net/tmwa/guildhandler.cpp
parent3cdb0d5516f5234dcebb118a26e405074de701f8 (diff)
downloadmanaverse-1e2dcd3872b4bf3bb6173688ffdfe21388517c9c.tar.gz
manaverse-1e2dcd3872b4bf3bb6173688ffdfe21388517c9c.tar.bz2
manaverse-1e2dcd3872b4bf3bb6173688ffdfe21388517c9c.tar.xz
manaverse-1e2dcd3872b4bf3bb6173688ffdfe21388517c9c.zip
Drop native guild support from tmwa.
Diffstat (limited to 'src/net/tmwa/guildhandler.cpp')
-rw-r--r--src/net/tmwa/guildhandler.cpp118
1 files changed, 16 insertions, 102 deletions
diff --git a/src/net/tmwa/guildhandler.cpp b/src/net/tmwa/guildhandler.cpp
index 2f7d68285..f289fb325 100644
--- a/src/net/tmwa/guildhandler.cpp
+++ b/src/net/tmwa/guildhandler.cpp
@@ -21,16 +21,8 @@
#include "net/tmwa/guildhandler.h"
-#include "actormanager.h"
-
-#include "being/localplayer.h"
-#include "being/playerinfo.h"
-
#include "net/ea/guildrecv.h"
-#include "net/tmwa/messageout.h"
-#include "net/tmwa/protocolout.h"
-
#include "debug.h"
extern Net::GuildHandler *guildHandler;
@@ -48,137 +40,59 @@ GuildHandler::~GuildHandler()
{
}
-void GuildHandler::create(const std::string &name) const
+void GuildHandler::create(const std::string &name A_UNUSED) const
{
- createOutPacket(CMSG_GUILD_CREATE);
- outMsg.writeInt32(0, "unused");
- outMsg.writeString(name, 24, "guild name");
}
-void GuildHandler::invite(const std::string &name) const
+void GuildHandler::invite(const std::string &name A_UNUSED) const
{
- if (!actorManager)
- return;
-
- const Being *const being = actorManager->findBeingByName(
- name, ActorType::Player);
- if (being)
- {
- createOutPacket(CMSG_GUILD_INVITE);
- outMsg.writeBeingId(being->getId(), "account id");
- outMsg.writeInt32(0, "unused");
- outMsg.writeInt32(0, "unused");
- }
}
-void GuildHandler::invite(const Being *const being) const
+void GuildHandler::invite(const Being *const being A_UNUSED) const
{
- if (!being)
- return;
-
- createOutPacket(CMSG_GUILD_INVITE);
- outMsg.writeBeingId(being->getId(), "account id");
- outMsg.writeInt32(0, "unused");
- outMsg.writeInt32(0, "unused");
}
-void GuildHandler::inviteResponse(const int guildId, const bool response) const
+void GuildHandler::inviteResponse(const int guildId A_UNUSED,
+ const bool response A_UNUSED) const
{
- createOutPacket(CMSG_GUILD_INVITE_REPLY);
- outMsg.writeInt32(guildId, "guild id");
- outMsg.writeInt8(response, "response");
- outMsg.writeInt8(0, "unused");
- outMsg.writeInt16(0, "unused");
}
-void GuildHandler::leave(const int guildId) const
+void GuildHandler::leave(const int guildId A_UNUSED) const
{
- if (!localPlayer)
- return;
-
- createOutPacket(CMSG_GUILD_LEAVE);
- outMsg.writeInt32(guildId, "guild id");
- outMsg.writeBeingId(localPlayer->getId(), "account id");
- outMsg.writeInt32(PlayerInfo::getCharId(), "char id");
- outMsg.writeString("", 40, "message");
}
-void GuildHandler::kick(const GuildMember *restrict const member,
- const std::string &restrict reason) const
+void GuildHandler::kick(const GuildMember *restrict const member A_UNUSED,
+ const std::string &restrict reason A_UNUSED) const
{
- if (!member || !member->getGuild())
- return;
-
- createOutPacket(CMSG_GUILD_EXPULSION);
- outMsg.writeInt32(member->getGuild()->getId(), "guild id");
- outMsg.writeBeingId(member->getID(), "account id");
- outMsg.writeInt32(member->getCharId(), "char id");
- outMsg.writeString(reason, 40, "message");
}
-void GuildHandler::chat(const std::string &text) const
+void GuildHandler::chat(const std::string &text A_UNUSED) const
{
- if (!localPlayer)
- return;
-
- const std::string str = std::string(localPlayer->getName()).append(
- " : ").append(text);
- createOutPacket(CMSG_GUILD_MESSAGE);
- outMsg.writeInt16(CAST_U16(str.size() + 4), "len");
- outMsg.writeString(str, CAST_S32(str.length()), "message");
}
void GuildHandler::memberList() const
{
- // 0 = basic info + alliance info
- // 1 = position name list + member list
- // 2 = position name list + position info list
- // 3 = skill info
- // 4 = expulsion list
-
- createOutPacket(CMSG_GUILD_REQUEST_INFO);
- outMsg.writeInt32(1, "action"); // Request member list
}
void GuildHandler::info() const
{
- // 0 = basic info + alliance info
- // 1 = position name list + member list
- // 2 = position name list + position info list
- // 3 = skill info
- // 4 = expulsion list
-
- Ea::GuildRecv::showBasicInfo = true;
- createOutPacket(CMSG_GUILD_REQUEST_INFO);
- outMsg.writeInt32(0, "action"); // Request basic info
}
-void GuildHandler::changeMemberPostion(const GuildMember *const member,
- const int level) const
+void GuildHandler::changeMemberPostion(const GuildMember *const member
+ A_UNUSED,
+ const int level A_UNUSED) const
{
- if (!member || !member->getGuild())
- return;
-
- createOutPacket(CMSG_GUILD_CHANGE_MEMBER_POS);
- outMsg.writeInt16(16, "len");
- outMsg.writeBeingId(member->getID(), "account id");
- outMsg.writeInt32(member->getCharId(), "char id");
- outMsg.writeInt32(level, "position");
}
-void GuildHandler::changeNotice(const int guildId,
- const std::string &restrict msg1,
- const std::string &restrict msg2) const
+void GuildHandler::changeNotice(const int guildId A_UNUSED,
+ const std::string &restrict msg1 A_UNUSED,
+ const std::string &restrict msg2 A_UNUSED)
+ const
{
- createOutPacket(CMSG_GUILD_CHANGE_NOTICE);
- outMsg.writeInt32(guildId, "guild id");
- outMsg.writeString(msg1, 60, "msg1");
- outMsg.writeString(msg2, 120, "msg2");
}
void GuildHandler::checkMaster() const
{
- createOutPacket(CMSG_GUILD_CHECK_MASTER);
}
void GuildHandler::requestAlliance(const Being *const being A_UNUSED) const