GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/net/eathena/battlegroundrecv.cpp Lines: 1 54 1.9 %
Date: 2018-05-24 20:11:55 Branches: 0 6 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/battlegroundrecv.h"
22
23
#include "actormanager.h"
24
#include "logger.h"
25
26
#include "being/being.h"
27
28
#include "net/messagein.h"
29
30
#include "debug.h"
31
32
namespace EAthena
33
{
34
35
void BattleGroundRecv::processBattleEmblem(Net::MessageIn &msg)
36
{
37
    UNIMPLEMENTEDPACKET;
38
    msg.readBeingId("account id");
39
    msg.readString(24, "name");
40
    msg.readInt16("bg id");
41
}
42
43
void BattleGroundRecv::processBattleEmblem2(Net::MessageIn &msg)
44
{
45
    if (actorManager == nullptr)
46
        return;
47
    const BeingId id = msg.readBeingId("account id");
48
    msg.readString(24, "name");
49
    msg.readInt16("bg id");
50
    const int teamId = msg.readInt16("team id");
51
52
    Being *const dstBeing = actorManager->findBeing(id);
53
    if (dstBeing != nullptr)
54
        dstBeing->setTeamId(CAST_U16(teamId));
55
}
56
57
void BattleGroundRecv::processBattleUpdateScore(Net::MessageIn &msg)
58
{
59
    UNIMPLEMENTEDPACKET;
60
    msg.readInt16("camp a points");
61
    msg.readInt16("camp b points");
62
}
63
64
void BattleGroundRecv::processBattleUpdateCoords(Net::MessageIn &msg)
65
{
66
    UNIMPLEMENTEDPACKET;
67
    msg.readBeingId("account id");
68
    msg.readString(24, "name");
69
    msg.readInt16("class");
70
    msg.readInt16("x");
71
    msg.readInt16("y");
72
}
73
74
void BattleGroundRecv::processBattlePlay(Net::MessageIn &msg)
75
{
76
    UNIMPLEMENTEDPACKET;
77
    msg.readString(24, "battle ground name");
78
}
79
80
void BattleGroundRecv::processBattleQueueAck(Net::MessageIn &msg)
81
{
82
    UNIMPLEMENTEDPACKET;
83
    msg.readUInt8("type");
84
    msg.readString(24, "bg name");
85
}
86
87
void BattleGroundRecv::processBattleBegins(Net::MessageIn &msg)
88
{
89
    UNIMPLEMENTEDPACKET;
90
    msg.readString(24, "bg name");
91
    msg.readString(24, "game name");
92
}
93
94
void BattleGroundRecv::processBattleNoticeDelete(Net::MessageIn &msg)
95
{
96
    UNIMPLEMENTEDPACKET;
97
    msg.readUInt8("type");
98
    msg.readString(24, "bg name");
99
}
100
101
void BattleGroundRecv::processBattleJoined(Net::MessageIn &msg)
102
{
103
    UNIMPLEMENTEDPACKET;
104
    msg.readString(24, "name");
105
    msg.readInt32("position");
106
}
107
108
void BattleGroundRecv::processBattleUpdateHp(Net::MessageIn &msg)
109
{
110
    UNIMPLEMENTEDPACKET;
111
    msg.readBeingId("account id");
112
    if (msg.getVersion() >= 20140613)
113
    {
114
        msg.readInt32("hp");
115
        msg.readInt32("max hp");
116
    }
117
    else
118
    {
119
        msg.readString(24, "name");
120
        msg.readInt16("hp");
121
        msg.readInt16("max hp");
122
    }
123
}
124
125
4
}  // namespace EAthena