-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStopProfilingCommand.cs
More file actions
35 lines (28 loc) · 1.01 KB
/
StopProfilingCommand.cs
File metadata and controls
35 lines (28 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System.Collections.Generic;
using Rocket.API;
using UnityEngine.Profiling;
using Logger = Rocket.Core.Logging.Logger;
namespace UntProfiler
{
public class StopProfilingCommand : IRocketCommand
{
public string Name => "stopprofiling";
public AllowedCaller AllowedCaller => AllowedCaller.Console;
public string Help => "Stops the profiling session.";
public string Syntax => "/stopprofiling";
public List<string> Aliases => new List<string> { "stopprofile", "stoppf" };
public List<string> Permissions => new List<string> { };
public void Execute(IRocketPlayer caller, string[] command)
{
if (!Profiler.enabled)
{
Logger.Log("No profiling session is running.");
return;
}
Profiler.enabled = false;
Profiler.enableBinaryLog = false;
Profiler.enableAllocationCallstacks = false;
Logger.Log("Profiling session stopped.");
}
}
}