From 6fd6deb1ba87ddf74bff15055421f2b434b96f85 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 26 Aug 2015 15:02:51 +0300 Subject: Move receive code from friendshandler into separate file. --- src/net/eathena/friendshandler.cpp | 55 +++++--------------------------------- 1 file changed, 6 insertions(+), 49 deletions(-) (limited to 'src/net/eathena/friendshandler.cpp') diff --git a/src/net/eathena/friendshandler.cpp b/src/net/eathena/friendshandler.cpp index 43634d9fc..a2e01bc79 100644 --- a/src/net/eathena/friendshandler.cpp +++ b/src/net/eathena/friendshandler.cpp @@ -22,6 +22,7 @@ #include "logger.h" +#include "net/eathena/friendsrecv.h" #include "net/eathena/messageout.h" #include "net/eathena/protocol.h" @@ -53,23 +54,23 @@ void FriendsHandler::handleMessage(Net::MessageIn &msg) switch (msg.getId()) { case SMSG_FRIENDS_PLAYER_ONLINE: - processPlayerOnline(msg); + FriendsRecv::processPlayerOnline(msg); break; case SMSG_FRIENDS_LIST: - processFriendsList(msg); + FriendsRecv::processFriendsList(msg); break; case SMSG_FRIENDS_REQUEST_ACK: - processRequestAck(msg); + FriendsRecv::processRequestAck(msg); break; case SMSG_FRIENDS_REQUEST: - processRequest(msg); + FriendsRecv::processRequest(msg); break; case SMSG_FRIENDS_DELETE_PLAYER: - processDeletePlayer(msg); + FriendsRecv::processDeletePlayer(msg); break; default: @@ -77,43 +78,6 @@ void FriendsHandler::handleMessage(Net::MessageIn &msg) } } -void FriendsHandler::processPlayerOnline(Net::MessageIn &msg) -{ - UNIMPLIMENTEDPACKET; - msg.readBeingId("account id"); - msg.readInt32("char id"); - msg.readUInt8("flag"); // 0 - online, 1 - offline -} - -void FriendsHandler::processFriendsList(Net::MessageIn &msg) -{ - UNIMPLIMENTEDPACKET; - const int count = (msg.readInt16("size") - 4) / 32; - for (int f = 0; f < count; f ++) - { - msg.readBeingId("account id"); - msg.readInt32("char id"); - msg.readString(24, "name"); - } -} - -void FriendsHandler::processRequestAck(Net::MessageIn &msg) -{ - UNIMPLIMENTEDPACKET; - msg.readInt16("type"); - msg.readBeingId("account id"); - msg.readInt32("char id"); - msg.readString(24, "name"); -} - -void FriendsHandler::processRequest(Net::MessageIn &msg) -{ - UNIMPLIMENTEDPACKET; - msg.readBeingId("account id"); - msg.readInt32("char id"); - msg.readString(24, "name"); -} - void FriendsHandler::invite(const std::string &name) const { createOutPacket(CMSG_FRIENDS_ADD_PLAYER); @@ -137,11 +101,4 @@ void FriendsHandler::remove(const int accountId, const int charId) const outMsg.writeInt32(charId, "char id"); } -void FriendsHandler::processDeletePlayer(Net::MessageIn &msg) -{ - UNIMPLIMENTEDPACKET; - msg.readBeingId("account id"); - msg.readInt32("char id"); -} - } // namespace EAthena -- cgit v1.2.3-70-g09d2