39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
using System.Collections.Generic;
|
|
|
|
public class ConsoleCmdChangeOption : ConsoleCmdAbstract
|
|
{
|
|
public override bool IsExecuteOnClient => true;
|
|
public override bool AllowedInMainMenu => false;
|
|
public override int DefaultPermissionLevel => 1000;
|
|
|
|
public override void Execute(List<string> _params, CommandSenderInfo _senderInfo)
|
|
{
|
|
if (GameManager.Instance.adminTools == null)
|
|
return;
|
|
|
|
if (_params.Count == 2)
|
|
{
|
|
string option = _params[0];
|
|
string value = _params[1];
|
|
|
|
if (!SingletonMonoBehaviour<ConnectionManager>.Instance.IsServer)
|
|
{
|
|
SingletonMonoBehaviour<ConnectionManager>.Instance.SendToServer((NetPackage)NetPackageManager.GetPackage<NetPackageChangeOption>().Setup(option, value));
|
|
return;
|
|
}
|
|
|
|
RebirthUtilities.ChangeOption(option, value);
|
|
}
|
|
}
|
|
|
|
public override string[] getCommands()
|
|
{
|
|
return new string[1] { "changeoption" };
|
|
}
|
|
|
|
public override string getDescription()
|
|
{
|
|
return "Lets the player change a rebirth option";
|
|
}
|
|
}
|