From fdf83415d4d30b3df95b51f2cdf62d710a022021 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Thu, 30 Nov 2023 09:44:34 +0000 Subject: [PATCH] if we're changing maps, use SetMap() --- examples/cli.ps1 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/cli.ps1 b/examples/cli.ps1 index 1b59a86..118b5cb 100644 --- a/examples/cli.ps1 +++ b/examples/cli.ps1 @@ -14,12 +14,15 @@ Function Read-HostUntilEmpty { if ($line -in @("fast_restart", "map_rotate", "map_restart")) { $cmd = $line -replace '(?:^|_)(\p{L})', { $_.Groups[1].Value.ToUpper() } - $resp = $rcon.$cmd() + $rcon.$cmd() + } + elseif ($line.StartsWith("map mp_")) { + $mapname = $line.Split()[1] + $rcon.SetMap($mapname) } else { - $resp = $rcon.Send($line) + $rcon.Send($line) } - $resp | Write-Host } }