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/auctionrecv.h" |
23 |
|
|
|
24 |
|
|
#include "logger.h" |
25 |
|
|
|
26 |
|
|
#include "const/resources/item/cards.h" |
27 |
|
|
|
28 |
|
|
#include "net/messagein.h" |
29 |
|
|
|
30 |
|
|
#include "debug.h" |
31 |
|
|
|
32 |
|
|
namespace EAthena |
33 |
|
|
{ |
34 |
|
|
|
35 |
|
|
void AuctionRecv::processOpenWindow(Net::MessageIn &msg) |
36 |
|
|
{ |
37 |
|
|
UNIMPLEMENTEDPACKET; |
38 |
|
|
msg.readInt32("flag"); // 0 - open, 1 - close |
39 |
|
|
} |
40 |
|
|
|
41 |
|
|
void AuctionRecv::processAuctionResults(Net::MessageIn &msg) |
42 |
|
|
{ |
43 |
|
|
UNIMPLEMENTEDPACKET; |
44 |
|
|
msg.readInt16("len"); |
45 |
|
|
msg.readInt32("pages"); |
46 |
|
|
const int itemCount = msg.readInt32("items count"); |
47 |
|
|
for (int f = 0; f < itemCount; f ++) |
48 |
|
|
{ |
49 |
|
|
msg.readInt32("auction id"); |
50 |
|
|
msg.readString(24, "seller name"); |
51 |
|
|
msg.readInt16("item id"); // here item always 16 bit |
52 |
|
|
msg.readInt32("auction type"); |
53 |
|
|
msg.readInt16("item amount"); // always 1 |
54 |
|
|
msg.readUInt8("identify"); |
55 |
|
|
msg.readUInt8("attribute"); |
56 |
|
|
msg.readUInt8("refine"); |
57 |
|
|
for (int d = 0; d < maxCards; d ++) |
58 |
|
|
msg.readUInt16("card"); // here item always 16 bit |
59 |
|
|
msg.readInt32("price"); |
60 |
|
|
msg.readInt32("buy now"); |
61 |
|
|
msg.readString(24, "buyer name"); |
62 |
|
|
msg.readInt32("timestamp"); |
63 |
|
|
// +++ need use ItemColorManager for color |
64 |
|
|
} |
65 |
|
|
} |
66 |
|
|
|
67 |
|
|
void AuctionRecv::processAuctionSetItem(Net::MessageIn &msg) |
68 |
|
|
{ |
69 |
|
|
UNIMPLEMENTEDPACKET; |
70 |
|
|
msg.readInt16("index"); |
71 |
|
|
msg.readUInt8("flag"); |
72 |
|
|
} |
73 |
|
|
|
74 |
|
|
void AuctionRecv::processAuctionMessage(Net::MessageIn &msg) |
75 |
|
|
{ |
76 |
|
|
UNIMPLEMENTEDPACKET; |
77 |
|
|
msg.readUInt8("message"); |
78 |
|
|
} |
79 |
|
|
|
80 |
|
|
void AuctionRecv::processAuctionClose(Net::MessageIn &msg) |
81 |
|
|
{ |
82 |
|
|
UNIMPLEMENTEDPACKET; |
83 |
|
|
msg.readInt16("flag"); |
84 |
|
|
} |
85 |
|
|
|
86 |
|
|
} // namespace EAthena |