ManaPlus
battlegroundrecv.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 "actormanager.h"
25 #include "logger.h"
26 
27 #include "being/being.h"
28 
29 #include "net/messagein.h"
30 
31 #include "debug.h"
32 
33 namespace EAthena
34 {
35 
37 {
39  msg.readBeingId("account id");
40  msg.readString(24, "name");
41  msg.readInt16("bg id");
42 }
43 
45 {
46  if (actorManager == nullptr)
47  return;
48  const BeingId id = msg.readBeingId("account id");
49  msg.readString(24, "name");
50  msg.readInt16("bg id");
51  const int teamId = msg.readInt16("team id");
52 
53  Being *const dstBeing = actorManager->findBeing(id);
54  if (dstBeing != nullptr)
55  dstBeing->setTeamId(CAST_U16(teamId));
56 }
57 
59 {
61  msg.readInt16("camp a points");
62  msg.readInt16("camp b points");
63 }
64 
66 {
68  msg.readBeingId("account id");
69  msg.readString(24, "name");
70  msg.readInt16("class");
71  msg.readInt16("x");
72  msg.readInt16("y");
73 }
74 
76 {
78  msg.readString(24, "battle ground name");
79 }
80 
82 {
84  msg.readUInt8("type");
85  msg.readString(24, "bg name");
86 }
87 
89 {
91  msg.readString(24, "bg name");
92  msg.readString(24, "game name");
93 }
94 
96 {
98  msg.readUInt8("type");
99  msg.readString(24, "bg name");
100 }
101 
103 {
105  msg.readString(24, "name");
106  msg.readInt32("position");
107 }
108 
110 {
112  msg.readBeingId("account id");
113  if (msg.getVersion() >= 20140613)
114  {
115  msg.readInt32("hp");
116  msg.readInt32("max hp");
117  }
118  else
119  {
120  msg.readString(24, "name");
121  msg.readInt16("hp");
122  msg.readInt16("max hp");
123  }
124 }
125 
126 } // namespace EAthena
ActorManager * actorManager
int BeingId
Definition: beingid.h:30
#define CAST_U16
Definition: cast.h:29
Being * findBeing(const BeingId id) const
Definition: being.h:96
void setTeamId(const uint16_t teamId)
Definition: being.cpp:5187
#define UNIMPLEMENTEDPACKET
Definition: logger.h:56
bool msg(InputEvent &event)
Definition: chat.cpp:39
void processBattleUpdateHp(Net::MessageIn &msg)
void processBattleBegins(Net::MessageIn &msg)
void processBattlePlay(Net::MessageIn &msg)
void processBattleEmblem(Net::MessageIn &msg)
void processBattleUpdateCoords(Net::MessageIn &msg)
void processBattleUpdateScore(Net::MessageIn &msg)
void processBattleEmblem2(Net::MessageIn &msg)
void processBattleNoticeDelete(Net::MessageIn &msg)
void processBattleQueueAck(Net::MessageIn &msg)
void processBattleJoined(Net::MessageIn &msg)