From c99e9a263bd90f356b38fddfccf68e5fe2441bc1 Mon Sep 17 00:00:00 2001 From: Madpeter <57852827+Madpeterz@users.noreply.github.com> Date: Fri, 24 Dec 2021 08:02:13 +0000 Subject: [PATCH] add GetParcelTraffic command --- Core/Commands/Parcel.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Core/Commands/Parcel.cs b/Core/Commands/Parcel.cs index 66c26a7..ac9a2af 100644 --- a/Core/Commands/Parcel.cs +++ b/Core/Commands/Parcel.cs @@ -51,6 +51,21 @@ namespace BetterSecondBot.HttpService return Failure("ok", "SetParcelSale", new [] { amount, avatar }); } + [About("Gets the parcel Dwell (Traffic) value and returns it via the reply target")] + [ReturnHints("traffic value")] + [ReturnHintsFailure("Error not in a sim")] + [ReturnHintsFailure("Parcel data not ready")] + [Route(HttpVerbs.Get, "/GetParcelTraffic/{token}")] + public object GetParcelTraffic(string token) + { + KeyValuePair tests = SetupCurrentParcel(token, "parcel", "GetParcelTraffic"); + if (tests.Key == false) + { + return Failure(tests.Value, "GetParcelTraffic"); + } + return BasicReply(targetparcel.Dwell.ToString(), "GetParcelTraffic"); + } + [About("Changes the parcel landing mode to point and sets the landing point")] [ReturnHints("ok")] [ReturnHintsFailure("Error not in a sim")]