From d74b2bc090d7e97d47714d5e82c764b86fb34a2a Mon Sep 17 00:00:00 2001 From: Madpeter <57852827+Madpeterz@users.noreply.github.com> Date: Sat, 6 Sep 2025 22:10:09 +0100 Subject: [PATCH] clean up command --- SecondBotEvents/Commands/Estate.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/SecondBotEvents/Commands/Estate.cs b/SecondBotEvents/Commands/Estate.cs index 126dc1c..3b09019 100644 --- a/SecondBotEvents/Commands/Estate.cs +++ b/SecondBotEvents/Commands/Estate.cs @@ -35,6 +35,11 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Unable to process allow voice chat value please use true or false")] [ReturnHintsFailure("Unable to process override public access value please use true or false")] [ReturnHintsFailure("Unable to process override environment value please use true or false")] + [ReturnHintsFailure("Timed out waiting for EstateInfoReply")] + [ReturnHintsFailure("No estate info reply received")] + [ReturnHintsFailure("Unable to get URI for EstateChangeInfo")] + [ReturnHintsFailure("HTTP error ")] + [ReturnHintsFailure("EstateChangeInfo error ")] [ArgHints("sun_hour", "the hour of the day the sun should be at, 0 to 23", "Number", "12.0")] [ArgHints("is_sun_fixed", "true to fix the sun at the specified hour, false to have it move normally", "BOOL", "false")] [ArgHints("is_externally_visible", "true to make the region visible on the map, false to hide it", "BOOL", "true")] @@ -155,13 +160,13 @@ namespace SecondBotEvents.Commands if (reply.IsSuccessStatusCode) { - return new KeyValuePair(true, "ok"); + return BasicReply("ok", [sun_hour, is_sun_fixed, is_externally_visible, allow_direct_teleport, deny_anonymous, deny_age_unverified, block_bots, allow_voice_chat, override_public_access, override_environment]); } - return new KeyValuePair(false, $"HTTP {reply.StatusCode}: {responseContent}"); + return Failure( $"HTTP error {reply.StatusCode.ToString()} {responseContent}", [sun_hour, is_sun_fixed, is_externally_visible, allow_direct_teleport, deny_anonymous, deny_age_unverified, block_bots, allow_voice_chat, override_public_access, override_environment]); } catch (Exception e) { - return new KeyValuePair(false, e.Message); + return Failure("EstateChangeInfo error "+ e.Message, [sun_hour, is_sun_fixed, is_externally_visible, allow_direct_teleport, deny_anonymous, deny_age_unverified, block_bots, allow_voice_chat, override_public_access, override_environment]); } }