1.7 KiB
1.7 KiB
Getting started
Here you can learn how to create your first resource
Directory structure
Below is the server's directory structure
ServerRoot
│ Settings.xml
│
└───Resources
└───Server
│ │ RageCoop.Resources.Management.zip
│ │ RageCoop.Resources.FreeRoam.Server.zip
│ │
│
│───Client
│ │ RageCoop.Resources.FreeRoam.Client.zip
│ │
│
└───Temp
Settings.xml
This file will be generated first time you started the, you can change the server's configuration option by editing it, refer to this for detailed description.
Resources
Each directory or zip in represents one resource, which consists of several dlls, and is isolated from another resource.
Server Reource
The resource will be running at server side, here's how to create one:
- Create a C# class library project targeting .NET 6.0.
- Add reference to RageCoop.Server.dll and RageCoop.Core.dll.
- Add following namespace(s):
using RageCoop.Server.Scripting;
// Optional
using RageCoop.Server;
using RageCoop.Core.Scripting;
using RageCoop.Core;
- Inherit a class from ServerScript.
- Implement
OnStart()
andOnStop()
:
public class MyFirstResource :ServerScript
{
public override void OnStart()
{
// Initiate your script here
}
public override void OnStop()
{
// Free all resources and perform cleanup
}
}