GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/net/eathena/friendsrecv.cpp Lines: 0 30 0.0 %
Date: 2018-09-20 Branches: 0 10 0.0 %

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