Skip to content

Commit

Permalink
Fix serverperformance command bug
Browse files Browse the repository at this point in the history
  • Loading branch information
LtRipley36706 committed Apr 25, 2024
1 parent d61b6f3 commit 2d50a8c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Source/ACE.Server/Command/Handlers/AdminStatCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ public static void HandleServerPerformance(Session session, params string[] para
{
if (parameters != null && (parameters.Length == 1 || parameters.Length == 2))
{
if (parameters[0].ToLower() == "start")
if (parameters.Length >= 1 && parameters[0].ToLower() == "start")
{
if (parameters[1].ToLower() == "cumulative")
if (parameters.Length >= 2 && parameters[1].ToLower() == "cumulative")
{
ServerPerformanceMonitor.StartCumulative();
CommandHandlerHelper.WriteOutputInfo(session, "Cumulative Server Performance Monitor started");
Expand All @@ -157,9 +157,9 @@ public static void HandleServerPerformance(Session session, params string[] para
}
}

if (parameters[0].ToLower() == "stop")
if (parameters.Length >= 1 && parameters[0].ToLower() == "stop")
{
if (parameters[1].ToLower() == "cumulative")
if (parameters.Length >= 2 && parameters[1].ToLower() == "cumulative")
{
ServerPerformanceMonitor.StopCumulative();
CommandHandlerHelper.WriteOutputInfo(session, "Cumulative Server Performance Monitor stopped");
Expand All @@ -173,7 +173,7 @@ public static void HandleServerPerformance(Session session, params string[] para
}
}

if (parameters[0].ToLower() == "reset")
if (parameters.Length >= 1 && parameters[0].ToLower() == "reset")
{
ServerPerformanceMonitor.Reset();
CommandHandlerHelper.WriteOutputInfo(session, "Server Performance Monitor reset");
Expand Down

0 comments on commit 2d50a8c

Please sign in to comment.