Class ServerScript
Inherit from this class, constructor will be called automatically, but other scripts might have yet been loaded and API will be null, you should use OnStart(). to initiate your script.
Inherited Members
Namespace: RageCoop.Server.Scripting
Assembly: RageCoop.Server.dll
Syntax
public abstract class ServerScript
Properties
API
Get the API instance that can be used to control the server.
Declaration
public API API { get; set; }
Property Value
Type | Description |
---|---|
API |
CurrentFile
Get the ResourceFile that the script belongs to.
Declaration
public ResourceFile CurrentFile { get; }
Property Value
Type | Description |
---|---|
ResourceFile |
CurrentResource
Get the ServerResource object this script belongs to, this property will be initiated before OnStart() (will be null if you access it in the constructor).
Declaration
public ServerResource CurrentResource { get; }
Property Value
Type | Description |
---|---|
ServerResource |
Methods
OnStart()
This method would be called from listener thread after all scripts have been loaded.
Declaration
public abstract void OnStart()
OnStop()
This method would be called from listener thread when the server is shutting down, you MUST terminate all background jobs/threads in this method.
Declaration
public abstract void OnStop()