Files
RobustToolbox/Robust.Client/Console/Commands/Scripting.cs
Pieter-Jan Briers 400dcb06fc Server scripting.
2020-04-30 00:06:59 +02:00

45 lines
1.2 KiB
C#

using Robust.Client.Interfaces.Console;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
namespace Robust.Client.Console.Commands
{
#if CLIENT_SCRIPTING
internal sealed class ScriptConsoleCommand : IConsoleCommand
{
public string Command => "csi";
public string Description => "Opens a C# interactive console.";
public string Help => "csi";
public bool Execute(IDebugConsole console, params string[] args)
{
new ScriptConsoleClient().OpenCenteredMinSize();
return false;
}
}
#endif
internal sealed class ServerScriptConsoleCommand : IConsoleCommand
{
public string Command => "scsi";
public string Description => "Opens a C# interactive console on the server.";
public string Help => "scsi";
public bool Execute(IDebugConsole console, params string[] args)
{
var mgr = IoCManager.Resolve<IScriptClient>();
if (!mgr.CanScript)
{
console.AddLine(Loc.GetString("You do not have server side scripting permission."), Color.Red);
return false;
}
mgr.StartSession();
return false;
}
}
}