Custom RCON Protocol

Revision as of 11:23, 21 September 2018 by TCAWiki (talk | contribs) (Created page with "You can set a custom script that executes RCON commands on the game server. This is useful if you want to add RCON support for games that don't have a supported RCON protocol....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

You can set a custom script that executes RCON commands on the game server. This is useful if you want to add RCON support for games that don't have a supported RCON protocol.

Create a custom script. Set the script's event to "Custom RCON". Set the game's RCON protocol to "Custom".

The following example uses TCAdmin2\MonitorTools\\mcrcon.exe to execute RCON commands on the game server.

import clr;
import System;
from System import String, Environment, PlatformID;
from System.IO import Directory, Path;
from System.Diagnostics import Process;
p = Process();
p.StartInfo.FileName=Path.Combine(Directory.GetCurrentDirectory(), "Tools\\mcrcon.exe");
p.StartInfo.Arguments=String.Format("-c -H {0} -P {1} -p \"{2}\" \"{3}\"", ThisService.IpAddress, ThisService.RConPort, RConPassword, RConCommand);
p.StartInfo.WorkingDirectory=Path.Combine(Directory.GetCurrentDirectory(), "Tools");
p.StartInfo.UseShellExecute = False;
p.StartInfo.RedirectStandardOutput = True;
p.Start();
ReturnValue= p.StandardOutput.ReadToEnd();
Retrieved from "https://help.tcadmin.com/index.php?title=Custom_RCON_Protocol&oldid=1491"