GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/net/eathena/battlegroundrecv.cpp Lines: 1 53 1.9 %
Date: 2017-11-29 Branches: 0 4 0.0 %

Line Branch Exec Source
1
/*
2
 *  The ManaPlus Client
3
 *  Copyright (C) 2011-2017  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
    const BeingId id = msg.readBeingId("account id");
46
    msg.readString(24, "name");
47
    msg.readInt16("bg id");
48
    const int teamId = msg.readInt16("team id");
49
50
    Being *const dstBeing = actorManager->findBeing(id);
51
    if (dstBeing != nullptr)
52
        dstBeing->setTeamId(CAST_U16(teamId));
53
}
54
55
void BattleGroundRecv::processBattleUpdateScore(Net::MessageIn &msg)
56
{
57
    UNIMPLEMENTEDPACKET;
58
    msg.readInt16("camp a points");
59
    msg.readInt16("camp b points");
60
}
61
62
void BattleGroundRecv::processBattleUpdateCoords(Net::MessageIn &msg)
63
{
64
    UNIMPLEMENTEDPACKET;
65
    msg.readBeingId("account id");
66
    msg.readString(24, "name");
67
    msg.readInt16("class");
68
    msg.readInt16("x");
69
    msg.readInt16("y");
70
}
71
72
void BattleGroundRecv::processBattlePlay(Net::MessageIn &msg)
73
{
74
    UNIMPLEMENTEDPACKET;
75
    msg.readString(24, "battle ground name");
76
}
77
78
void BattleGroundRecv::processBattleQueueAck(Net::MessageIn &msg)
79
{
80
    UNIMPLEMENTEDPACKET;
81
    msg.readUInt8("type");
82
    msg.readString(24, "bg name");
83
}
84
85
void BattleGroundRecv::processBattleBegins(Net::MessageIn &msg)
86
{
87
    UNIMPLEMENTEDPACKET;
88
    msg.readString(24, "bg name");
89
    msg.readString(24, "game name");
90
}
91
92
void BattleGroundRecv::processBattleNoticeDelete(Net::MessageIn &msg)
93
{
94
    UNIMPLEMENTEDPACKET;
95
    msg.readUInt8("type");
96
    msg.readString(24, "bg name");
97
}
98
99
void BattleGroundRecv::processBattleJoined(Net::MessageIn &msg)
100
{
101
    UNIMPLEMENTEDPACKET;
102
    msg.readString(24, "name");
103
    msg.readInt32("position");
104
}
105
106
void BattleGroundRecv::processBattleUpdateHp(Net::MessageIn &msg)
107
{
108
    UNIMPLEMENTEDPACKET;
109
    msg.readBeingId("account id");
110
    if (msg.getVersion() >= 20140613)
111
    {
112
        msg.readInt32("hp");
113
        msg.readInt32("max hp");
114
    }
115
    else
116
    {
117
        msg.readString(24, "name");
118
        msg.readInt16("hp");
119
        msg.readInt16("max hp");
120
    }
121
}
122
123
4
}  // namespace EAthena