From 81b049cdcdc4a24288677896989f4ff0d35b7ed9 Mon Sep 17 00:00:00 2001 From: Salja Date: Sun, 25 Jan 2015 23:22:45 +0100 Subject: [PATCH] use auctionHouseEntry for all auctions hooks add buyout, etime to AUCTION_EVENT_ON_ADD Signed-off-by: Salja --- Hooks.h | 8 ++++---- LuaEngine.h | 8 ++++---- LuaFunctions.cpp | 6 +++--- ServerHooks.cpp | 18 ++++++++++-------- 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/Hooks.h b/Hooks.h index 5319f4c..40af516 100644 --- a/Hooks.h +++ b/Hooks.h @@ -136,10 +136,10 @@ namespace Hooks WEATHER_EVENT_ON_CHANGE = 25, // (event, zoneId, state, grade) // Auction house - AUCTION_EVENT_ON_ADD = 26, // (event, AHObject, player, item) - AUCTION_EVENT_ON_REMOVE = 27, // (event, AHObject, player, item) - AUCTION_EVENT_ON_SUCCESSFUL = 28, // (event, AHObject) // Not Implemented - AUCTION_EVENT_ON_EXPIRE = 29, // (event, AHObject) // Not Implemented + AUCTION_EVENT_ON_ADD = 26, // (event, auctionHouseEntry, player, item, buyout, etime) + AUCTION_EVENT_ON_REMOVE = 27, // (event, auctionHouseEntry, player, item) + AUCTION_EVENT_ON_SUCCESSFUL = 28, // (event, auctionHouseEntry) // Not Implemented + AUCTION_EVENT_ON_EXPIRE = 29, // (event, auctionHouseEntry) // Not Implemented // AddOns ADDON_EVENT_ON_MESSAGE = 30, // (event, sender, type, prefix, msg, target) - target can be nil/whisper_target/guild/group/channel. Can return false diff --git a/LuaEngine.h b/LuaEngine.h index 63df6c3..4285b9b 100644 --- a/LuaEngine.h +++ b/LuaEngine.h @@ -442,10 +442,10 @@ public: void OnChange(Weather* weather, uint32 zone, WeatherState state, float grade); /* Auction House */ - void OnAdd(AuctionHouseObject* auctionHouse, Player* pPlayer, Item* pItem); - void OnRemove(AuctionHouseObject* auctionHouse, Player* pPlayer, Item* pItem); - void OnSuccessful(AuctionHouseObject* auctionHouse); - void OnExpire(AuctionHouseObject* auctionHouse); + void OnAdd(AuctionHouseEntry const* auctionHouseEntry, Player* pPlayer, Item* pItem, uint32 buyout, uint32 etime); + void OnRemove(AuctionHouseEntry const* auctionHouseEntry, Player* pPlayer, Item* pItem); + void OnSuccessful(AuctionHouseEntry const* auctionHouseEntry); + void OnExpire(AuctionHouseEntry const* auctionHouseEntry); /* Guild */ void OnAddMember(Guild* guild, Player* player, uint32 plRank); diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index afc807f..791e013 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -1218,7 +1218,7 @@ ElunaRegister CorpseMethods[] = { NULL, NULL } }; -ElunaRegister AuctionMethods[] = +ElunaRegister AuctionMethods[] = { { NULL, NULL } }; @@ -1380,8 +1380,8 @@ void RegisterFunctions(Eluna* E) ElunaTemplate::Register(E, "Map"); ElunaTemplate::SetMethods(E, MapMethods); - ElunaTemplate::Register(E, "AuctionHouseObject"); - ElunaTemplate::SetMethods(E, AuctionMethods); + ElunaTemplate::Register(E, "AuctionHouseEntry"); + ElunaTemplate::SetMethods(E, AuctionMethods); ElunaTemplate::Register(E, "BattleGround"); ElunaTemplate::SetMethods(E, BattleGroundMethods); diff --git a/ServerHooks.cpp b/ServerHooks.cpp index 12ec26a..a693521 100644 --- a/ServerHooks.cpp +++ b/ServerHooks.cpp @@ -82,47 +82,49 @@ void Eluna::OnChange(Weather* weather, uint32 zone, WeatherState state, float gr } // Auction House -void Eluna::OnAdd(AuctionHouseObject* ah, Player* pPlayer, Item* pItem) +void Eluna::OnAdd(AuctionHouseEntry const* auctionHouseEntry, Player* pPlayer, Item* pItem, uint32 buyout, uint32 etime) { if (!ServerEventBindings->HasEvents(AUCTION_EVENT_ON_ADD)) return; LOCK_ELUNA; - Push(ah); + Push(auctionHouseEntry); Push(pPlayer); Push(pItem); + Push(buyout); + Push(etime); CallAllFunctions(ServerEventBindings, AUCTION_EVENT_ON_ADD); } -void Eluna::OnRemove(AuctionHouseObject* ah, Player* pPlayer, Item* pItem) +void Eluna::OnRemove(AuctionHouseEntry const* auctionHouseEntry, Player* pPlayer, Item* pItem) { if (!ServerEventBindings->HasEvents(AUCTION_EVENT_ON_REMOVE)) return; LOCK_ELUNA; - Push(ah); + Push(auctionHouseEntry); Push(pPlayer); Push(pItem); CallAllFunctions(ServerEventBindings, AUCTION_EVENT_ON_REMOVE); } -void Eluna::OnSuccessful(AuctionHouseObject* ah) +void Eluna::OnSuccessful(AuctionHouseEntry const* auctionHouseEntry) { if (!ServerEventBindings->HasEvents(AUCTION_EVENT_ON_SUCCESSFUL)) return; LOCK_ELUNA; - Push(ah); + Push(auctionHouseEntry); CallAllFunctions(ServerEventBindings, AUCTION_EVENT_ON_SUCCESSFUL); } -void Eluna::OnExpire(AuctionHouseObject* ah) +void Eluna::OnExpire(AuctionHouseEntry const* auctionHouseEntry) { if (!ServerEventBindings->HasEvents(AUCTION_EVENT_ON_EXPIRE)) return; LOCK_ELUNA; - Push(ah); + Push(auctionHouseEntry); CallAllFunctions(ServerEventBindings, AUCTION_EVENT_ON_EXPIRE); }