diff --git a/Source/ACE.Server/Command/CommandManager.cs b/Source/ACE.Server/Command/CommandManager.cs index e2340aeef7..0436cfda52 100644 --- a/Source/ACE.Server/Command/CommandManager.cs +++ b/Source/ACE.Server/Command/CommandManager.cs @@ -28,7 +28,7 @@ public static IEnumerable GetCommands() public static IEnumerable GetCommandByName(string commandname) { - return commandHandlers.Select(p => p.Value).Where(p => p.Attribute.Command == commandname); + return commandHandlers.Select(p => p.Value).Where(p => p.Attribute.Command.Equals(commandname, StringComparison.OrdinalIgnoreCase)); } public static CommandHandler GetDelegate(Action handler) => (CommandHandler)Delegate.CreateDelegate(typeof(CommandHandler), handler.Method); @@ -139,6 +139,13 @@ private static void CommandThread() Console.Write("ACE >> "); string commandLine = Console.ReadLine(); + + if (commandLine == null) + { + log.Info("ACEmulator command prompt disabled - console input stream was closed"); + return; + } + if (string.IsNullOrWhiteSpace(commandLine)) continue; diff --git a/Source/ACE.Server/Command/Handlers/AdvocateCommands.cs b/Source/ACE.Server/Command/Handlers/AdvocateCommands.cs index 3b166c9923..9013f75bc5 100644 --- a/Source/ACE.Server/Command/Handlers/AdvocateCommands.cs +++ b/Source/ACE.Server/Command/Handlers/AdvocateCommands.cs @@ -134,9 +134,9 @@ public static void HandleRemove(Session session, params string[] parameters) return; } - if (session.Player.AdvocateLevel < player.AdvocateLevel) + if (session.Player.AdvocateLevel <= player.AdvocateLevel) { - session.Network.EnqueueSend(new GameMessageSystemChat($"You cannot remove {playerToFind.Name}'s Advocate status because they out rank you.", ChatMessageType.Broadcast)); + session.Network.EnqueueSend(new GameMessageSystemChat($"You cannot remove {playerToFind.Name}'s Advocate status because they are equal to or out rank you.", ChatMessageType.Broadcast)); return; } diff --git a/Source/ACE.Server/Command/Handlers/HelpCommands.cs b/Source/ACE.Server/Command/Handlers/HelpCommands.cs index 7af9a3f25a..33bf825300 100644 --- a/Source/ACE.Server/Command/Handlers/HelpCommands.cs +++ b/Source/ACE.Server/Command/Handlers/HelpCommands.cs @@ -30,7 +30,7 @@ public static void HandleACEHelp(Session session, params string[] parameters) return; } - if (parameters?[0] == "commands") // Mimick @help commands command + if (string.Equals(parameters?[0], "commands", StringComparison.OrdinalIgnoreCase)) // Mimick @help commands command { HandleACECommands(session, parameters); return; diff --git a/Source/ACE.Server/Command/Handlers/PlayerCommands.cs b/Source/ACE.Server/Command/Handlers/PlayerCommands.cs index 9ff7266649..96c59eb793 100644 --- a/Source/ACE.Server/Command/Handlers/PlayerCommands.cs +++ b/Source/ACE.Server/Command/Handlers/PlayerCommands.cs @@ -144,8 +144,6 @@ public static void HandleHouseSelect(Session session, bool confirmed, params str actionChain.AddDelaySeconds(3.0f); // wait for slumlord inventory biotas above to save actionChain.AddAction(session.Player, session.Player.HandleActionQueryHouse); actionChain.EnqueueChain(); - - Console.WriteLine("OK"); } [CommandHandler("debugcast", AccessLevel.Player, CommandHandlerFlag.RequiresWorld, "Shows debug information about the current magic casting state")] @@ -419,7 +417,7 @@ public static void HandleReportbug(Session session, params string[] parameters) for (var i = 1; i < parameters.Length; i++) description += parameters[i] + " "; - description.Trim(); + description = description.Trim(); switch (category.ToLower()) { @@ -454,7 +452,7 @@ public static void HandleReportbug(Session session, params string[] parameters) var w = ""; var g = ""; - if (cg == "creature" || cg == "npc"|| cg == "item" || cg == "item") + if (cg == "creature" || cg == "npc" || cg == "item") { var objectId = new ObjectGuid(); if (session.Player.HealthQueryTarget.HasValue || session.Player.ManaQueryTarget.HasValue || session.Player.CurrentAppraisalTarget.HasValue) diff --git a/Source/ACE.Server/WorldObjects/Player.cs b/Source/ACE.Server/WorldObjects/Player.cs index 6fcad700c5..ef70108066 100644 --- a/Source/ACE.Server/WorldObjects/Player.cs +++ b/Source/ACE.Server/WorldObjects/Player.cs @@ -164,6 +164,8 @@ private void SetEphemeralValues() } if (Session.AccessLevel == AccessLevel.Advocate) IsAdvocate = true; + else if (IsAdvocate && !AdvocateQuest) + IsAdvocate = false; } IsOlthoiPlayer = HeritageGroup == HeritageGroup.Olthoi || HeritageGroup == HeritageGroup.OlthoiAcid;