Adds missing feature flags

This commit is contained in:
Kamron Batman 2026-07-26 09:35:07 -07:00
parent cb22c07cfb
commit d728dea1a2
No known key found for this signature in database
GPG key ID: 7D81DF26D9A5D94A
7 changed files with 27 additions and 21 deletions

View file

@ -10,4 +10,5 @@ public static class ServerFeatureFlags
public static bool PvPCombat { get; set; } = true;
public static bool BankAccess { get; set; } = true;
public static bool SpeedhackDetection { get; set; }
public static bool InsuranceEnabled { get; set; }
}

View file

@ -1884,7 +1884,7 @@ public partial class Item : IHued, IComparable<Item>, ISpawnable, IObjectPropert
{
list.Add(1049643); // cursed
}
else if (Insured)
else if (ServerFeatureFlags.InsuranceEnabled && Insured)
{
list.Add(1061682); // <b>insured</b>
}
@ -4215,11 +4215,13 @@ public partial class Item : IHued, IComparable<Item>, ISpawnable, IObjectPropert
Delete();
}
public virtual bool CheckBlessed(Mobile m) => m_LootType == LootType.Blessed || Insured || m != null && m == BlessedFor;
public virtual bool CheckBlessed(Mobile m) =>
m_LootType == LootType.Blessed || ServerFeatureFlags.InsuranceEnabled && Insured || m != null && m == BlessedFor;
public virtual bool CheckNewbied() => m_LootType == LootType.Newbied;
public virtual bool IsStandardLoot() => !Insured && BlessedFor == null && m_LootType == LootType.Regular;
public virtual bool IsStandardLoot() =>
(!ServerFeatureFlags.InsuranceEnabled || !Insured) && BlessedFor == null && m_LootType == LootType.Regular;
public override string ToString() => $"{Serial} \"{GetType().Name}\"";

View file

@ -962,20 +962,21 @@ public static class FeatureFlagManager
_ = key.ToLowerInvariant() switch
{
// Server project flags
"player_trading" => ServerFeatureFlags.PlayerTrading = enabled,
"pvp_combat" => ServerFeatureFlags.PvPCombat = enabled,
"bank_access" => ServerFeatureFlags.BankAccess = enabled,
"speedhack_detection" => ServerFeatureFlags.SpeedhackDetection = enabled,
"player_trading" => ServerFeatureFlags.PlayerTrading = enabled,
"pvp_combat" => ServerFeatureFlags.PvPCombat = enabled,
"bank_access" => ServerFeatureFlags.BankAccess = enabled,
"speedhack_detection" => ServerFeatureFlags.SpeedhackDetection = enabled,
"insurance" => ServerFeatureFlags.InsuranceEnabled = enabled,
// UOContent flags
"vendor_purchase" => ContentFeatureFlags.VendorPurchase = enabled,
"vendor_sell" => ContentFeatureFlags.VendorSell = enabled,
"player_vendors" => ContentFeatureFlags.PlayerVendors = enabled,
"house_placement" => ContentFeatureFlags.HousePlacement = enabled,
"boat_placement" => ContentFeatureFlags.BoatPlacement = enabled,
"bulk_orders" => ContentFeatureFlags.BulkOrders = enabled,
"passive_detect_hidden" => ContentFeatureFlags.PassiveDetectHidden = enabled,
"young_player_system" => ContentFeatureFlags.YoungPlayerSystem = enabled,
"vendor_purchase" => ContentFeatureFlags.VendorPurchase = enabled,
"vendor_sell" => ContentFeatureFlags.VendorSell = enabled,
"player_vendors" => ContentFeatureFlags.PlayerVendors = enabled,
"house_placement" => ContentFeatureFlags.HousePlacement = enabled,
"boat_placement" => ContentFeatureFlags.BoatPlacement = enabled,
"bulk_orders" => ContentFeatureFlags.BulkOrders = enabled,
"passive_detect_hidden" => ContentFeatureFlags.PassiveDetectHidden = enabled,
"young_player_system" => ContentFeatureFlags.YoungPlayerSystem = enabled,
"bitmap_pathfinding_cache" => ContentFeatureFlags.BitmapPathfindingCache = enabled,
};
}

View file

@ -10,12 +10,12 @@ namespace Server.Engines.Insurance;
public static class Insurance
{
public static bool Enabled { get; private set; }
public static bool Enabled => ServerFeatureFlags.InsuranceEnabled;
private static Dictionary<Mobile, InsuranceContext> _insuranceContexts;
public static void Configure()
{
Enabled = ServerConfiguration.GetSetting("insurance.enable", Core.AOS);
ServerFeatureFlags.InsuranceEnabled = ServerConfiguration.GetSetting("insurance.enable", Core.AOS);
if (Enabled)
{
@ -72,7 +72,7 @@ public static class Insurance
public static bool CheckItemInsuranceOnDeath(PlayerMobile from, Item item)
{
if (!item.Insured)
if (!Enabled || !item.Insured)
{
return false;
}

View file

@ -26,7 +26,7 @@ public class ClothingBlessTarget : Target // Create our targeting class (which w
}
// Check if its already newbied (blessed)
if (item.LootType == LootType.Blessed || item.BlessedFor == from || item.Insured)
if (item.LootType == LootType.Blessed || item.BlessedFor == from || Insurance.Enabled && item.Insured)
{
from.SendLocalizedMessage(1045113); // That item is already blessed
}

View file

@ -1,4 +1,5 @@
using Server.Collections;
using Server.Engines.Insurance;
using Server.Items;
namespace Server.Mobiles;
@ -23,7 +24,7 @@ public class DestroyEquipment : MonsterAbilitySingleTarget
continue;
}
if (item.Insured)
if (Insurance.Enabled && item.Insured)
{
continue;
}

View file

@ -2397,7 +2397,8 @@ namespace Server.Mobiles
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private bool FindItems_Callback(Item item) =>
!item.Deleted && (item.LootType == LootType.Blessed || item.Insured) && Backpack != item.Parent;
!item.Deleted && Backpack != item.Parent &&
(item.LootType == LootType.Blessed || ServerFeatureFlags.InsuranceEnabled && item.Insured);
public override bool OnBeforeDeath()
{