Difference between revisions of "Service Manager Scripting Variables"

 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
The following variables are available in the '''Before Started''' and '''After Stopped''' events.
+
The following variables are available in the '''Before Started''', '''After Started''', '''Before Stopped''' and '''After Stopped''' events.
  
; Service_Affinity
+
; ThisService_CustomVariableName
; Service_CommandLineArguments
+
; ThisService_Affinity
; Service_Description
+
; ThisService_CommandLineArguments
; Service_Executable
+
; ThisService_CustomPort1
; Service_FriendlyName
+
; ThisService_CustomPort2
; Service_GamePort
+
; ThisService_CustomPort3
; Service_InteractWithDesktop
+
; ThisService_CustomPort4
; Service_IpAddress
+
; ThisService_CustomPort5
; Service_ManagedInput
+
; ThisService_Description
; Service_ManagedOutput
+
; ThisService_Executable
; Service_Owner
+
; ThisService_FriendlyName
; Service_Priority
+
; ThisService_GamePort
; Service_RootDirectory
+
; ThisService_ServiceId
; Service_ServiceId
+
; ThisService_InteractWithDesktop
; Service_StartOnCPU0
+
; ThisService_IpAddress
; Service_Startup
+
; ThisService_ManagedInput
; Service_StopCommands
+
; ThisService_ManagedOutput
; Service_StopCommandWait
+
; ThisService_Owner
; Service_StopDelay
+
; ThisService_Priority
; Service_WorkingDirectory
+
; ThisService_QueryPort
 +
; ThisService_RConPort
 +
; ThisService_RootDirectory
 +
; ThisService_Slots
 +
; ThisService_StartOnCPU0
 +
; ThisService_Startup
 +
; ThisService_StopCommands
 +
; ThisService_StopCommandWait
 +
; ThisService_StopDelay
 +
; ThisService_WorkingDirectory
 +
; ThisService_RunAsUserName
  
The following variables are available in the '''After Stopped''' event.
+
The following variables are available in the '''After Started''', '''Before Stopped''' and '''After Stopped''' events.
; Service_Pid
+
; ThisService_Pid
: Id of the process that was stopped.
+
: Id of the process that was started/stopped.
 +
 
 +
; ThisServiceController
 +
: In Iron Python and C# scripts there is a variable named ThisServiceController. This can be used to read and update values in the game server's TCAdmin2\Monitor\Services\ServiceId\Service.cfg. For example:
 +
commandline = ThisServiceController.ServiceConfig["Service.CommandLineArguments"]

Latest revision as of 21:28, 13 June 2021

The following variables are available in the Before Started, After Started, Before Stopped and After Stopped events.

ThisService_CustomVariableName
ThisService_Affinity
ThisService_CommandLineArguments
ThisService_CustomPort1
ThisService_CustomPort2
ThisService_CustomPort3
ThisService_CustomPort4
ThisService_CustomPort5
ThisService_Description
ThisService_Executable
ThisService_FriendlyName
ThisService_GamePort
ThisService_ServiceId
ThisService_InteractWithDesktop
ThisService_IpAddress
ThisService_ManagedInput
ThisService_ManagedOutput
ThisService_Owner
ThisService_Priority
ThisService_QueryPort
ThisService_RConPort
ThisService_RootDirectory
ThisService_Slots
ThisService_StartOnCPU0
ThisService_Startup
ThisService_StopCommands
ThisService_StopCommandWait
ThisService_StopDelay
ThisService_WorkingDirectory
ThisService_RunAsUserName

The following variables are available in the After Started, Before Stopped and After Stopped events.

ThisService_Pid
Id of the process that was started/stopped.
ThisServiceController
In Iron Python and C# scripts there is a variable named ThisServiceController. This can be used to read and update values in the game server's TCAdmin2\Monitor\Services\ServiceId\Service.cfg. For example:
commandline = ThisServiceController.ServiceConfig["Service.CommandLineArguments"]
Retrieved from "https://help.tcadmin.com/index.php?title=Service_Manager_Scripting_Variables&oldid=2434"