From 6bd37c55d8e3ebb8825db1c900d65d60bf49dd2b Mon Sep 17 00:00:00 2001 From: Madpeter <57852827+Madpeterz@users.noreply.github.com> Date: Sat, 6 Sep 2025 23:27:32 +0100 Subject: [PATCH] adds non capps fallback --- SecondBotEvents/Commands/Estate.cs | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/SecondBotEvents/Commands/Estate.cs b/SecondBotEvents/Commands/Estate.cs index 3b09019..4b5aa05 100644 --- a/SecondBotEvents/Commands/Estate.cs +++ b/SecondBotEvents/Commands/Estate.cs @@ -104,12 +104,6 @@ namespace SecondBotEvents.Commands return Failure("Unable to process override environment value please use true or false", [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]); } - Uri uri = GetClient().Network.CurrentSim.Caps.CapabilityURI("EstateChangeInfo"); - if (uri == null) - { - return new KeyValuePair(false, "Unable to get URI for EstateChangeInfo"); - } - // Block inline and wait for the estate info reply to get the estate name string estatename = null; using (var waitHandle = new System.Threading.ManualResetEventSlim(false)) @@ -137,6 +131,28 @@ namespace SecondBotEvents.Commands { return Failure("No estate info reply received"); } + Uri uri = GetClient().Network.CurrentSim.Caps.CapabilityURI("EstateChangeInfo"); + if (uri == null) + { + // try data server fallback + List config = new List(); + config.Add(estatename); + Int64 bitmask = 0; + if (issunfixed) bitmask |= 1 << 4; + if (isexternallyvisible) bitmask |= 1 << 15; + if (allowdirectteleport) bitmask |= 1 << 20; + if (denyanonymous) bitmask |= 1 << 23; + if (denyageunverified) bitmask |= 1 << 30; + if (blockbots) bitmask |= 1 << 31; + if (allowvoicechat) bitmask |= 1 << 28; + if (overridepublicaccess) bitmask |= 1 << 5; + if (overrideenvironment) bitmask |= 1 << 9; + config.Add(bitmask.ToString()); + config.Add((sunhourvalue * 1024.0f).ToString()); + GetClient().Estate.EstateOwnerMessage("estatechangeinfo", config); + + return BasicReply("ok using fallback", [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]); + } OSDMap body = new OSDMap(); body["estate_name"] = estatename;