ManaPlus
searchstorerecv.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 #include "notifymanager.h"
26 
28 
30 
31 #include "net/messagein.h"
32 
33 #include "debug.h"
34 
35 extern int itemIdLen;
36 
37 namespace EAthena
38 {
39 
41 {
43  const int count = (msg.readInt16("len") - 7) / (104 + itemIdLen);
44  msg.readUInt8("is first page");
45  msg.readUInt8("is next page");
46  msg.readUInt8("remain uses");
47  for (int f = 0; f < count; f ++)
48  {
49  msg.readInt32("store id");
50  msg.readInt32("aoount id");
51  msg.readString(80, "store name");
52  msg.readItemId("item id");
53  msg.readUInt8("item type");
54  msg.readInt32("price");
55  msg.readInt16("amount");
56  msg.readUInt8("refine");
57  for (int d = 0; d < maxCards; d++)
58  msg.readItemId("card");
59  if (msg.getVersion() >= 20150226)
60  {
61  for (int d = 0; d < 5; d ++)
62  {
63  msg.readInt16("option index");
64  msg.readInt16("option value");
65  msg.readUInt8("option param");
66  }
67  }
68 
69  // +++ need use ItemColorManager for colors
70  }
71 }
72 
74 {
76  const int result = msg.readUInt8("result");
77  switch (result)
78  {
79  case 0:
82  break;
83  case 1:
86  break;
87  case 2:
90  break;
91  case 3:
94  break;
95  case 4:
98  break;
99  default:
102  break;
103  }
104 }
105 
107 {
109  msg.readInt16("effect");
110  if (msg.getVersion() >= 20100701)
111  msg.readUInt8("uses");
112 }
113 
115 {
117  msg.readInt16("x");
118  msg.readInt16("y");
119 }
120 
121 } // namespace EAthena
#define maxCards
Definition: cards.h:25
#define UNIMPLEMENTEDPACKET
Definition: logger.h:56
bool msg(InputEvent &event)
Definition: chat.cpp:39
void processSearchOpen(Net::MessageIn &msg)
void processSearchAck(Net::MessageIn &msg)
void processSearchFailed(Net::MessageIn &msg)
void processSearchClickAck(Net::MessageIn &msg)
void notify(const unsigned int message)
@ SEARCH_STORE_FAILED_CANT_SEARCH_YET
Definition: notifytypes.h:145
@ SEARCH_STORE_FAILED_MANY_RESULTS
Definition: notifytypes.h:143
@ SEARCH_STORE_FAILED_NO_STORES
Definition: notifytypes.h:142
@ SEARCH_STORE_FAILED
Definition: notifytypes.h:141
@ SEARCH_STORE_FAILED_CANT_SEARCH_ANYMORE
Definition: notifytypes.h:144
@ SEARCH_STORE_FAILED_NO_INFORMATION
Definition: notifytypes.h:146
int itemIdLen
Definition: client.cpp:130