mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-15 08:48:22 +00:00
Added checks for same item with price change. Client treats them all the same so all need to be updated. Also repaired max stacksize of 32767 on RoF2
This commit is contained in:
@@ -439,7 +439,7 @@ namespace RoF2
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
LogTradingDetail("Unhandled action <red>[{}]", sub_action);
|
||||
//LogTradingDetail("Unhandled action <red>[{}]", sub_action);
|
||||
dest->FastQueuePacket(&in);
|
||||
}
|
||||
}
|
||||
@@ -533,7 +533,7 @@ namespace RoF2
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
LogTrading("(RoF2) Unhandled action <red>[{}]", action);
|
||||
//LogTradingDetail("(RoF2) Unhandled action <red>[{}]", action);
|
||||
dest->FastQueuePacket(&in, ack_req);
|
||||
}
|
||||
}
|
||||
@@ -622,10 +622,10 @@ namespace RoF2
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
LogTrading(
|
||||
"(RoF2) Unhandled action <red>[{}]",
|
||||
in->action
|
||||
);
|
||||
// LogTradingDetail(
|
||||
// "(RoF2) Unhandled action <red>[{}]",
|
||||
// in->action
|
||||
// );
|
||||
dest->QueuePacket(inapp);
|
||||
}
|
||||
}
|
||||
@@ -4339,7 +4339,7 @@ namespace RoF2
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
LogTrading("(RoF2) Unhandled action <red>[{}]", action);
|
||||
// LogTradingDetail("(RoF2) Unhandled action <red>[{}]", action);
|
||||
EQApplicationPacket *in = *p;
|
||||
*p = nullptr;
|
||||
|
||||
@@ -6224,7 +6224,7 @@ namespace RoF2
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
LogTrading("(RoF2) Unhandled action <red>[{}]", action);
|
||||
//LogTradingDetail("(RoF2) Unhandled action <red>[{}]", action);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6357,7 +6357,7 @@ namespace RoF2
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
LogTrading("(RoF2) Unhandled action <red>[{}]", action);
|
||||
//LogTradingDetail("(RoF2) Unhandled action <red>[{}]", action);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -307,6 +307,7 @@ namespace RoF2
|
||||
const size_t SAY_LINK_BODY_SIZE = 56;
|
||||
const uint32 MAX_GUILD_ID = 50000;
|
||||
const uint32 MAX_BAZAAR_TRADERS = 600;
|
||||
const uint64 MAX_BAZAAR_TRANSACTION = 3276700000000; //3276700000000
|
||||
|
||||
} /*constants*/
|
||||
|
||||
|
||||
@@ -198,30 +198,40 @@ public:
|
||||
return UpdateOne(db, m);
|
||||
}
|
||||
|
||||
static int UpdatePrice(Database &db, const std::string &item_unique_id, uint32 price)
|
||||
static std::vector<Trader> UpdatePrice(Database &db, const std::string &item_unique_id, uint32 price)
|
||||
{
|
||||
const auto trader_item = GetWhere(
|
||||
db,
|
||||
fmt::format("`item_unique_id` = '{}' ", item_unique_id)
|
||||
std::vector<Trader> all_entries{};
|
||||
|
||||
const auto query = fmt::format(
|
||||
"UPDATE trader t1 SET t1.`item_cost` = '{}', t1.`listing_date` = FROM_UNIXTIME({}) WHERE t1.`item_id` = "
|
||||
"(SELECT t2.`item_id` FROM trader t2 WHERE t2.`item_unique_id` = '{}')",
|
||||
price,
|
||||
time(nullptr),
|
||||
item_unique_id
|
||||
);
|
||||
|
||||
if (trader_item.empty() || trader_item.size() > 1) {
|
||||
return 0;
|
||||
auto results = db.QueryDatabase(query);
|
||||
if (results.RowsAffected() == 0) {
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
auto m = trader_item[0];
|
||||
m.item_cost = price;
|
||||
m.listing_date = time(nullptr);
|
||||
all_entries = GetWhere(
|
||||
db,
|
||||
fmt::format(
|
||||
"`item_id` = (SELECT t1.`item_id` FROM trader t1 WHERE t1.`item_unique_id` = '{}');",
|
||||
item_unique_id
|
||||
)
|
||||
);
|
||||
|
||||
return ReplaceOne(db, m);
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static Trader GetItemBySerialNumber(Database &db, std::string &item_unique_id, uint32 trader_id)
|
||||
static Trader GetItemByItemUniqueNumber(Database &db, std::string &item_unique_id)
|
||||
{
|
||||
Trader e{};
|
||||
const auto trader_item = GetWhere(
|
||||
db,
|
||||
fmt::format("`character_id` = '{}' AND `item_unique_id` = '{}' LIMIT 1", trader_id, item_unique_id)
|
||||
fmt::format("`item_unique_id` = '{}' LIMIT 1", item_unique_id)
|
||||
);
|
||||
|
||||
if (trader_item.empty()) {
|
||||
|
||||
+1
-1
@@ -740,7 +740,7 @@ bool SharedDatabase::GetInventory(Client *c)
|
||||
inst->SetColor(color);
|
||||
}
|
||||
|
||||
if (charges == std::numeric_limits<int16>::max()) {
|
||||
if (charges > std::numeric_limits<int16>::max()) {
|
||||
inst->SetCharges(-1);
|
||||
} else if (charges == 0 && inst->IsStackable()) {
|
||||
// Stackable items need a minimum charge of 1 remain moveable.
|
||||
|
||||
Reference in New Issue
Block a user