From 5a90f1abe051f5c1499699898fa782d874a4f2d2 Mon Sep 17 00:00:00 2001 From: Madpeter <57852827+Madpeterz@users.noreply.github.com> Date: Wed, 17 Jan 2024 13:19:25 +0000 Subject: [PATCH] Update InteractionService.cs --- .../Services/InteractionService.cs | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/SecondBotEvents/Services/InteractionService.cs b/SecondBotEvents/Services/InteractionService.cs index fcbb555..ad27c12 100644 --- a/SecondBotEvents/Services/InteractionService.cs +++ b/SecondBotEvents/Services/InteractionService.cs @@ -138,22 +138,29 @@ namespace SecondBotEvents.Services protected void BotInventoryOffer(object o, InventoryObjectOfferedEventArgs e) { - if(ProcessRequest(myConfig.GetAcceptInventory(),e.Offer.FromAgentName, "InventoryUpdate") == false) + if(ProcessRequest(myConfig.GetAcceptInventory(),e.Offer.FromAgentName, "InventoryOffer") == false) { return; } e.Accept = true; Dictionary details = new Dictionary { - { "itemuuid", e.ObjectID.ToString() }, - { "itemtype", e.AssetType.ToString() } + { "transactionid", e.Offer.IMSessionID.ToString() }, + { "itemtype", e.AssetType.ToString() }, + { "message", e.Offer.Message.ToString() }, + { "fromscript", e.FromTask.ToString() } }; - InventoryItem itm = GetClient().Inventory.FetchItem(e.ObjectID, GetClient().Self.AgentID, 2000); - if(itm != null) + if(e.FromTask == false) { - details.Add("itemname", itm.Name); + details.Add("itemuuid", e.ObjectID.ToString()); + details.Add("itemname", "?"); + InventoryItem itm = GetClient().Inventory.FetchItem(e.ObjectID, GetClient().Self.AgentID, 2000); + if(itm != null) + { + details["itemname"] = itm.Name; + } } - JsonOuput(true, "InventoryUpdate", e.Offer.FromAgentName, "see misc", details); + JsonOuput(true, "InventoryOffer", e.Offer.FromAgentName, "see misc", details); } protected void BotFriendRequested(object o, FriendshipOfferedEventArgs e)