This commit is contained in:
gretchen
2023-12-26 13:38:47 +01:00
parent f495af7a8f
commit fb5b9164e7
+10 -4
View File
@@ -64,13 +64,19 @@ function M.process_auction(auction_record)
write_record(auction_record.item_key, item_record)
--AuxAddon:SendCommMessage("GROUP", auction_record); --for testing purposes, not really useful in real world I think
AuxAddon:SendCommMessage("GUILD", auction_record);
--print("sent data"); for testing
--print("sent/wrote data"); --for testing (print comes from PFUI)
end
end
function AuxAddon:OnCommReceive(prefix, sender, distribution, auction_info)
--print("received data"); for testing
M.process_auction(auction_info);
function AuxAddon:OnCommReceive(prefix, sender, distribution, auction_record) --copied code from process_auction rather than calling it here to avoid resending the data also lazyness
--print("received data"); --for testing (print comes from PFUI)
local item_record = read_record(auction_record.item_key)
local unit_buyout_price = ceil(auction_record.buyout_price / auction_record.aux_quantity)
if unit_buyout_price > 0 and unit_buyout_price < (item_record.daily_min_buyout or aux.huge) then
item_record.daily_min_buyout = unit_buyout_price
write_record(auction_record.item_key, item_record)
--print("wrote data"); --for testing (print comes from PFUI)
end
end
function M.data_points(item_key)