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 |
|
|
|
22 |
|
|
#include "net/eathena/rouletterecv.h" |
23 |
|
|
|
24 |
|
|
#include "logger.h" |
25 |
|
|
|
26 |
|
|
#include "net/messagein.h" |
27 |
|
|
|
28 |
|
|
#include "debug.h" |
29 |
|
|
|
30 |
|
|
namespace EAthena |
31 |
|
|
{ |
32 |
|
|
|
33 |
|
|
void RouletteRecv::processRouletteInfoAckType(Net::MessageIn &msg) |
34 |
|
|
{ |
35 |
|
|
UNIMPLEMENTEDPACKET; |
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 |
|
|
|
57 |
|
|
void RouletteRecv::processRouletteItemAck(Net::MessageIn &msg) |
58 |
|
|
{ |
59 |
|
|
UNIMPLEMENTEDPACKET; |
60 |
|
|
msg.readUInt8("result"); |
61 |
|
|
msg.readItemId("item id"); |
62 |
|
|
} |
63 |
|
|
|
64 |
|
|
void RouletteRecv::processRouletteGenerateAckType(Net::MessageIn &msg) |
65 |
|
|
{ |
66 |
|
|
UNIMPLEMENTEDPACKET; |
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 |
|
|
|
76 |
|
|
void RouletteRecv::processRouletteOpenAck(Net::MessageIn &msg) |
77 |
|
|
{ |
78 |
|
|
UNIMPLEMENTEDPACKET; |
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 |
|
|
|
89 |
|
|
void RouletteRecv::processRouletteClose(Net::MessageIn &msg) |
90 |
|
|
{ |
91 |
|
|
UNIMPLEMENTEDPACKET; |
92 |
|
|
msg.readUInt8("result"); |
93 |
|
|
} |
94 |
|
|
|
95 |
|
|
} // namespace EAthena |