summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-06 19:59:04 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-06 19:59:04 +0300
commit97a8156a1252806f8789fb6d4ae333b0e4cf88f6 (patch)
tree81c686cb02a23b038318c6c131ee0162344b4ae7
parente5a57674e9cd7502e13218d20d7067f2fb4d96f5 (diff)
downloadplus-97a8156a1252806f8789fb6d4ae333b0e4cf88f6.tar.gz
plus-97a8156a1252806f8789fb6d4ae333b0e4cf88f6.tar.bz2
plus-97a8156a1252806f8789fb6d4ae333b0e4cf88f6.tar.xz
plus-97a8156a1252806f8789fb6d4ae333b0e4cf88f6.zip
eathena: add packet SMSG_BUYINGSTORE_SELL_FAILED 0x081a.
-rw-r--r--src/net/eathena/buyingstorehandler.cpp23
-rw-r--r--src/net/eathena/buyingstorehandler.h2
-rw-r--r--src/net/eathena/packets.h2
-rw-r--r--src/net/eathena/protocol.h1
-rw-r--r--src/resources/notifications.h12
-rw-r--r--src/resources/notifytypes.h3
6 files changed, 42 insertions, 1 deletions
diff --git a/src/net/eathena/buyingstorehandler.cpp b/src/net/eathena/buyingstorehandler.cpp
index 3e3451db2..4ce4378bc 100644
--- a/src/net/eathena/buyingstorehandler.cpp
+++ b/src/net/eathena/buyingstorehandler.cpp
@@ -50,6 +50,7 @@ BuyingStoreHandler::BuyingStoreHandler() :
SMSG_BUYINGSTORE_SHOW_BOARD,
SMSG_BUYINGSTORE_HIDE_BOARD,
SMSG_BUYINGSTORE_ITEMS_LIST,
+ SMSG_BUYINGSTORE_SELL_FAILED,
0
};
handledMessages = _messages;
@@ -84,6 +85,10 @@ void BuyingStoreHandler::handleMessage(Net::MessageIn &msg)
processBuyingStoreItemsList(msg);
break;
+ case SMSG_BUYINGSTORE_SELL_FAILED:
+ processBuyingStoreSellFailed(msg);
+ break;
+
default:
break;
}
@@ -156,6 +161,24 @@ void BuyingStoreHandler::processBuyingStoreItemsList(Net::MessageIn &msg)
}
}
+void BuyingStoreHandler::processBuyingStoreSellFailed(Net::MessageIn &msg)
+{
+ const int16_t result = msg.readInt16("result");
+ switch (result)
+ {
+ case 3:
+ NotifyManager::notify(
+ NotifyTypes::BUYING_STORE_SELL_FAILED_MONEY_LIMIT);
+ break;
+ case 4:
+ NotifyManager::notify(NotifyTypes::BUYING_STORE_SELL_FAILED_EMPTY);
+ break;
+ default:
+ NotifyManager::notify(NotifyTypes::BUYING_STORE_SELL_FAILED);
+ break;
+ }
+}
+
void BuyingStoreHandler::create(const std::string &name,
const int maxMoney,
const bool flag,
diff --git a/src/net/eathena/buyingstorehandler.h b/src/net/eathena/buyingstorehandler.h
index e13ed5731..906b68bf2 100644
--- a/src/net/eathena/buyingstorehandler.h
+++ b/src/net/eathena/buyingstorehandler.h
@@ -64,6 +64,8 @@ class BuyingStoreHandler final : public MessageHandler,
static void processBuyingStoreHideBoard(Net::MessageIn &msg);
static void processBuyingStoreItemsList(Net::MessageIn &msg);
+
+ static void processBuyingStoreSellFailed(Net::MessageIn &msg);
};
} // namespace EAthena
diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h
index 54e5b21f1..e5f085949 100644
--- a/src/net/eathena/packets.h
+++ b/src/net/eathena/packets.h
@@ -216,7 +216,7 @@ int16_t packet_lengths[] =
//0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// #0x0800
-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 20,
- 3, 0, 8, -1, 86, -1, 0, 0, -1, 0, 0, 0, 0, 22, 8, 0,
+ 3, 0, 8, -1, 86, -1, 0, 0, -1, 0, 4, 0, 0, 22, 8, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 26, 0,
// #0x0840
diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h
index 4b2e2ae03..abf18a2f3 100644
--- a/src/net/eathena/protocol.h
+++ b/src/net/eathena/protocol.h
@@ -173,6 +173,7 @@
#define SMSG_BUYINGSTORE_SHOW_BOARD 0x0814
#define SMSG_BUYINGSTORE_HIDE_BOARD 0x0816
#define SMSG_BUYINGSTORE_ITEMS_LIST 0x0818
+#define SMSG_BUYINGSTORE_SELL_FAILED 0x081a
// Receiving a request to trade
#define SMSG_TRADE_REQUEST 0x01f4
diff --git a/src/resources/notifications.h b/src/resources/notifications.h
index 818f94512..60e2cefad 100644
--- a/src/resources/notifications.h
+++ b/src/resources/notifications.h
@@ -436,6 +436,18 @@ namespace NotifyManager
{"buying store create empty",
// TRANSLATORS: notification message
N_("Buying store create failed. No items in store."),
+ NotifyFlags::EMPTY},
+ {"buying store sell failed money limit",
+ // TRANSLATORS: notification message
+ N_("All items within the buy limit were purchased."),
+ NotifyFlags::EMPTY},
+ {"buying store sell failed empty",
+ // TRANSLATORS: notification message
+ N_("All items were purchased."),
+ NotifyFlags::EMPTY},
+ {"buying store sell failed",
+ // TRANSLATORS: notification message
+ N_("Buying item failed."),
NotifyFlags::EMPTY}
};
} // namespace NotifyManager
diff --git a/src/resources/notifytypes.h b/src/resources/notifytypes.h
index a9c881887..f8c2f737c 100644
--- a/src/resources/notifytypes.h
+++ b/src/resources/notifytypes.h
@@ -128,6 +128,9 @@ namespace NotifyTypes
BUYING_STORE_CREATE_FAILED,
BUYING_STORE_CREATE_FAILED_WEIGHT,
BUYING_STORE_CREATE_EMPTY,
+ BUYING_STORE_SELL_FAILED_MONEY_LIMIT,
+ BUYING_STORE_SELL_FAILED_EMPTY,
+ BUYING_STORE_SELL_FAILED,
TYPE_END
};