source: TFP-WebServer/MapRendering/src/Commands/EnableRendering.cs@ 501

Last change on this file since 501 was 487, checked in by alloc, 6 months ago

1.1.0.1 Release for V 1.0

File size: 1.1 KB
RevLine 
[224]1using System.Collections.Generic;
[391]2using JetBrains.Annotations;
[224]3
[391]4namespace MapRendering.Commands {
5 [UsedImplicitly]
[325]6 public class EnableRendering : ConsoleCmdAbstract {
[487]7 public override string getDescription () {
[453]8 return "Disable live map rendering";
[224]9 }
10
[487]11 public override string getHelp () {
[453]12 return @"
13 |Usage:
14 | 1. enablerendering
15 | 2. enablerendering <0/1>
16 |1. Show current state of renderer
17 |2. Disable/enable renderer
18 |NOTE: This command can only turn the renderer off, it can not turn it on if it is not enabled in the serverconfig!
19 ".Unindent ();
20 }
21
[487]22 public override string[] getCommands () {
[325]23 return new[] {"enablerendering"};
[224]24 }
25
[325]26 public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) {
[359]27 if (_params.Count != 1) {
[453]28 SdtdConsole.Instance.Output (
29 $"Current state: {MapRenderer.Enabled && MapRenderer.renderingEnabled}{(!MapRenderer.Enabled ? " (disabled by serverconfig!)" : "")}");
[359]30 return;
31 }
[224]32
[391]33 MapRenderer.renderingEnabled = _params [0].Equals ("1");
[402]34 SdtdConsole.Instance.Output ($"Set live map rendering to {_params [0].Equals ("1")}");
[224]35 }
36 }
37}
Note: See TracBrowser for help on using the repository browser.