fix: Adds command help, webpage, and fixes issues with other commands (#1669)
### Summary - Fixes `[AdvancedSearch` being accessible by players 😱 - Adds `[GenCommands` to generate the same commands html page on https://muo.gg/commands. - Fixes `[helpinfo` so all commands properly show up! > [!WARNING] > ### Developer Warning: > Commands must now be registered in the `Configure` bootup phase. > If a command is not registered early enough, it may not be available to systems like [helpinfo > that cache their information. > [!NOTE] > ### Developer Note: > Various commands related to generating content have been changed to _Developer_ and above access level. ### Screenshots <img width="673" alt="image" src="https://github.com/modernuo/ModernUO/assets/3953314/b105b5c9-5eb4-4ace-93ff-1bfb31e7132f"> <img width="547" alt="image" src="https://github.com/modernuo/ModernUO/assets/3953314/e97487e8-47a5-4aa7-89cc-9fe3deda584d">
This commit is contained in:
parent
3244704ea2
commit
fffda53263
88 changed files with 1163 additions and 557 deletions
|
|
@ -2,16 +2,14 @@ namespace Server.Engines.AdvancedSearch;
|
|||
|
||||
public static class AdvancedSearchCommand
|
||||
{
|
||||
public static void Initialize()
|
||||
public static void Configure()
|
||||
{
|
||||
CommandSystem.Register("XmlFind", AccessLevel.Player, OnCommand); // For those old school peeps!
|
||||
CommandSystem.Register("AdvancedSearch", AccessLevel.Player, OnCommand);
|
||||
CommandSystem.Register("AdvSrch", AccessLevel.Player, OnCommand);
|
||||
CommandSystem.Register("AS", AccessLevel.Player, OnCommand);
|
||||
CommandSystem.Register("AdvancedSearch", AccessLevel.Administrator, OnCommand); // For those old school peeps!
|
||||
}
|
||||
|
||||
[Usage("AdvancedSearch")]
|
||||
[Description("Opens the advanced search gump.")]
|
||||
[Aliases("AdvSrch", "AS", "XmlFind")]
|
||||
private static void OnCommand(CommandEventArgs e)
|
||||
{
|
||||
var from = e.Mobile;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace Server.Engines.CannedEvil
|
|||
{
|
||||
public static class ChampionCommands
|
||||
{
|
||||
public static void Initialize()
|
||||
public static void Configure()
|
||||
{
|
||||
CommandSystem.Register("ClearChampByTarget", AccessLevel.Administrator, KillByTarget_OnCommand);
|
||||
CommandSystem.Register("ClearChampByRegion", AccessLevel.Administrator, KillByRegion_OnCommand);
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@ namespace Server.Engines.CannedEvil
|
|||
{
|
||||
private static readonly ILogger logger = LogFactory.GetLogger(typeof(ChampionGenerator));
|
||||
|
||||
public static void Initialize()
|
||||
public static void Configure()
|
||||
{
|
||||
CommandSystem.Register("GenChamps", AccessLevel.Owner, ChampGen_OnCommand);
|
||||
CommandSystem.Register("GenChamps", AccessLevel.Developer, ChampGen_OnCommand);
|
||||
}
|
||||
|
||||
private static readonly ChampionEntry[] LLLocations = {
|
||||
|
|
|
|||
|
|
@ -1231,7 +1231,7 @@ namespace Server.Engines.ConPVP
|
|||
Timer.StartTimer(TimeSpan.FromSeconds(10.0), Unregister);
|
||||
}
|
||||
|
||||
public static void Initialize()
|
||||
public static void Configure()
|
||||
{
|
||||
EventSink.Speech += EventSink_Speech;
|
||||
EventSink.Login += EventSink_Login;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public class Recipe
|
|||
|
||||
public TextDefinition TextDefinition => _td ??= TextDefinition.Of(CraftItem.NameNumber, CraftItem.NameString);
|
||||
|
||||
public static void Initialize()
|
||||
public static void Configure()
|
||||
{
|
||||
CommandSystem.Register("LearnAllRecipes", AccessLevel.GameMaster, LearnAllRecipes_OnCommand);
|
||||
CommandSystem.Register("ForgetAllRecipes", AccessLevel.GameMaster, ForgetAllRecipes_OnCommand);
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@ namespace Server.Engines.Doom
|
|||
{
|
||||
public static class GenGauntlet
|
||||
{
|
||||
public static void Initialize()
|
||||
public static void Configure()
|
||||
{
|
||||
CommandSystem.Register("GenGauntlet", AccessLevel.Administrator, GenGauntlet_OnCommand);
|
||||
CommandSystem.Register("RemGauntlet", AccessLevel.Administrator, RemoveGauntlet);
|
||||
CommandSystem.Register("GenGauntlet", AccessLevel.Developer, GenGauntlet_OnCommand);
|
||||
CommandSystem.Register("RemGauntlet", AccessLevel.Developer, RemoveGauntlet);
|
||||
}
|
||||
|
||||
public static void RemoveGauntlet(CommandEventArgs e)
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ public partial class LeverPuzzleController : Item
|
|||
}
|
||||
}
|
||||
|
||||
public static void Initialize()
|
||||
public static void Configure()
|
||||
{
|
||||
CommandSystem.Register("GenLeverPuzzle", AccessLevel.Administrator, GenLampPuzzle_OnCommand);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -639,14 +639,11 @@ namespace Server.Factions
|
|||
return true;
|
||||
}
|
||||
|
||||
public static void Initialize()
|
||||
public static void Configure()
|
||||
{
|
||||
EventSink.Login += EventSink_Login;
|
||||
EventSink.Logout += EventSink_Logout;
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromMinutes(1.0), TimeSpan.FromMinutes(10.0), HandleAtrophy);
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(30.0), TimeSpan.FromSeconds(30.0), ProcessTick);
|
||||
|
||||
CommandSystem.Register("FactionElection", AccessLevel.GameMaster, FactionElection_OnCommand);
|
||||
CommandSystem.Register("FactionCommander", AccessLevel.Administrator, FactionCommander_OnCommand);
|
||||
CommandSystem.Register("FactionItemReset", AccessLevel.Administrator, FactionItemReset_OnCommand);
|
||||
|
|
@ -654,6 +651,12 @@ namespace Server.Factions
|
|||
CommandSystem.Register("FactionTownReset", AccessLevel.Administrator, FactionTownReset_OnCommand);
|
||||
}
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
Timer.DelayCall(TimeSpan.FromMinutes(1.0), TimeSpan.FromMinutes(10.0), HandleAtrophy);
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(30.0), TimeSpan.FromSeconds(30.0), ProcessTick);
|
||||
}
|
||||
|
||||
public static void FactionTownReset_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
var monoliths = BaseMonolith.Monoliths;
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ namespace Server.Factions
|
|||
{
|
||||
public static class Generator
|
||||
{
|
||||
public static void Initialize()
|
||||
public static void Configure()
|
||||
{
|
||||
CommandSystem.Register("GenerateFactions", AccessLevel.Administrator, GenerateFactions_OnCommand);
|
||||
CommandSystem.Register("GenerateFactions", AccessLevel.Developer, GenerateFactions_OnCommand);
|
||||
}
|
||||
|
||||
public static void GenerateFactions_OnCommand(CommandEventArgs e)
|
||||
|
|
|
|||
|
|
@ -420,6 +420,11 @@ namespace Server.Factions
|
|||
return true;
|
||||
}
|
||||
|
||||
public static void Configure()
|
||||
{
|
||||
CommandSystem.Register("GrantTownSilver", AccessLevel.Administrator, GrantTownSilver_OnCommand);
|
||||
}
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
var towns = Towns;
|
||||
|
|
@ -429,8 +434,6 @@ namespace Server.Factions
|
|||
towns[i].Sheriff = towns[i].Sheriff;
|
||||
towns[i].Finance = towns[i].Finance;
|
||||
}
|
||||
|
||||
CommandSystem.Register("GrantTownSilver", AccessLevel.Administrator, GrantTownSilver_OnCommand);
|
||||
}
|
||||
|
||||
public bool IsSheriff(Mobile mob) =>
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ namespace Server.Engines.Help
|
|||
|
||||
public static List<PageEntry> List { get; } = new();
|
||||
|
||||
public static void Initialize()
|
||||
public static void Configure()
|
||||
{
|
||||
CommandSystem.Register("Pages", AccessLevel.Counselor, Pages_OnCommand);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ namespace Server.Engines.Help
|
|||
|
||||
IEnumerator IEnumerable.GetEnumerator() => m_Queue.GetEnumerator();
|
||||
|
||||
public static void Initialize()
|
||||
public static void Configure()
|
||||
{
|
||||
CommandSystem.Register("SpeechLog", AccessLevel.Counselor, SpeechLog_OnCommand);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ namespace Server.Commands
|
|||
{
|
||||
private static int m_Count;
|
||||
|
||||
public static void Initialize()
|
||||
public static void Configure()
|
||||
{
|
||||
CommandSystem.Register("GenKhaldun", AccessLevel.Administrator, GenKhaldun_OnCommand);
|
||||
CommandSystem.Register("GenKhaldun", AccessLevel.Developer, GenKhaldun_OnCommand);
|
||||
}
|
||||
|
||||
public static bool FindMorphItem(int x, int y, int z, int inactiveItemID, int activeItemID)
|
||||
|
|
|
|||
|
|
@ -144,6 +144,16 @@ namespace Server.Engines.MLQuests
|
|||
public static void Configure()
|
||||
{
|
||||
Enabled = ServerConfiguration.GetOrUpdateSetting("questSystem.enableMLQuests", Core.ML);
|
||||
|
||||
CommandSystem.Register("MLQuestsInfo", AccessLevel.Administrator, MLQuestsInfo_OnCommand);
|
||||
CommandSystem.Register("SaveQuest", AccessLevel.Administrator, SaveQuest_OnCommand);
|
||||
CommandSystem.Register("SaveAllQuests", AccessLevel.Administrator, SaveAllQuests_OnCommand);
|
||||
CommandSystem.Register("InvalidQuestItems", AccessLevel.Administrator, InvalidQuestItems_OnCommand);
|
||||
|
||||
TargetCommands.Register(new ViewQuestsCommand());
|
||||
TargetCommands.Register(new ViewContextCommand());
|
||||
|
||||
EventSink.QuestGumpRequest += EventSink_QuestGumpRequest;
|
||||
}
|
||||
|
||||
public static void Initialize()
|
||||
|
|
@ -165,16 +175,6 @@ namespace Server.Engines.MLQuests
|
|||
}
|
||||
|
||||
MLQuestPersistence.EnsureExistence();
|
||||
|
||||
CommandSystem.Register("MLQuestsInfo", AccessLevel.Administrator, MLQuestsInfo_OnCommand);
|
||||
CommandSystem.Register("SaveQuest", AccessLevel.Administrator, SaveQuest_OnCommand);
|
||||
CommandSystem.Register("SaveAllQuests", AccessLevel.Administrator, SaveAllQuests_OnCommand);
|
||||
CommandSystem.Register("InvalidQuestItems", AccessLevel.Administrator, InvalidQuestItems_OnCommand);
|
||||
|
||||
TargetCommands.Register(new ViewQuestsCommand());
|
||||
TargetCommands.Register(new ViewContextCommand());
|
||||
|
||||
EventSink.QuestGumpRequest += EventSink_QuestGumpRequest;
|
||||
}
|
||||
|
||||
[Usage("MLQuestsInfo"),
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ namespace Server.Engines.PartySystem
|
|||
}
|
||||
}
|
||||
|
||||
public static void Initialize()
|
||||
public static void Configure()
|
||||
{
|
||||
EventSink.Logout += EventSink_Logout;
|
||||
EventSink.Login += EventSink_Login;
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ namespace Server
|
|||
|
||||
public static PathAlgorithm OverrideAlgorithm { get; set; }
|
||||
|
||||
public static void Initialize()
|
||||
public static void Configure()
|
||||
{
|
||||
CommandSystem.Register("Path", AccessLevel.GameMaster, Path_OnCommand);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@ using Server.Items;
|
|||
using Server.Json;
|
||||
using Server.Mobiles;
|
||||
using Server.Utilities;
|
||||
using CPA = Server.CommandPropertyAttribute;
|
||||
|
||||
using static Server.Attributes;
|
||||
|
||||
namespace Server.Engines.Spawners;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ namespace Server.Engines.Spawners
|
|||
{
|
||||
private static readonly ILogger logger = LogFactory.GetLogger(typeof(ConvertPremiumSpawners));
|
||||
|
||||
public static void Initialize()
|
||||
public static void Configure()
|
||||
{
|
||||
CommandSystem.Register("ConvertPremiumSpawners", AccessLevel.Developer, ConvertPremiumSpawners_OnCommand);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ namespace Server.Engines.Spawners
|
|||
|
||||
public class EditSpawnCommand : BaseCommand
|
||||
{
|
||||
public static void Initialize()
|
||||
public static void Configure()
|
||||
{
|
||||
TargetCommands.Register(new EditSpawnCommand());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ namespace Server.Engines.Spawners;
|
|||
|
||||
public class ExportSpawnersCommand : BaseCommand
|
||||
{
|
||||
public static void Initialize()
|
||||
public static void Configure()
|
||||
{
|
||||
TargetCommands.Register(new ExportSpawnersCommand());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ namespace Server.Engines.Spawners
|
|||
{
|
||||
private static readonly ILogger logger = LogFactory.GetLogger(typeof(GenerateSpawnersCommand));
|
||||
|
||||
public static void Initialize()
|
||||
public static void Configure()
|
||||
{
|
||||
CommandSystem.Register("GenerateSpawners", AccessLevel.Developer, GenerateSpawners_OnCommand);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ namespace Server.Engines.Spawners
|
|||
{
|
||||
public class RespawnCommand : BaseCommand
|
||||
{
|
||||
public static void Initialize()
|
||||
public static void Configure()
|
||||
{
|
||||
TargetCommands.Register(new RespawnCommand());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ namespace Server.Engines.Spawners
|
|||
{
|
||||
public class SpawnPropsCommand : BaseCommand
|
||||
{
|
||||
public static void Initialize()
|
||||
public static void Configure()
|
||||
{
|
||||
TargetCommands.Register(new SpawnPropsCommand());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ using Server.Engines.Spawners;
|
|||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.Text;
|
||||
using CPA = Server.CommandPropertyAttribute;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public class SpawnerControllerGump : GumpGrid
|
|||
|
||||
public static int GetButtonID(int type, int index) => 1 + type + index * TypeCount;
|
||||
|
||||
public static void Initialize()
|
||||
public static void Configure()
|
||||
{
|
||||
CommandSystem.Register("Spawn", AccessLevel.GameMaster, OpenSpawnGump_OnCommand);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,9 @@ public class StealableArtifacts : GenericPersistence
|
|||
public static void Configure()
|
||||
{
|
||||
_stealableArtifactsPersistence = new StealableArtifacts();
|
||||
|
||||
CommandSystem.Register("GenStealArties", AccessLevel.Developer, GenStealArties_OnCommand);
|
||||
CommandSystem.Register("RemoveStealArties", AccessLevel.Developer, RemoveStealArties_OnCommand);
|
||||
}
|
||||
|
||||
public StealableArtifacts() : base("StealableArtifacts", 10)
|
||||
|
|
@ -192,12 +195,6 @@ public class StealableArtifacts : GenericPersistence
|
|||
private static int GetLampPostHue() =>
|
||||
Utility.RandomDouble() < 0.9 ? 0 : Utility.RandomList(0x455, 0x47E, 0x482, 0x486, 0x48F, 0x4F2, 0x58C, 0x66C);
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register("GenStealArties", AccessLevel.Administrator, GenStealArties_OnCommand);
|
||||
CommandSystem.Register("RemoveStealArties", AccessLevel.Administrator, RemoveStealArties_OnCommand);
|
||||
}
|
||||
|
||||
[Usage("GenStealArties"), Description("Generates the stealable artifacts spawner.")]
|
||||
private static void GenStealArties_OnCommand(CommandEventArgs args)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue