ManaPlus
rouletterecv.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 namespace EAthena
31 {
32 
34 {
36  const int count = (msg.readInt16("len") - 8) / 8;
37  msg.readInt32("serial");
38 
39  for (int f = 0; f < count; f ++)
40  {
41  msg.readInt16("row");
42  msg.readInt16("position");
43  if (msg.getVersion() >= 20180511)
44  {
45  msg.readInt32("item id");
46  msg.readInt16("count");
47  msg.readInt16("unused");
48  }
49  else
50  {
51  msg.readInt16("item id");
52  msg.readInt16("count");
53  }
54  }
55 }
56 
58 {
60  msg.readUInt8("result");
61  msg.readItemId("item id");
62 }
63 
65 {
67  msg.readUInt8("result");
68  msg.readInt16("step");
69  msg.readInt16("idx");
70  msg.readItemId("item id");
71  msg.readInt32("remain gold");
72  msg.readInt32("remain silver");
73  msg.readInt32("remain bronze");
74 }
75 
77 {
79  msg.readUInt8("result");
80  msg.readInt32("serial");
81  msg.readUInt8("step");
82  msg.readUInt8("idx");
83  msg.readItemId("additional item id");
84  msg.readInt32("gold point");
85  msg.readInt32("silver point");
86  msg.readInt32("bronze point");
87 }
88 
90 {
92  msg.readUInt8("result");
93 }
94 
95 } // namespace EAthena
#define UNIMPLEMENTEDPACKET
Definition: logger.h:56
bool msg(InputEvent &event)
Definition: chat.cpp:39
void processRouletteClose(Net::MessageIn &msg)
void processRouletteInfoAckType(Net::MessageIn &msg)
void processRouletteOpenAck(Net::MessageIn &msg)
void processRouletteGenerateAckType(Net::MessageIn &msg)
void processRouletteItemAck(Net::MessageIn &msg)