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

Last change on this file since 467 was 453, checked in by alloc, 16 months ago

21.1.9 release, updated Sessions handler to be more flexible

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 {
[405]7 protected override string getDescription () {
[453]8 return "Disable live map rendering";
[224]9 }
10
[453]11 protected override string getHelp () {
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
[405]22 protected 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.