ManaPlus
friendsrecv.cpp
Go to the documentation of this file.
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 
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 
37 {
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 
47 {
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 
60 {
62  msg.readInt16("type");
63  msg.readBeingId("account id");
64  msg.readInt32("char id");
65  msg.readString(24, "name");
66 }
67 
69 {
71  msg.readBeingId("account id");
72  msg.readInt32("char id");
73  msg.readString(24, "name");
74 }
75 
77 {
79  msg.readBeingId("account id");
80  msg.readInt32("char id");
81 }
82 
83 } // namespace EAthena
int packetVersionRe
Definition: client.cpp:127
int packetVersionMain
Definition: client.cpp:126
#define UNIMPLEMENTEDPACKET
Definition: logger.h:56
bool msg(InputEvent &event)
Definition: chat.cpp:39
void processFriendsList(Net::MessageIn &msg)
Definition: friendsrecv.cpp:46
void processDeletePlayer(Net::MessageIn &msg)
Definition: friendsrecv.cpp:76
void processRequest(Net::MessageIn &msg)
Definition: friendsrecv.cpp:68
void processRequestAck(Net::MessageIn &msg)
Definition: friendsrecv.cpp:59
void processPlayerOnline(Net::MessageIn &msg)
Definition: friendsrecv.cpp:36