1 |
|
|
/* |
2 |
|
|
* The ManaPlus Client |
3 |
|
|
* Copyright (C) 2011-2019 The ManaPlus Developers |
4 |
|
|
* Copyright (C) 2019-2021 Andrei Karas |
5 |
|
|
* |
6 |
|
|
* This file is part of The ManaPlus Client. |
7 |
|
|
* |
8 |
|
|
* This program is free software; you can redistribute it and/or modify |
9 |
|
|
* it under the terms of the GNU General Public License as published by |
10 |
|
|
* the Free Software Foundation; either version 2 of the License, or |
11 |
|
|
* any later version. |
12 |
|
|
* |
13 |
|
|
* This program is distributed in the hope that it will be useful, |
14 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 |
|
|
* GNU General Public License for more details. |
17 |
|
|
* |
18 |
|
|
* You should have received a copy of the GNU General Public License |
19 |
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
20 |
|
|
*/ |
21 |
|
|
|
22 |
|
|
#include "net/eathena/friendsrecv.h" |
23 |
|
|
|
24 |
|
|
#include "logger.h" |
25 |
|
|
|
26 |
|
|
#include "net/messagein.h" |
27 |
|
|
|
28 |
|
|
#include "debug.h" |
29 |
|
|
|
30 |
|
|
extern int packetVersionMain; |
31 |
|
|
extern int packetVersionRe; |
32 |
|
|
|
33 |
|
|
namespace EAthena |
34 |
|
|
{ |
35 |
|
|
|
36 |
|
|
void FriendsRecv::processPlayerOnline(Net::MessageIn &msg) |
37 |
|
|
{ |
38 |
|
|
UNIMPLEMENTEDPACKET; |
39 |
|
|
msg.readBeingId("account id"); |
40 |
|
|
msg.readInt32("char id"); |
41 |
|
|
msg.readUInt8("flag"); // 0 - online, 1 - offline |
42 |
|
|
if (packetVersionMain >= 20180307 || packetVersionRe >= 20180221) |
43 |
|
|
msg.readString(24, "player name"); |
44 |
|
|
} |
45 |
|
|
|
46 |
|
|
void FriendsRecv::processFriendsList(Net::MessageIn &msg) |
47 |
|
|
{ |
48 |
|
|
UNIMPLEMENTEDPACKET; |
49 |
|
|
const int count = (msg.readInt16("size") - 4) / 32; |
50 |
|
|
for (int f = 0; f < count; f ++) |
51 |
|
|
{ |
52 |
|
|
msg.readBeingId("account id"); |
53 |
|
|
msg.readInt32("char id"); |
54 |
|
|
if (!(packetVersionMain >= 20180307 || packetVersionRe >= 20180221)) |
55 |
|
|
msg.readString(24, "name"); |
56 |
|
|
} |
57 |
|
|
} |
58 |
|
|
|
59 |
|
|
void FriendsRecv::processRequestAck(Net::MessageIn &msg) |
60 |
|
|
{ |
61 |
|
|
UNIMPLEMENTEDPACKET; |
62 |
|
|
msg.readInt16("type"); |
63 |
|
|
msg.readBeingId("account id"); |
64 |
|
|
msg.readInt32("char id"); |
65 |
|
|
msg.readString(24, "name"); |
66 |
|
|
} |
67 |
|
|
|
68 |
|
|
void FriendsRecv::processRequest(Net::MessageIn &msg) |
69 |
|
|
{ |
70 |
|
|
UNIMPLEMENTEDPACKET; |
71 |
|
|
msg.readBeingId("account id"); |
72 |
|
|
msg.readInt32("char id"); |
73 |
|
|
msg.readString(24, "name"); |
74 |
|
|
} |
75 |
|
|
|
76 |
|
|
void FriendsRecv::processDeletePlayer(Net::MessageIn &msg) |
77 |
|
|
{ |
78 |
|
|
UNIMPLEMENTEDPACKET; |
79 |
|
|
msg.readBeingId("account id"); |
80 |
|
|
msg.readInt32("char id"); |
81 |
|
|
} |
82 |
|
|
|
83 |
|
|
} // namespace EAthena |