Difference between revisions of "Custom Scripts"

m
Line 42: Line 42:
 
: Available objects: [[ThisServer]], [[ThisGame]], [[ThisUser]], [[ThisService]]
 
: Available objects: [[ThisServer]], [[ThisGame]], [[ThisUser]], [[ThisService]]
  
; Before started
+
; Before started (executed by the Service Manager)
: Occurs before the service is started. The script is executed in the service's working directory. After creating or updating a script with this event go to the game's settings and click on Update Existing Services.
+
: Occurs before the service is started. The script is executed in the service's working directory. After creating or updating a script with this event go to the game's settings and click on Update Existing Services or go to a game server's service settings and click on Save.
 
: Available variables:  [[Service Manager Scripting Variables]]
 
: Available variables:  [[Service Manager Scripting Variables]]
  
; After stopped
+
; After started (executed by the Service Manager)
: Occurs after the service is stopped. The script is executed in the service's working directory. After creating or updating a script with this event go to the game's settings and click on Update Existing Services.
+
: Occurs after the service is started. The script is executed in the service's working directory. After creating or updating a script with this event go to the game's settings and click on Update Existing Services or go to a game server's service settings and click on Save.
 +
: Available variables:  [[Service Manager Scripting Variables]]
 +
 
 +
; Before stopped (executed by the Service Manager)
 +
: Occurs before the service is stopped. The script is executed in the service's working directory. After creating or updating a script with this event go to the game's settings and click on Update Existing Services or go to a game server's service settings and click on Save.
 +
: Available variables: [[Service Manager Scripting Variables]]
 +
 
 +
; After stopped (executed by the Service Manager)
 +
: Occurs after the service is stopped. The script is executed in the service's working directory. After creating or updating a script with this event go to the game's settings and click on Update Existing Services or go to a game server's service settings and click on Save.
 
: Available variables: [[Service Manager Scripting Variables]]
 
: Available variables: [[Service Manager Scripting Variables]]
  

Revision as of 11:25, 26 November 2012

TCAdmin supports the following scripting engines:

  • Iron Python
  • Batch/Shell script Object properties and variables are converted to environment variables.
    • Use Linux environment variables like this: ${Object_Property}
    • Use Windows environment variables like this: %Object_Property%

You can specify if you want to run your script on Windows servers, Linux servers, or both.

All scripts have the TCAdminFolder variable. The value is the TCAdmin installation folder.

The following events are supported:

Before created
Occurs before any files and folders have been created.
Available objects: ThisServer, ThisGame, ThisUser, ThisService
After created
Occurs after the service files have been created but before it has been configured as a service. The script is executed in the service's root directory.
Available objects: ThisServer, ThisGame, ThisUser, ThisService
Before deleted
Occurs before the delete process is started. The script is executed in the service's root directory.
Available objects: ThisServer, ThisGame, ThisUser, ThisService
After deleted
Occurs after the service files have been deleted and it has been removed from the database.
Available objects: ThisServer, ThisGame, ThisUser, ThisService
Before reinstall
Occurs before the service files have been deleted. The script is executed in the service's root directory.
Available objects: ThisServer, ThisGame, ThisUser, ThisService
After reinstall
Occurs after the service has been reinstalled but before it has been configured as a service. The script is executed in the service's root directory.
Available objects: ThisServer, ThisGame, ThisUser, ThisService
Before move
Occurs before the service has been moved. It is executed on the server where the service is currently located. The script is executed in the service's root directory.
Available objects: ThisServer, ThisGame, ThisUser, ThisService
After move
Occurs after the service has been moved. It is executed on the server where the service was moved to. The script is executed in the service's root directory.
Available objects: ThisServer, ThisGame, ThisUser, ThisService
Before started (executed by the Service Manager)
Occurs before the service is started. The script is executed in the service's working directory. After creating or updating a script with this event go to the game's settings and click on Update Existing Services or go to a game server's service settings and click on Save.
Available variables: Service Manager Scripting Variables
After started (executed by the Service Manager)
Occurs after the service is started. The script is executed in the service's working directory. After creating or updating a script with this event go to the game's settings and click on Update Existing Services or go to a game server's service settings and click on Save.
Available variables: Service Manager Scripting Variables
Before stopped (executed by the Service Manager)
Occurs before the service is stopped. The script is executed in the service's working directory. After creating or updating a script with this event go to the game's settings and click on Update Existing Services or go to a game server's service settings and click on Save.
Available variables: Service Manager Scripting Variables
After stopped (executed by the Service Manager)
Occurs after the service is stopped. The script is executed in the service's working directory. After creating or updating a script with this event go to the game's settings and click on Update Existing Services or go to a game server's service settings and click on Save.
Available variables: Service Manager Scripting Variables


Troubleshooting Scripts

  • Enable debug mode on the server.
  • Stop the Monitor or Service Manager service depending on the script's event.
  • Start the Monitor or Service Manager console depending on the script's event.
  • When the script is executed the console will show the output of the batch/shell script or any iron python error.
Retrieved from "https://help.tcadmin.com/index.php?title=Custom_Scripts&oldid=932"