using System; using System.Collections.Generic; using Server.Multis; namespace Server.Custom { /// /// Forces a house-decay transition so the decay sweep's transition detection can be /// observed without waiting out a real 12–24 h IDOC stage. /// /// After the bridge takes its silent baseline on ServerStarted, this bumps one condemned /// seeded house one stage further with SetDynamicDecay. The next decay sweep should see the /// level change and emit exactly one house.decay. /// /// Test scaffolding. Never deployed. Only meaningful against the seeded world. /// public static class BridgeSweepProbe { public static void Initialize() { if (Config.Get("Bridge.SweepProbeOnStart", false)) EventSink.ServerStarted += () => Timer.DelayCall(TimeSpan.FromSeconds(6.0), Run); } private static void Run() { try { BaseHouse target = null; DecayLevel current = DecayLevel.Ageless; // Find a house already decaying (not Ageless/LikeNew), so a bump is a real move. foreach (var h in BaseHouse.AllHouses) { if (h == null || h.Deleted) continue; var lvl = h.DecayLevel; if (lvl == DecayLevel.Greatly || lvl == DecayLevel.Fairly || lvl == DecayLevel.Somewhat) { target = h; current = lvl; break; } } if (target == null) { Console.WriteLine("[SweepProbe] no decaying house found to bump"); return; } var next = current + 1; // e.g. Somewhat -> Fairly -> Greatly -> IDOC Console.WriteLine("[SweepProbe] bumping house 0x{0:X} from {1} to {2}", target.Serial.Value, current, next); target.SetDynamicDecay(next); Console.WriteLine("[SweepProbe] done; the next decay sweep should emit house.decay"); } catch (Exception ex) { Console.WriteLine("[SweepProbe] FAILED: " + ex); } } } }