ManaPlus
refinerecv.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 
22 #include "net/eathena/refinerecv.h"
23 
24 #include "logger.h"
25 
26 #include "net/messagein.h"
27 
28 #include "debug.h"
29 
30 extern int itemIdLen;
31 
32 namespace EAthena
33 {
34 
36 {
38 }
39 
41 {
43  int blockSize = 7;
44  if (itemIdLen == 4)
45  blockSize += 2;
46 
47  const int count = (msg.readInt16("len") - 7) / blockSize;
48  msg.readInt16("item index");
49  msg.readUInt8("blacksmith blessing");
50  for (int f = 0; f < count; f ++)
51  {
52  msg.readItemId("item id");
53  msg.readUInt8("chance");
54  msg.readInt32("money");
55  }
56 }
57 
59 {
61  msg.readString(24, "char name");
62  msg.readItemId("item id");
63  msg.readInt8("refine level");
64  msg.readInt8("status");
65 }
66 
67 } // namespace EAthena
#define UNIMPLEMENTEDPACKET
Definition: logger.h:56
bool msg(InputEvent &event)
Definition: chat.cpp:39
void processRefineAddItem(Net::MessageIn &msg)
Definition: refinerecv.cpp:40
void processRefineAnnounce(Net::MessageIn &msg)
Definition: refinerecv.cpp:58
void processRefineOpen(Net::MessageIn &msg)
Definition: refinerecv.cpp:35
int itemIdLen
Definition: client.cpp:130