summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-10-14 00:20:27 +0300
committerAndrei Karas <akaras@inbox.ru>2014-10-14 00:20:27 +0300
commitf676561f759c2be6e51c68b085b7d01ee98fc0d4 (patch)
treeb1868eb2a4a519c6531c20dda1c3a88ef183157c /src/net
parent55901aee07fe748590acb31b69777b1b6e914b6c (diff)
downloadmanaplus-f676561f759c2be6e51c68b085b7d01ee98fc0d4.tar.gz
manaplus-f676561f759c2be6e51c68b085b7d01ee98fc0d4.tar.bz2
manaplus-f676561f759c2be6e51c68b085b7d01ee98fc0d4.tar.xz
manaplus-f676561f759c2be6e51c68b085b7d01ee98fc0d4.zip
eathena: add partial support for packet SMSG_FRIENDS_LIST 0x0201.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/eathena/friendshandler.cpp16
-rw-r--r--src/net/eathena/friendshandler.h2
-rw-r--r--src/net/eathena/packets.h2
-rw-r--r--src/net/eathena/protocol.h1
4 files changed, 20 insertions, 1 deletions
diff --git a/src/net/eathena/friendshandler.cpp b/src/net/eathena/friendshandler.cpp
index c5bb7e8b5..0f57e9eea 100644
--- a/src/net/eathena/friendshandler.cpp
+++ b/src/net/eathena/friendshandler.cpp
@@ -35,6 +35,7 @@ FriendsHandler::FriendsHandler() :
static const uint16_t _messages[] =
{
SMSG_FRIENDS_PLAYER_ONLINE,
+ SMSG_FRIENDS_LIST,
0
};
handledMessages = _messages;
@@ -49,6 +50,10 @@ void FriendsHandler::handleMessage(Net::MessageIn &msg)
processPlayerOnline(msg);
break;
+ case SMSG_FRIENDS_LIST:
+ processFriendsList(msg);
+ break;
+
default:
break;
}
@@ -61,4 +66,15 @@ void FriendsHandler::processPlayerOnline(Net::MessageIn &msg)
msg.readUInt8("flag"); // 0 - online, 1 - offline
}
+void FriendsHandler::processFriendsList(Net::MessageIn &msg)
+{
+ const int count = (msg.readInt16("size") - 4) / 32;
+ for (int f = 0; f < count; f ++)
+ {
+ msg.readInt32("account id");
+ msg.readInt32("char id");
+ msg.readString(24, "name");
+ }
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/friendshandler.h b/src/net/eathena/friendshandler.h
index 5616a4cf4..12a1c1df6 100644
--- a/src/net/eathena/friendshandler.h
+++ b/src/net/eathena/friendshandler.h
@@ -39,6 +39,8 @@ class FriendsHandler final : public MessageHandler,
protected:
void processPlayerOnline(Net::MessageIn &msg);
+
+ void processFriendsList(Net::MessageIn &msg);
};
} // namespace EAthena
diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h
index fd4749989..cefeaafaa 100644
--- a/src/net/eathena/packets.h
+++ b/src/net/eathena/packets.h
@@ -83,7 +83,7 @@ int16_t packet_lengths[] =
//0 1 2 3 4 5 6 7 8 9 a b c d e f
//0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// #0x0200
- 26, 0, 0, 0, 18, 26, 11, 0, 0, 0, 0, 19, 10, 0, 0, 0,
+ 26, -1, 0, 0, 18, 26, 11, 0, 0, 0, 0, 19, 10, 0, 0, 0,
22, -1, 16, 0, 42, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-1, 122, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 19, 71, 5,
12, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h
index 113c7d8a6..d80050079 100644
--- a/src/net/eathena/protocol.h
+++ b/src/net/eathena/protocol.h
@@ -288,6 +288,7 @@
#define SMSG_HOMUNCULUS_FOOD 0x022f
#define SMSG_FRIENDS_PLAYER_ONLINE 0x0206
+#define SMSG_FRIENDS_LIST 0x0201
/**********************************
* Packets from client to server *