From 8ee188cf19a9f80d6e1c1eaa6cfb46598e486594 Mon Sep 17 00:00:00 2001 From: Sardelka Date: Sat, 2 Jul 2022 11:23:12 +0800 Subject: [PATCH] update docs --- RageCoop.Client/Scripting/API.cs | 7 +- RageCoop.Client/Scripting/ClientScript.cs | 5 + RageCoop.Client/Scripting/Resources.cs | 41 +- RageCoop.Server/Client.cs | 2 +- RageCoop.Server/Scripting/API.cs | 9 +- RageCoop.Server/Scripting/ServerScript.cs | 4 +- build.cmd | 7 + docfx.json | 1 - ....CoopMap.html => RageCoop.Client.Map.html} | 18 +- docs/api/RageCoop.Client.Scripting.API.html | 69 ++- ...ageCoop.Client.Scripting.ClientScript.html | 26 ++ docs/api/RageCoop.Client.Settings.html | 26 ++ docs/api/RageCoop.Client.html | 2 +- docs/api/RageCoop.Server.Client.html | 34 +- docs/api/RageCoop.Server.Scripting.API.html | 32 +- ...ageCoop.Server.Scripting.ServerEvents.html | 336 ++++++++++++++ ...ageCoop.Server.Scripting.ServerScript.html | 4 +- docs/api/RageCoop.Server.Scripting.html | 4 +- docs/api/RageCoop.Server.ServerEntities.html | 240 ++++++++++ docs/api/RageCoop.Server.ServerObject.html | 266 +++++++++++ docs/api/RageCoop.Server.ServerPed.html | 64 ++- docs/api/RageCoop.Server.ServerSettings.html | 57 ++- docs/api/RageCoop.Server.ServerVehicle.html | 266 +++++++++++ docs/api/RageCoop.Server.html | 9 + docs/api/toc.html | 19 +- docs/index.html | 51 +- docs/index.json | 59 ++- docs/manifest.json | 130 ++++-- docs/toc.html | 2 +- docs/xrefmap.yml | 437 ++++++++++++++---- index.md | 75 +-- toc.yml | 2 +- 32 files changed, 1964 insertions(+), 340 deletions(-) create mode 100644 build.cmd rename docs/api/{RageCoop.Client.CoopMap.html => RageCoop.Client.Map.html} (92%) create mode 100644 docs/api/RageCoop.Server.Scripting.ServerEvents.html create mode 100644 docs/api/RageCoop.Server.ServerEntities.html create mode 100644 docs/api/RageCoop.Server.ServerObject.html create mode 100644 docs/api/RageCoop.Server.ServerVehicle.html diff --git a/RageCoop.Client/Scripting/API.cs b/RageCoop.Client/Scripting/API.cs index d22dc60..9c6322f 100644 --- a/RageCoop.Client/Scripting/API.cs +++ b/RageCoop.Client/Scripting/API.cs @@ -148,9 +148,12 @@ namespace RageCoop.Client.Scripting /// Get a that RAGECOOP is currently using. /// /// - public static Logger GetLogger() + public static Logger Logger { - return Main.Logger; + get + { + return Main.Logger; + } } /// /// Queue an action to be executed on next tick. diff --git a/RageCoop.Client/Scripting/ClientScript.cs b/RageCoop.Client/Scripting/ClientScript.cs index 4db5247..4d85802 100644 --- a/RageCoop.Client/Scripting/ClientScript.cs +++ b/RageCoop.Client/Scripting/ClientScript.cs @@ -22,5 +22,10 @@ namespace RageCoop.Client.Scripting /// public ResourceFile CurrentFile { get; internal set; } + /// + /// Get the that this script belongs to. + /// + public ClientResource CurrentResource { get; internal set; } + } } diff --git a/RageCoop.Client/Scripting/Resources.cs b/RageCoop.Client/Scripting/Resources.cs index 1b85186..1ec7820 100644 --- a/RageCoop.Client/Scripting/Resources.cs +++ b/RageCoop.Client/Scripting/Resources.cs @@ -202,6 +202,7 @@ namespace RageCoop.Client.Scripting var script = constructor.Invoke(null) as ClientScript; // script.CurrentResource = toload; script.CurrentFile=rfile; + script.CurrentResource=toload; toload.Scripts.Add(script); count++; } @@ -287,46 +288,6 @@ namespace RageCoop.Client.Scripting return true; return false; } - /* - /// - /// Load a resource from a directory. - /// - /// Path of the directory. - private void LoadResource(string path, string dataFolderRoot) - { - var r = new ClientResource() - { - Scripts = new List(), - Name=Path.GetFileName(path), - DataFolder=Path.Combine(dataFolderRoot, Path.GetFileName(path)) - }; - Directory.CreateDirectory(r.DataFolder); - foreach (var dir in Directory.GetDirectories(path, "*", SearchOption.AllDirectories)) - { - r.Files.Add(dir, new ResourceFile() - { - IsDirectory=true, - Name=dir.Substring(path.Length+1) - }); - } - foreach (var file in Directory.GetFiles(path, "*", SearchOption.AllDirectories)) - { - var relativeName = file.Substring(path.Length+1); - var rfile = new ResourceFile() - { - GetStream=() => { return new FileStream(file, FileMode.Open, FileAccess.Read); }, - IsDirectory=false, - Name=relativeName - }; - if (file.EndsWith(".dll")) - { - LoadScriptsFromAssembly(rfile, file, r); - } - r.Files.Add(relativeName, rfile); - } - LoadedResources.Add(r); - } - */ } } diff --git a/RageCoop.Server/Client.cs b/RageCoop.Server/Client.cs index d5cdb89..60e4339 100644 --- a/RageCoop.Server/Client.cs +++ b/RageCoop.Server/Client.cs @@ -66,7 +66,7 @@ namespace RageCoop.Server /// public ServerPed Player { get; internal set; } /// - /// The client's latncy in seconds. + /// The client's latency in seconds. /// public float Latency { get; internal set; } private PlayerConfig _config { get; set; }=new PlayerConfig(); diff --git a/RageCoop.Server/Scripting/API.cs b/RageCoop.Server/Scripting/API.cs index 2f79130..3964a78 100644 --- a/RageCoop.Server/Scripting/API.cs +++ b/RageCoop.Server/Scripting/API.cs @@ -14,10 +14,10 @@ namespace RageCoop.Server.Scripting /// /// /// - public class APIEvents + public class ServerEvents { private readonly Server Server; - internal APIEvents(Server server) + internal ServerEvents(Server server) { Server = server; } @@ -143,12 +143,13 @@ namespace RageCoop.Server.Scripting /// /// Server side events /// - public readonly APIEvents Events; + public readonly ServerEvents Events; /// /// All synchronized entities on this server. /// public ServerEntities Entities { get { return Server.Entities; } } + #region FUNCTIONS /// /// Get a list of all Clients @@ -310,7 +311,7 @@ namespace RageCoop.Server.Scripting RegisterCustomEventHandler(CustomEvents.Hash(name), handler); } /// - /// Get a that the server is currently using, you should use to display resource-specific information. + /// Get a that the server is currently using, you should use to display resource-specific information. /// public Logger Logger { get { return Server.Logger; } } #endregion diff --git a/RageCoop.Server/Scripting/ServerScript.cs b/RageCoop.Server/Scripting/ServerScript.cs index fe5351a..5f67729 100644 --- a/RageCoop.Server/Scripting/ServerScript.cs +++ b/RageCoop.Server/Scripting/ServerScript.cs @@ -19,12 +19,12 @@ namespace RageCoop.Server.Scripting public abstract void OnStop(); /// - /// Get the instance that can be used to control the server. + /// Get the instance that can be used to control the server. /// public API API { get; set; } /// - /// Get the object this script belongs to, this property will be initiated before (will be null if you access it in the constructor). + /// Get the this script belongs to, this property won't be initiated before . /// public ServerResource CurrentResource { get; internal set; } /// diff --git a/build.cmd b/build.cmd new file mode 100644 index 0000000..5b972d9 --- /dev/null +++ b/build.cmd @@ -0,0 +1,7 @@ +rmdir /s /q obj +docfx +dotnet build RageCoop.Client/RageCoop.Client.csproj --no-restore --configuration Release -o RageCoop.Client/bin/RageCoop +dotnet publish RageCoop.Server/RageCoop.Server.csproj --self-contained -p:PublishSingleFile=true -p:PublishTrimmed=true -r win-x64 -o RageCoop.Server/bin/win-x64 -c Release +dotnet publish RageCoop.Server/RageCoop.Server.csproj --self-contained -p:PublishSingleFile=true -p:PublishTrimmed=true -r linux-x64 -o RageCoop.Server/bin/linux-x64 -c Release +dotnet publish RageCoop.Server/RageCoop.Server.csproj --self-contained -p:PublishSingleFile=true -p:PublishTrimmed=true -r linux-arm -o RageCoop.Server/bin/linux-arm -c Release +rmdir /s /q obj \ No newline at end of file diff --git a/docfx.json b/docfx.json index 7286251..821b03b 100644 --- a/docfx.json +++ b/docfx.json @@ -21,7 +21,6 @@ "files": [ "*.md", "toc.yml" ] } ], - "overwrite": "specs/*.md", "globalMetadata": { "_appTitle": "RageCoop resource documentation", "_enableSearch": true diff --git a/docs/api/RageCoop.Client.CoopMap.html b/docs/api/RageCoop.Client.Map.html similarity index 92% rename from docs/api/RageCoop.Client.CoopMap.html rename to docs/api/RageCoop.Client.Map.html index cb668ff..5ea1373 100644 --- a/docs/api/RageCoop.Client.CoopMap.html +++ b/docs/api/RageCoop.Client.Map.html @@ -5,10 +5,10 @@ - Class CoopMap + <title>Class Map | RageCoop resource documentation - @@ -78,17 +78,17 @@
-
+
-

Class CoopMap +

Class Map

Inheritance
-
CoopMap
+
Map
Inherited Members
@@ -116,16 +116,16 @@
Namespace: RageCoop.Client
Assembly: RageCoop.Client.dll
-
Syntax
+
Syntax
-
public class CoopMap
+
public class Map

Properties

- -

Props

+ +

Props

Declaration
diff --git a/docs/api/RageCoop.Client.Scripting.API.html b/docs/api/RageCoop.Client.Scripting.API.html index cb8b2b5..e516b33 100644 --- a/docs/api/RageCoop.Client.Scripting.API.html +++ b/docs/api/RageCoop.Client.Scripting.API.html @@ -280,31 +280,18 @@ -

Methods -

- -

Disconnect()

-

Disconnect from the server

-
-
-
Declaration
-
-
public static void Disconnect()
-
- - - -

GetLogger()

+ +

Logger

Get a Logger that RAGECOOP is currently using.

Declaration
-
public static Logger GetLogger()
+
public static Logger Logger { get; }
-
Returns
+
Property Value
@@ -319,6 +306,19 @@
+

Methods +

+ + + +

Disconnect()

+

Disconnect from the server

+
+
+
Declaration
+
+
public static void Disconnect()
+
@@ -421,7 +421,7 @@

SendCustomEvent(Int32, List<Object>)

-

Send an event and data to the specified clients.

+

Send an event and data to the server.

Declaration
@@ -453,6 +453,39 @@ byte, short, ushort, int, uint, long, ulong, float, bool, string.

+ + + +

SendCustomEvent(Int32, Object[])

+

Send an event and data to the server.

+
+
+
Declaration
+
+
public static void SendCustomEvent(int eventHash, params object[] args)
+
+
Parameters
+ + + + + + + + + + + + + + + + + + + + +
TypeNameDescription
Int32eventHash
Object[]args
diff --git a/docs/api/RageCoop.Client.Scripting.ClientScript.html b/docs/api/RageCoop.Client.Scripting.ClientScript.html index 26f937a..eee9a02 100644 --- a/docs/api/RageCoop.Client.Scripting.ClientScript.html +++ b/docs/api/RageCoop.Client.Scripting.ClientScript.html @@ -149,6 +149,32 @@ + + + +

CurrentResource

+

Get the ClientResource that this script belongs to.

+
+
+
Declaration
+
+
public ClientResource CurrentResource { get; }
+
+
Property Value
+ + + + + + + + + + + + + +
TypeDescription
ClientResource

Methods

diff --git a/docs/api/RageCoop.Client.Settings.html b/docs/api/RageCoop.Client.Settings.html index 4962d01..c828ece 100644 --- a/docs/api/RageCoop.Client.Settings.html +++ b/docs/api/RageCoop.Client.Settings.html @@ -361,6 +361,32 @@ + +

ResourceDirectory

+

The directory where resources downloaded from server will be placed.

+
+
+
Declaration
+
+
public string ResourceDirectory { get; set; }
+
+
Property Value
+ + + + + + + + + + + + + +
TypeDescription
String
+ +

Username

Don't use it!

diff --git a/docs/api/RageCoop.Client.html b/docs/api/RageCoop.Client.html index e351a2a..a038bd1 100644 --- a/docs/api/RageCoop.Client.html +++ b/docs/api/RageCoop.Client.html @@ -87,7 +87,7 @@

Classes

-

CoopMap

+

Map

Settings

Don't use it!

diff --git a/docs/api/RageCoop.Server.Client.html b/docs/api/RageCoop.Server.Client.html index c1aa17e..44ecd8a 100644 --- a/docs/api/RageCoop.Server.Client.html +++ b/docs/api/RageCoop.Server.Client.html @@ -205,7 +205,7 @@

Latency

-

The client's latncy in seconds.

+

The client's latency in seconds.

Declaration
@@ -406,6 +406,38 @@ + +

SendCustomEvent(Int32, Object[])

+
+
+
Declaration
+
+
public void SendCustomEvent(int hash, params object[] args)
+
+
Parameters
+ + + + + + + + + + + + + + + + + + + + +
TypeNameDescription
Int32hash
Object[]args
+ +

SendNativeCall(Hash, Object[])

Send a native call to client and ignore it's response.

diff --git a/docs/api/RageCoop.Server.Scripting.API.html b/docs/api/RageCoop.Server.Scripting.API.html index 21cbfe3..8b79ad0 100644 --- a/docs/api/RageCoop.Server.Scripting.API.html +++ b/docs/api/RageCoop.Server.Scripting.API.html @@ -131,7 +131,7 @@
Declaration
-
public readonly APIEvents Events
+
public readonly ServerEvents Events
Field Value
@@ -143,7 +143,7 @@ - + @@ -152,9 +152,35 @@ + +

Entities

+

All synchronized entities on this server.

+
+
+
Declaration
+
+
public ServerEntities Entities { get; }
+
+
Property Value
+
APIEventsServerEvents
+ + + + + + + + + + + + +
TypeDescription
ServerEntities
+ +

Logger

-

Get a Logger that the server is currently using, you should use Logger to display resource-specific information.

+

Get a Logger that the server is currently using, you should use Logger to display resource-specific information.

Declaration
diff --git a/docs/api/RageCoop.Server.Scripting.ServerEvents.html b/docs/api/RageCoop.Server.Scripting.ServerEvents.html new file mode 100644 index 0000000..db8e356 --- /dev/null +++ b/docs/api/RageCoop.Server.Scripting.ServerEvents.html @@ -0,0 +1,336 @@ + + + + + + + + Class ServerEvents + | RageCoop resource documentation + + + + + + + + + + + + + + + +
+
+ + + + +
+
+ +
+
Search Results for
+
+

+
+
    +
    +
    + + + +
    + + + + + + diff --git a/docs/api/RageCoop.Server.Scripting.ServerScript.html b/docs/api/RageCoop.Server.Scripting.ServerScript.html index 5e6d993..c128ab4 100644 --- a/docs/api/RageCoop.Server.Scripting.ServerScript.html +++ b/docs/api/RageCoop.Server.Scripting.ServerScript.html @@ -127,7 +127,7 @@

    API

    -

    Get the API instance that can be used to control the server.

    +

    Get the API instance that can be used to control the server.

    Declaration
    @@ -179,7 +179,7 @@

    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).

    +

    Get the ServerResource this script belongs to, this property won't be initiated before OnStart().

    Declaration
    diff --git a/docs/api/RageCoop.Server.Scripting.html b/docs/api/RageCoop.Server.Scripting.html index a5865ac..a99e584 100644 --- a/docs/api/RageCoop.Server.Scripting.html +++ b/docs/api/RageCoop.Server.Scripting.html @@ -90,8 +90,6 @@

    API

    An class that can be used to interact with RageCoop server.

    -

    APIEvents

    -

    ChatEventArgs

    Command

    @@ -106,6 +104,8 @@

    OnCommandEventArgs

    +

    ServerEvents

    +

    ServerResource

    A class representing a server side resource, each resource is isolated from another and will be started alongside the server.

    diff --git a/docs/api/RageCoop.Server.ServerEntities.html b/docs/api/RageCoop.Server.ServerEntities.html new file mode 100644 index 0000000..a8c0c01 --- /dev/null +++ b/docs/api/RageCoop.Server.ServerEntities.html @@ -0,0 +1,240 @@ + + + + + + + + Class ServerEntities + | RageCoop resource documentation + + + + + + + + + + + + + + + +
    +
    + + + + +
    +
    + +
    +
    Search Results for
    +
    +

    +
    +
      +
      +
      + + + +
      + + + + + + diff --git a/docs/api/RageCoop.Server.ServerObject.html b/docs/api/RageCoop.Server.ServerObject.html new file mode 100644 index 0000000..f67c180 --- /dev/null +++ b/docs/api/RageCoop.Server.ServerObject.html @@ -0,0 +1,266 @@ + + + + + + + + Class ServerObject + | RageCoop resource documentation + + + + + + + + + + + + + + + +
      +
      + + + + +
      +
      + +
      +
      Search Results for
      +
      +

      +
      +
        +
        +
        + + + +
        + + + + + + diff --git a/docs/api/RageCoop.Server.ServerPed.html b/docs/api/RageCoop.Server.ServerPed.html index 2dfd111..7a40f4e 100644 --- a/docs/api/RageCoop.Server.ServerPed.html +++ b/docs/api/RageCoop.Server.ServerPed.html @@ -153,7 +153,7 @@

        ID

        -

        The ped's ID (not handle!).

        +

        The ped's network ID (not handle!).

        Declaration
        @@ -177,6 +177,58 @@ + +

        IsPlayer

        +

        Whether this ped is a player.

        +
        +
        +
        Declaration
        +
        +
        public bool IsPlayer { get; }
        +
        +
        Property Value
        + + + + + + + + + + + + + +
        TypeDescription
        Boolean
        + + + +

        LastVehicle

        +

        The ped's last vehicle.

        +
        +
        +
        Declaration
        +
        +
        public ServerVehicle LastVehicle { get; }
        +
        +
        Property Value
        + + + + + + + + + + + + + +
        TypeDescription
        ServerVehicle
        + +

        Owner

        The Client that is responsible synchronizing for this ped.

        @@ -229,14 +281,14 @@ - -

        VehicleID

        -

        The ID of the ped's last vehicle.

        + +

        Rotation

        +

        Gets or sets this ped's rotation

        Declaration
        -
        public int VehicleID { get; }
        +
        public Vector3 Rotation { get; }
        Property Value
        @@ -248,7 +300,7 @@ - + diff --git a/docs/api/RageCoop.Server.ServerSettings.html b/docs/api/RageCoop.Server.ServerSettings.html index cc4b939..f13f266 100644 --- a/docs/api/RageCoop.Server.ServerSettings.html +++ b/docs/api/RageCoop.Server.ServerSettings.html @@ -121,40 +121,13 @@
        public class ServerSettings
        -

        Fields -

        - - -

        LogLevel

        -

        See LogLevel.

        -
        -
        -
        Declaration
        -
        -
        public int LogLevel
        -
        -
        Field Value
        -
        Int32GTA.Math.Vector3
        - - - - - - - - - - - - -
        TypeDescription
        Int32

        Properties

        AnnounceSelf

        -

        Whether or not to announce this server so that it'll appear on server list.

        +

        Whether or not to announce this server so it'll appear on server list.

        Declaration
        @@ -178,9 +151,35 @@ + +

        LogLevel

        +

        See LogLevel.

        +
        +
        +
        Declaration
        +
        +
        public int LogLevel { get; set; }
        +
        +
        Property Value
        + + + + + + + + + + + + + +
        TypeDescription
        Int32
        + +

        MasterServer

        -

        Master server address, mostly doesn't to be changed.

        +

        Master server address, mostly doesn't need to be changed.

        Declaration
        diff --git a/docs/api/RageCoop.Server.ServerVehicle.html b/docs/api/RageCoop.Server.ServerVehicle.html new file mode 100644 index 0000000..3bae4cf --- /dev/null +++ b/docs/api/RageCoop.Server.ServerVehicle.html @@ -0,0 +1,266 @@ + + + + + + + + Class ServerVehicle + | RageCoop resource documentation + + + + + + + + + + + + + + + +
        +
        + + + + +
        +
        + +
        +
        Search Results for
        +
        +

        +
        +
          +
          +
          + + + +
          + + + + + + diff --git a/docs/api/RageCoop.Server.html b/docs/api/RageCoop.Server.html index 6e352db..aacbba7 100644 --- a/docs/api/RageCoop.Server.html +++ b/docs/api/RageCoop.Server.html @@ -94,12 +94,21 @@

          Server

          The instantiable RageCoop server class

          +
          +

          ServerEntities

          +

          Manipulate entities from the server

          +
          +

          ServerObject

          +

          Represents an object owned by server.

          ServerPed

          Represents a ped from a client

          ServerSettings

          Settings for RageCoop Server

          +
          +

          ServerVehicle

          +

          Represents a vehicle from a client

          diff --git a/docs/api/toc.html b/docs/api/toc.html index 19bd099..07701a2 100644 --- a/docs/api/toc.html +++ b/docs/api/toc.html @@ -18,10 +18,10 @@
        • @@ -127,9 +136,6 @@
        • API
        • -
        • - APIEvents -
        • ChatEventArgs
        • @@ -148,6 +154,9 @@
        • OnCommandEventArgs
        • +
        • + ServerEvents +
        • ServerResource
        • diff --git a/docs/index.html b/docs/index.html index e34d80a..b1321fc 100644 --- a/docs/index.html +++ b/docs/index.html @@ -72,11 +72,14 @@

          Getting started

          -

          Here you can learn how to create your first resource

          +

          Resources and Scripts

          +

          A Script stands for class that inherits from RageCoop's script class ( ServerScript and ClientScript ) and will be loaded at runtime, one assembly can have multiple scripts in it.

          +

          A Resource consists of one or more assemblies and other files. Server-side resource will be loaded at startup and is isolated from other resources, while client-side resource will be sent to each client and loaded after they connected to the server. A Resource can either be in a folder or packed inside a zip archive.

          Directory structure

          Below is the server's directory structure

          ServerRoot
           │   Settings.xml   
          +|   RageCoop.Server.exe
           │
           └───Resources
               └───Server
          @@ -91,16 +94,13 @@
               └───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.

          +

          This file will be generated first time you started the server, you can then change the server's configuration option by editing it, refer to ServerSettings for detailed description.

          Server Reource

          -

          The resource will be running at server side, here's how to create one:

          +

          To create a server resource:

          1. Create a C# class library project targeting .NET 6.0.
          2. Add reference to RageCoop.Server.dll and RageCoop.Core.dll.
          3. -
          4. Add following namespace(s):
          5. -
          +
        • Add following namespace(s):
          using RageCoop.Server.Scripting;
           
           // Optional
          @@ -109,24 +109,33 @@ using RageCoop.Core.Scripting;
           using RageCoop.Core;
           
           
          -
            +
          1. Inherit a class from ServerScript.
          2. -
          3. Implement OnStart() and OnStop():
          4. -
          -
          public class MyFirstResource :ServerScript
          +
        • Implement OnStart() and OnStop(), your cs file should look like this: +
          using RageCoop.Server.Scripting;
          +
          +namespace NiceGuy.MyFirstResource
           {
          -     public override void OnStart()
          -     {
          -         // Initiate your script here
          -     }
          -     public override void OnStop()
          -     {
          -         // Free all resources and perform cleanup
          -     }
          +    public class Main : ServerScript
          +    {
          +         public override void OnStart()
          +         {
          +             // Initiate your script here
          +         }
          +         public override void OnStop()
          +         {
          +             // Free all resources and perform cleanup
          +         }
          +    }
           }
           
          -
            -
          1. That's it! Now you can have some fun by using the API instance, please refer to the GiHub for more examples.
          2. + +
          3. Now you can have some fun by using the API instance, please refer to the GitHub repo for more examples.
          4. +
          5. For convenience, you can create a symlink in ServerRoot/Resources/Server/NiceGuy.MyFirstResource targeting your output folder: +
            mklink /d ServerRoot/Resources/Server/NiceGuy.MyFirstResource C:/MyRepos/NiceGuy.MyFirstResource/bin/Debug
            +
            +
          6. +
          7. That's it! Start your server and you should see your resource loading.
        • diff --git a/docs/index.json b/docs/index.json index 467a9e7..e7daae3 100644 --- a/docs/index.json +++ b/docs/index.json @@ -1,9 +1,4 @@ { - "api/RageCoop.Client.CoopMap.html": { - "href": "api/RageCoop.Client.CoopMap.html", - "title": "Class CoopMap | RageCoop resource documentation", - "keywords": "Class CoopMap Inheritance Object CoopMap Inherited Members Object.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : RageCoop.Client Assembly : RageCoop.Client.dll Syntax public class CoopMap Properties Props Declaration public List Props { get; set; } Property Value Type Description List < CoopProp >" - }, "api/RageCoop.Client.CoopProp.html": { "href": "api/RageCoop.Client.CoopProp.html", "title": "Struct CoopProp | RageCoop resource documentation", @@ -12,7 +7,12 @@ "api/RageCoop.Client.html": { "href": "api/RageCoop.Client.html", "title": "Namespace RageCoop.Client | RageCoop resource documentation", - "keywords": "Namespace RageCoop.Client Classes CoopMap Settings Don't use it! SyncedEntity SyncedPed ? SyncedVehicle A synchronized vehicle instance WorldThread Don't use it! Structs CoopProp" + "keywords": "Namespace RageCoop.Client Classes Map Settings Don't use it! SyncedEntity SyncedPed ? SyncedVehicle A synchronized vehicle instance WorldThread Don't use it! Structs CoopProp" + }, + "api/RageCoop.Client.Map.html": { + "href": "api/RageCoop.Client.Map.html", + "title": "Class Map | RageCoop resource documentation", + "keywords": "Class Map Inheritance Object Map Inherited Members Object.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : RageCoop.Client Assembly : RageCoop.Client.dll Syntax public class Map Properties Props Declaration public List Props { get; set; } Property Value Type Description List < CoopProp >" }, "api/RageCoop.Client.Scripting.API.Config.html": { "href": "api/RageCoop.Client.Scripting.API.Config.html", @@ -37,7 +37,7 @@ "api/RageCoop.Client.Scripting.API.html": { "href": "api/RageCoop.Client.Scripting.API.html", "title": "Class API | RageCoop resource documentation", - "keywords": "Class API Provides vital functionality to interact with RAGECOOP Inheritance Object API Inherited Members Object.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : RageCoop.Client.Scripting Assembly : RageCoop.Client.dll Syntax public static class API Properties CurrentVersion Get the version of RAGECOOP Declaration public static string CurrentVersion { get; } Property Value Type Description String IsChatFocused Check if the RAGECOOP chat is visible Declaration public static bool IsChatFocused { get; } Property Value Type Description Boolean IsMenuVisible Check if a RAGECOOP menu is visible Declaration public static bool IsMenuVisible { get; } Property Value Type Description Boolean IsOnServer Check if the player is already on a server Declaration public static bool IsOnServer { get; } Property Value Type Description Boolean IsPlayerListVisible Check if the RAGECOOP list of players is visible Declaration public static bool IsPlayerListVisible { get; } Property Value Type Description Boolean LocalPlayerID Get the local player's ID Declaration public static int LocalPlayerID { get; } Property Value Type Description Int32 PlayerID Methods Disconnect() Disconnect from the server Declaration public static void Disconnect() GetLogger() Get a Logger that RAGECOOP is currently using. Declaration public static Logger GetLogger() Returns Type Description Logger LocalChatMessage(String, String) Send a local chat message to this player Declaration public static void LocalChatMessage(string from, string message) Parameters Type Name Description String from Name of the sender String message The player's message QueueAction(Action) Queue an action to be executed on next tick. Declaration public static void QueueAction(Action a) Parameters Type Name Description Action a RegisterCustomEventHandler(Int32, Action) Register an handler to the specifed event hash, one event can have multiple handlers. This will be invoked from backgound thread, use QueueAction(Action) in the handler to dispatch code to script thread. Declaration public static void RegisterCustomEventHandler(int hash, Action handler) Parameters Type Name Description Int32 hash An unique identifier of the event, you can hash your event name with Hash(String) Action < CustomEventReceivedArgs > handler An handler to be invoked when the event is received from the server. SendCustomEvent(Int32, List) Send an event and data to the specified clients. Declaration public static void SendCustomEvent(int eventHash, List args) Parameters Type Name Description Int32 eventHash An unique identifier of the event List < Object > args The objects conataing your data, supported types: byte, short, ushort, int, uint, long, ulong, float, bool, string." + "keywords": "Class API Provides vital functionality to interact with RAGECOOP Inheritance Object API Inherited Members Object.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : RageCoop.Client.Scripting Assembly : RageCoop.Client.dll Syntax public static class API Properties CurrentVersion Get the version of RAGECOOP Declaration public static string CurrentVersion { get; } Property Value Type Description String IsChatFocused Check if the RAGECOOP chat is visible Declaration public static bool IsChatFocused { get; } Property Value Type Description Boolean IsMenuVisible Check if a RAGECOOP menu is visible Declaration public static bool IsMenuVisible { get; } Property Value Type Description Boolean IsOnServer Check if the player is already on a server Declaration public static bool IsOnServer { get; } Property Value Type Description Boolean IsPlayerListVisible Check if the RAGECOOP list of players is visible Declaration public static bool IsPlayerListVisible { get; } Property Value Type Description Boolean LocalPlayerID Get the local player's ID Declaration public static int LocalPlayerID { get; } Property Value Type Description Int32 PlayerID Logger Get a Logger that RAGECOOP is currently using. Declaration public static Logger Logger { get; } Property Value Type Description Logger Methods Disconnect() Disconnect from the server Declaration public static void Disconnect() LocalChatMessage(String, String) Send a local chat message to this player Declaration public static void LocalChatMessage(string from, string message) Parameters Type Name Description String from Name of the sender String message The player's message QueueAction(Action) Queue an action to be executed on next tick. Declaration public static void QueueAction(Action a) Parameters Type Name Description Action a RegisterCustomEventHandler(Int32, Action) Register an handler to the specifed event hash, one event can have multiple handlers. This will be invoked from backgound thread, use QueueAction(Action) in the handler to dispatch code to script thread. Declaration public static void RegisterCustomEventHandler(int hash, Action handler) Parameters Type Name Description Int32 hash An unique identifier of the event, you can hash your event name with Hash(String) Action < CustomEventReceivedArgs > handler An handler to be invoked when the event is received from the server. SendCustomEvent(Int32, List) Send an event and data to the server. Declaration public static void SendCustomEvent(int eventHash, List args) Parameters Type Name Description Int32 eventHash An unique identifier of the event List < Object > args The objects conataing your data, supported types: byte, short, ushort, int, uint, long, ulong, float, bool, string. SendCustomEvent(Int32, Object[]) Send an event and data to the server. Declaration public static void SendCustomEvent(int eventHash, params object[] args) Parameters Type Name Description Int32 eventHash Object [] args" }, "api/RageCoop.Client.Scripting.ClientResource.html": { "href": "api/RageCoop.Client.Scripting.ClientResource.html", @@ -47,7 +47,7 @@ "api/RageCoop.Client.Scripting.ClientScript.html": { "href": "api/RageCoop.Client.Scripting.ClientScript.html", "title": "Class ClientScript | RageCoop resource documentation", - "keywords": "Class ClientScript Inherit from this class, constructor will be called automatically, but other scripts might have yet been loaded, you should use OnStart() . to initiate your script. Inheritance Object ClientScript Inherited Members Object.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : RageCoop.Client.Scripting Assembly : RageCoop.Client.dll Syntax public abstract class ClientScript Properties CurrentFile Get the ResourceFile instance where this script is loaded from. Declaration public ResourceFile CurrentFile { get; } Property Value Type Description ResourceFile Methods OnStart() This method would be called from main thread shortly after all scripts have been loaded. Declaration public abstract void OnStart() OnStop() This method would be called from main thread when the client disconnected from the server, you MUST terminate all background jobs/threads in this method. Declaration public abstract void OnStop()" + "keywords": "Class ClientScript Inherit from this class, constructor will be called automatically, but other scripts might have yet been loaded, you should use OnStart() . to initiate your script. Inheritance Object ClientScript Inherited Members Object.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : RageCoop.Client.Scripting Assembly : RageCoop.Client.dll Syntax public abstract class ClientScript Properties CurrentFile Get the ResourceFile instance where this script is loaded from. Declaration public ResourceFile CurrentFile { get; } Property Value Type Description ResourceFile CurrentResource Get the ClientResource that this script belongs to. Declaration public ClientResource CurrentResource { get; } Property Value Type Description ClientResource Methods OnStart() This method would be called from main thread shortly after all scripts have been loaded. Declaration public abstract void OnStart() OnStop() This method would be called from main thread when the client disconnected from the server, you MUST terminate all background jobs/threads in this method. Declaration public abstract void OnStop()" }, "api/RageCoop.Client.Scripting.CustomEventReceivedArgs.html": { "href": "api/RageCoop.Client.Scripting.CustomEventReceivedArgs.html", @@ -62,7 +62,7 @@ "api/RageCoop.Client.Settings.html": { "href": "api/RageCoop.Client.Settings.html", "title": "Class Settings | RageCoop resource documentation", - "keywords": "Class Settings Don't use it! Inheritance Object Settings Inherited Members Object.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : RageCoop.Client Assembly : RageCoop.Client.dll Syntax public class Settings Fields LogLevel LogLevel for RageCoop. 0:Trace, 1:Debug, 2:Info, 3:Warning, 4:Error Declaration public int LogLevel Field Value Type Description Int32 Properties DisableAlternatePause Bring up pause menu but don't freeze time when FrontEndPauseAlternate(Esc) is pressed. Declaration public bool DisableAlternatePause { get; set; } Property Value Type Description Boolean DisableTraffic Disable world NPC traffic, mission entities won't be affected Declaration public bool DisableTraffic { get; set; } Property Value Type Description Boolean FlipMenu Don't use it! Declaration public bool FlipMenu { get; set; } Property Value Type Description Boolean LastServerAddress Don't use it! Declaration public string LastServerAddress { get; set; } Property Value Type Description String MasterServer Don't use it! Declaration public string MasterServer { get; set; } Property Value Type Description String MenuKey The key to open menu Declaration public Keys MenuKey { get; set; } Property Value Type Description Keys PassengerKey The key to enter a vehicle as passenger. Declaration public Keys PassengerKey { get; set; } Property Value Type Description Keys Password The password used to authenticate when connecting to a server. Declaration public string Password { get; set; } Property Value Type Description String Username Don't use it! Declaration public string Username { get; set; } Property Value Type Description String WorldPedSoftLimit The game won't spawn more NPC traffic if the limit is exceeded. -1 for unlimited (not recommended). Declaration public int WorldPedSoftLimit { get; set; } Property Value Type Description Int32 WorldVehicleSoftLimit The game won't spawn more NPC traffic if the limit is exceeded. -1 for unlimited (not recommended). Declaration public int WorldVehicleSoftLimit { get; set; } Property Value Type Description Int32" + "keywords": "Class Settings Don't use it! Inheritance Object Settings Inherited Members Object.ToString() Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : RageCoop.Client Assembly : RageCoop.Client.dll Syntax public class Settings Fields LogLevel LogLevel for RageCoop. 0:Trace, 1:Debug, 2:Info, 3:Warning, 4:Error Declaration public int LogLevel Field Value Type Description Int32 Properties DisableAlternatePause Bring up pause menu but don't freeze time when FrontEndPauseAlternate(Esc) is pressed. Declaration public bool DisableAlternatePause { get; set; } Property Value Type Description Boolean DisableTraffic Disable world NPC traffic, mission entities won't be affected Declaration public bool DisableTraffic { get; set; } Property Value Type Description Boolean FlipMenu Don't use it! Declaration public bool FlipMenu { get; set; } Property Value Type Description Boolean LastServerAddress Don't use it! Declaration public string LastServerAddress { get; set; } Property Value Type Description String MasterServer Don't use it! Declaration public string MasterServer { get; set; } Property Value Type Description String MenuKey The key to open menu Declaration public Keys MenuKey { get; set; } Property Value Type Description Keys PassengerKey The key to enter a vehicle as passenger. Declaration public Keys PassengerKey { get; set; } Property Value Type Description Keys Password The password used to authenticate when connecting to a server. Declaration public string Password { get; set; } Property Value Type Description String ResourceDirectory The directory where resources downloaded from server will be placed. Declaration public string ResourceDirectory { get; set; } Property Value Type Description String Username Don't use it! Declaration public string Username { get; set; } Property Value Type Description String WorldPedSoftLimit The game won't spawn more NPC traffic if the limit is exceeded. -1 for unlimited (not recommended). Declaration public int WorldPedSoftLimit { get; set; } Property Value Type Description Int32 WorldVehicleSoftLimit The game won't spawn more NPC traffic if the limit is exceeded. -1 for unlimited (not recommended). Declaration public int WorldVehicleSoftLimit { get; set; } Property Value Type Description Int32" }, "api/RageCoop.Client.SyncedEntity.html": { "href": "api/RageCoop.Client.SyncedEntity.html", @@ -117,12 +117,12 @@ "api/RageCoop.Server.Client.html": { "href": "api/RageCoop.Server.Client.html", "title": "Class Client | RageCoop resource documentation", - "keywords": "Class Client Represent a player connected to this server. Inheritance Object Client Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : RageCoop.Server Assembly : RageCoop.Server.dll Syntax public class Client Properties Config The client's configuration Declaration public PlayerConfig Config { get; set; } Property Value Type Description PlayerConfig EndPoint Th client's IP address and port. Declaration public IPEndPoint EndPoint { get; } Property Value Type Description IPEndPoint IsReady Indicates whether the client has succefully loaded all resources. Declaration public bool IsReady { get; } Property Value Type Description Boolean Latency The client's latncy in seconds. Declaration public float Latency { get; } Property Value Type Description Single Player The ServerPed instance representing the client's main character. Declaration public ServerPed Player { get; } Property Value Type Description ServerPed Username Declaration public string Username { get; } Property Value Type Description String Methods Kick(String) Kick this client Declaration public void Kick(string reason = \"You have been kicked!\") Parameters Type Name Description String reason Kick(String[]) Kick this client Declaration public void Kick(params string[] reasons) Parameters Type Name Description String [] reasons Reasons to kick SendChatMessage(String, String) Send a chat messsage to this client, not visible to others. Declaration public void SendChatMessage(string message, string from = \"Server\") Parameters Type Name Description String message String from SendCustomEvent(Int32, List) Trigger a CustomEvent for this client Declaration public void SendCustomEvent(int hash, List args) Parameters Type Name Description Int32 hash An unique identifier of the event, you can use Hash(String) to get it from a string List < Object > args SendNativeCall(Hash, Object[]) Send a native call to client and ignore it's response. Declaration public void SendNativeCall(Hash hash, params object[] args) Parameters Type Name Description GTA.Native.Hash hash Object [] args SendNativeCall(Action, Hash, Object[]) Send a native call to client and do a callback when the response received. Declaration public void SendNativeCall(Action callBack, Hash hash, params object[] args) Parameters Type Name Description Action < Object > callBack GTA.Native.Hash hash Object [] args Type Parameters Name Description T Type of the response" + "keywords": "Class Client Represent a player connected to this server. Inheritance Object Client Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : RageCoop.Server Assembly : RageCoop.Server.dll Syntax public class Client Properties Config The client's configuration Declaration public PlayerConfig Config { get; set; } Property Value Type Description PlayerConfig EndPoint Th client's IP address and port. Declaration public IPEndPoint EndPoint { get; } Property Value Type Description IPEndPoint IsReady Indicates whether the client has succefully loaded all resources. Declaration public bool IsReady { get; } Property Value Type Description Boolean Latency The client's latency in seconds. Declaration public float Latency { get; } Property Value Type Description Single Player The ServerPed instance representing the client's main character. Declaration public ServerPed Player { get; } Property Value Type Description ServerPed Username Declaration public string Username { get; } Property Value Type Description String Methods Kick(String) Kick this client Declaration public void Kick(string reason = \"You have been kicked!\") Parameters Type Name Description String reason Kick(String[]) Kick this client Declaration public void Kick(params string[] reasons) Parameters Type Name Description String [] reasons Reasons to kick SendChatMessage(String, String) Send a chat messsage to this client, not visible to others. Declaration public void SendChatMessage(string message, string from = \"Server\") Parameters Type Name Description String message String from SendCustomEvent(Int32, List) Trigger a CustomEvent for this client Declaration public void SendCustomEvent(int hash, List args) Parameters Type Name Description Int32 hash An unique identifier of the event, you can use Hash(String) to get it from a string List < Object > args SendCustomEvent(Int32, Object[]) Declaration public void SendCustomEvent(int hash, params object[] args) Parameters Type Name Description Int32 hash Object [] args SendNativeCall(Hash, Object[]) Send a native call to client and ignore it's response. Declaration public void SendNativeCall(Hash hash, params object[] args) Parameters Type Name Description GTA.Native.Hash hash Object [] args SendNativeCall(Action, Hash, Object[]) Send a native call to client and do a callback when the response received. Declaration public void SendNativeCall(Action callBack, Hash hash, params object[] args) Parameters Type Name Description Action < Object > callBack GTA.Native.Hash hash Object [] args Type Parameters Name Description T Type of the response" }, "api/RageCoop.Server.html": { "href": "api/RageCoop.Server.html", "title": "Namespace RageCoop.Server | RageCoop resource documentation", - "keywords": "Namespace RageCoop.Server Classes Client Represent a player connected to this server. PlayerConfig Server The instantiable RageCoop server class ServerPed Represents a ped from a client ServerSettings Settings for RageCoop Server" + "keywords": "Namespace RageCoop.Server Classes Client Represent a player connected to this server. PlayerConfig Server The instantiable RageCoop server class ServerEntities Manipulate entities from the server ServerObject Represents an object owned by server. ServerPed Represents a ped from a client ServerSettings Settings for RageCoop Server ServerVehicle Represents a vehicle from a client" }, "api/RageCoop.Server.PlayerConfig.html": { "href": "api/RageCoop.Server.PlayerConfig.html", @@ -132,12 +132,7 @@ "api/RageCoop.Server.Scripting.API.html": { "href": "api/RageCoop.Server.Scripting.API.html", "title": "Class API | RageCoop resource documentation", - "keywords": "Class API An class that can be used to interact with RageCoop server. Inheritance Object API Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : RageCoop.Server.Scripting Assembly : RageCoop.Server.dll Syntax public class API Fields Events Server side events Declaration public readonly APIEvents Events Field Value Type Description APIEvents Properties Logger Get a Logger that the server is currently using, you should use Logger to display resource-specific information. Declaration public Logger Logger { get; } Property Value Type Description Logger Methods GetAllClients() Get a list of all Clients Declaration public Dictionary GetAllClients() Returns Type Description Dictionary < Int64 , Client > All clients as a dictionary indexed by NetID GetClientByUsername(String) Get the client by its username Declaration public Client GetClientByUsername(string username) Parameters Type Name Description String username The username to search for (non case-sensitive) Returns Type Description Client The Client from this user or null RegisterCommand(String, Action) Register a new command chat command (Example: \"/test\") Declaration public void RegisterCommand(string name, Action callback) Parameters Type Name Description String name The name of the command (Example: \"test\" for \"/test\") Action < CommandContext > callback Create a new function! RegisterCommand(String, String, Int16, Action) Send CleanUpWorld to all players to delete all objects created by the server Declaration public void RegisterCommand(string name, string usage, short argsLength, Action callback) Parameters Type Name Description String name The name of the command (Example: \"test\" for \"/test\") String usage How to use this message (argsLength required!) Int16 argsLength The length of args (Example: \"/message USERNAME MESSAGE\" = 2) (usage required!) Action < CommandContext > callback Create a new function! RegisterCommands(Object) Register all commands inside an class instance Declaration public void RegisterCommands(object obj) Parameters Type Name Description Object obj The instance of type containing the commands RegisterCommands() Register all commands in a static class Declaration public void RegisterCommands() Type Parameters Name Description T Your static class with commands RegisterCustomEventHandler(Int32, Action) Register an handler to the specifed event hash, one event can have multiple handlers. Declaration public void RegisterCustomEventHandler(int hash, Action handler) Parameters Type Name Description Int32 hash An unique identifier of the event, you can hash your event name with Hash(String) Action < CustomEventReceivedArgs > handler An handler to be invoked when the event is received from the server. This will be invoked from main thread. RegisterCustomEventHandler(String, Action) Register an event handler for specified event name. Declaration public void RegisterCustomEventHandler(string name, Action handler) Parameters Type Name Description String name This value will be hashed to an int to reduce overhead Action < CustomEventReceivedArgs > handler The handler to be invoked when the event is received SendChatMessage(String, List, String) Send a chat message to all players, use SendChatMessage(String, String) to send to an individual client. Declaration public void SendChatMessage(string message, List targets = null, string username = \"Server\") Parameters Type Name Description String message The chat message List < Client > targets The clients to send message, leave it null to send to all clients String username The username which send this message (default = \"Server\") SendCustomEvent(Int32, List, List) Send an event and data to the specified clients. Use SendCustomEvent(Int32, List) if you want to send event to individual client. Declaration public void SendCustomEvent(int eventHash, List args = null, List targets = null) Parameters Type Name Description Int32 eventHash An unique identifier of the event, you can use Hash(String) to get it from a string List < Object > args The objects conataing your data, supported types: byte, short, ushort, int, uint, long, ulong, float, bool, string. List < Client > targets The target clients to send. Leave it null to send to all clients SendCustomEvent(String, List, List) Send an event and data to the specified clients. Use SendCustomEvent(Int32, List) if you want to send event to individual client. Declaration public void SendCustomEvent(string name, List args = null, List targets = null) Parameters Type Name Description String name The name of the event, will be hashed to an int. For optimal performence, you should hash it in a static contructor inside the shared library, then call SendCustomEvent(Int32, List, List) . List < Object > args The objects conataing your data, supported types: byte, short, ushort, int, uint, long, ulong, float, bool, string. List < Client > targets The target clients to send. Leave it null to send to all clients" - }, - "api/RageCoop.Server.Scripting.APIEvents.html": { - "href": "api/RageCoop.Server.Scripting.APIEvents.html", - "title": "Class APIEvents | RageCoop resource documentation", - "keywords": "Class APIEvents Inheritance Object APIEvents Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : RageCoop.Server.Scripting Assembly : RageCoop.Server.dll Syntax public class APIEvents Events OnChatMessage Invoked when a chat message is received. Declaration public event EventHandler OnChatMessage Event Type Type Description EventHandler < ChatEventArgs > OnCommandReceived Will be invoked from main thread before registered handlers Declaration public event EventHandler OnCommandReceived Event Type Type Description EventHandler < OnCommandEventArgs > OnPlayerConnected Will be invoked when a player is connected, but this player might not be ready yet(client resources not loaded), using OnPlayerReady is recommended. Declaration public event EventHandler OnPlayerConnected Event Type Type Description EventHandler < Client > OnPlayerDisconnected Invoked when a player disconnected, all method won't be effective in this scope. Declaration public event EventHandler OnPlayerDisconnected Event Type Type Description EventHandler < Client > OnPlayerHandshake Will be invoked from main thread when a client is attempting to connect, use Deny(String) to deny the connection request. Declaration public event EventHandler OnPlayerHandshake Event Type Type Description EventHandler < HandshakeEventArgs > OnPlayerReady Will be invoked after the client connected and all resources(if any) have been loaded. Declaration public event EventHandler OnPlayerReady Event Type Type Description EventHandler < Client > OnPlayerUpdate Invoked everytime a player's main ped has been updated Declaration public event EventHandler OnPlayerUpdate Event Type Type Description EventHandler < Client >" + "keywords": "Class API An class that can be used to interact with RageCoop server. Inheritance Object API Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : RageCoop.Server.Scripting Assembly : RageCoop.Server.dll Syntax public class API Fields Events Server side events Declaration public readonly ServerEvents Events Field Value Type Description ServerEvents Properties Entities All synchronized entities on this server. Declaration public ServerEntities Entities { get; } Property Value Type Description ServerEntities Logger Get a Logger that the server is currently using, you should use Logger to display resource-specific information. Declaration public Logger Logger { get; } Property Value Type Description Logger Methods GetAllClients() Get a list of all Clients Declaration public Dictionary GetAllClients() Returns Type Description Dictionary < Int64 , Client > All clients as a dictionary indexed by NetID GetClientByUsername(String) Get the client by its username Declaration public Client GetClientByUsername(string username) Parameters Type Name Description String username The username to search for (non case-sensitive) Returns Type Description Client The Client from this user or null RegisterCommand(String, Action) Register a new command chat command (Example: \"/test\") Declaration public void RegisterCommand(string name, Action callback) Parameters Type Name Description String name The name of the command (Example: \"test\" for \"/test\") Action < CommandContext > callback Create a new function! RegisterCommand(String, String, Int16, Action) Send CleanUpWorld to all players to delete all objects created by the server Declaration public void RegisterCommand(string name, string usage, short argsLength, Action callback) Parameters Type Name Description String name The name of the command (Example: \"test\" for \"/test\") String usage How to use this message (argsLength required!) Int16 argsLength The length of args (Example: \"/message USERNAME MESSAGE\" = 2) (usage required!) Action < CommandContext > callback Create a new function! RegisterCommands(Object) Register all commands inside an class instance Declaration public void RegisterCommands(object obj) Parameters Type Name Description Object obj The instance of type containing the commands RegisterCommands() Register all commands in a static class Declaration public void RegisterCommands() Type Parameters Name Description T Your static class with commands RegisterCustomEventHandler(Int32, Action) Register an handler to the specifed event hash, one event can have multiple handlers. Declaration public void RegisterCustomEventHandler(int hash, Action handler) Parameters Type Name Description Int32 hash An unique identifier of the event, you can hash your event name with Hash(String) Action < CustomEventReceivedArgs > handler An handler to be invoked when the event is received from the server. This will be invoked from main thread. RegisterCustomEventHandler(String, Action) Register an event handler for specified event name. Declaration public void RegisterCustomEventHandler(string name, Action handler) Parameters Type Name Description String name This value will be hashed to an int to reduce overhead Action < CustomEventReceivedArgs > handler The handler to be invoked when the event is received SendChatMessage(String, List, String) Send a chat message to all players, use SendChatMessage(String, String) to send to an individual client. Declaration public void SendChatMessage(string message, List targets = null, string username = \"Server\") Parameters Type Name Description String message The chat message List < Client > targets The clients to send message, leave it null to send to all clients String username The username which send this message (default = \"Server\") SendCustomEvent(Int32, List, List) Send an event and data to the specified clients. Use SendCustomEvent(Int32, List) if you want to send event to individual client. Declaration public void SendCustomEvent(int eventHash, List args = null, List targets = null) Parameters Type Name Description Int32 eventHash An unique identifier of the event, you can use Hash(String) to get it from a string List < Object > args The objects conataing your data, supported types: byte, short, ushort, int, uint, long, ulong, float, bool, string. List < Client > targets The target clients to send. Leave it null to send to all clients SendCustomEvent(String, List, List) Send an event and data to the specified clients. Use SendCustomEvent(Int32, List) if you want to send event to individual client. Declaration public void SendCustomEvent(string name, List args = null, List targets = null) Parameters Type Name Description String name The name of the event, will be hashed to an int. For optimal performence, you should hash it in a static contructor inside the shared library, then call SendCustomEvent(Int32, List, List) . List < Object > args The objects conataing your data, supported types: byte, short, ushort, int, uint, long, ulong, float, bool, string. List < Client > targets The target clients to send. Leave it null to send to all clients" }, "api/RageCoop.Server.Scripting.ChatEventArgs.html": { "href": "api/RageCoop.Server.Scripting.ChatEventArgs.html", @@ -167,13 +162,18 @@ "api/RageCoop.Server.Scripting.html": { "href": "api/RageCoop.Server.Scripting.html", "title": "Namespace RageCoop.Server.Scripting | RageCoop resource documentation", - "keywords": "Namespace RageCoop.Server.Scripting Classes API An class that can be used to interact with RageCoop server. APIEvents ChatEventArgs Command Decorate your method with this attribute and use RegisterCommands() or RegisterCommands(Object) to register commands. CommandContext The context containg command information. CustomEventReceivedArgs HandshakeEventArgs OnCommandEventArgs ServerResource A class representing a server side resource, each resource is isolated from another and will be started alongside the server. 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." + "keywords": "Namespace RageCoop.Server.Scripting Classes API An class that can be used to interact with RageCoop server. ChatEventArgs Command Decorate your method with this attribute and use RegisterCommands() or RegisterCommands(Object) to register commands. CommandContext The context containg command information. CustomEventReceivedArgs HandshakeEventArgs OnCommandEventArgs ServerEvents ServerResource A class representing a server side resource, each resource is isolated from another and will be started alongside the server. 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." }, "api/RageCoop.Server.Scripting.OnCommandEventArgs.html": { "href": "api/RageCoop.Server.Scripting.OnCommandEventArgs.html", "title": "Class OnCommandEventArgs | RageCoop resource documentation", "keywords": "Class OnCommandEventArgs Inheritance Object EventArgs OnCommandEventArgs Inherited Members EventArgs.Empty Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : RageCoop.Server.Scripting Assembly : RageCoop.Server.dll Syntax public class OnCommandEventArgs : EventArgs Properties Args Arguments Declaration public string[] Args { get; set; } Property Value Type Description String [] Cancel If this value was set to true, corresponding handler registered with RegisterCommand(String, Action) will not be invoked. Declaration public bool Cancel { get; set; } Property Value Type Description Boolean Name The name of executed command Declaration public string Name { get; set; } Property Value Type Description String Sender The Client that executed this command. Declaration public Client Sender { get; set; } Property Value Type Description Client" }, + "api/RageCoop.Server.Scripting.ServerEvents.html": { + "href": "api/RageCoop.Server.Scripting.ServerEvents.html", + "title": "Class ServerEvents | RageCoop resource documentation", + "keywords": "Class ServerEvents Inheritance Object ServerEvents Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : RageCoop.Server.Scripting Assembly : RageCoop.Server.dll Syntax public class ServerEvents Events OnChatMessage Invoked when a chat message is received. Declaration public event EventHandler OnChatMessage Event Type Type Description EventHandler < ChatEventArgs > OnCommandReceived Will be invoked from main thread before registered handlers Declaration public event EventHandler OnCommandReceived Event Type Type Description EventHandler < OnCommandEventArgs > OnPlayerConnected Will be invoked when a player is connected, but this player might not be ready yet(client resources not loaded), using OnPlayerReady is recommended. Declaration public event EventHandler OnPlayerConnected Event Type Type Description EventHandler < Client > OnPlayerDisconnected Invoked when a player disconnected, all method won't be effective in this scope. Declaration public event EventHandler OnPlayerDisconnected Event Type Type Description EventHandler < Client > OnPlayerHandshake Will be invoked from main thread when a client is attempting to connect, use Deny(String) to deny the connection request. Declaration public event EventHandler OnPlayerHandshake Event Type Type Description EventHandler < HandshakeEventArgs > OnPlayerReady Will be invoked after the client connected and all resources(if any) have been loaded. Declaration public event EventHandler OnPlayerReady Event Type Type Description EventHandler < Client > OnPlayerUpdate Invoked everytime a player's main ped has been updated Declaration public event EventHandler OnPlayerUpdate Event Type Type Description EventHandler < Client >" + }, "api/RageCoop.Server.Scripting.ServerResource.html": { "href": "api/RageCoop.Server.Scripting.ServerResource.html", "title": "Class ServerResource | RageCoop resource documentation", @@ -182,27 +182,42 @@ "api/RageCoop.Server.Scripting.ServerScript.html": { "href": "api/RageCoop.Server.Scripting.ServerScript.html", "title": "Class ServerScript | RageCoop resource documentation", - "keywords": "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. Inheritance Object ServerScript Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() 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()" + "keywords": "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. Inheritance Object ServerScript Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() 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 this script belongs to, this property won't be initiated before OnStart() . 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()" }, "api/RageCoop.Server.Server.html": { "href": "api/RageCoop.Server.Server.html", "title": "Class Server | RageCoop resource documentation", "keywords": "Class Server The instantiable RageCoop server class Inheritance Object Server Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : RageCoop.Server Assembly : RageCoop.Server.dll Syntax public class Server Constructors Server(ServerSettings, Logger) Instantiate a server. Declaration public Server(ServerSettings settings, Logger logger = null) Parameters Type Name Description ServerSettings settings Logger logger Exceptions Type Condition ArgumentNullException Properties API The API for controlling server and hooking events. Declaration public API API { get; } Property Value Type Description API Methods Start() Spawn threads and start the server Declaration public void Start() Stop() Terminate threads and stop the server Declaration public void Stop()" }, + "api/RageCoop.Server.ServerEntities.html": { + "href": "api/RageCoop.Server.ServerEntities.html", + "title": "Class ServerEntities | RageCoop resource documentation", + "keywords": "Class ServerEntities Manipulate entities from the server Inheritance Object ServerEntities Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : RageCoop.Server Assembly : RageCoop.Server.dll Syntax public class ServerEntities Methods GetAllObjects() Get all static objects owned by server Declaration public ServerObject[] GetAllObjects() Returns Type Description ServerObject [] GetAllPeds() Get all peds on this server Declaration public ServerPed[] GetAllPeds() Returns Type Description ServerPed [] GetAllVehicle() Get all vehicles on this server Declaration public ServerVehicle[] GetAllVehicle() Returns Type Description ServerVehicle []" + }, + "api/RageCoop.Server.ServerObject.html": { + "href": "api/RageCoop.Server.ServerObject.html", + "title": "Class ServerObject | RageCoop resource documentation", + "keywords": "Class ServerObject Represents an object owned by server. Inheritance Object ServerObject Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : RageCoop.Server Assembly : RageCoop.Server.dll Syntax public class ServerObject Properties IsInvincible Whether this object is invincible Declaration public bool IsInvincible { get; set; } Property Value Type Description Boolean Model The object's model Declaration public Model Model { get; } Property Value Type Description GTA.Model Position Gets or sets this object's position Declaration public Vector3 Position { get; set; } Property Value Type Description GTA.Math.Vector3 Quaternion Gets or sets this object's quaternion Declaration public Quaternion Quaternion { get; set; } Property Value Type Description GTA.Math.Quaternion" + }, "api/RageCoop.Server.ServerPed.html": { "href": "api/RageCoop.Server.ServerPed.html", "title": "Class ServerPed | RageCoop resource documentation", - "keywords": "Class ServerPed Represents a ped from a client Inheritance Object ServerPed Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : RageCoop.Server Assembly : RageCoop.Server.dll Syntax public class ServerPed Properties Health Health Declaration public int Health { get; } Property Value Type Description Int32 ID The ped's ID (not handle!). Declaration public int ID { get; } Property Value Type Description Int32 Owner The Client that is responsible synchronizing for this ped. Declaration public Client Owner { get; } Property Value Type Description Client Position Position of this ped Declaration public Vector3 Position { get; } Property Value Type Description GTA.Math.Vector3 VehicleID The ID of the ped's last vehicle. Declaration public int VehicleID { get; } Property Value Type Description Int32" + "keywords": "Class ServerPed Represents a ped from a client Inheritance Object ServerPed Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : RageCoop.Server Assembly : RageCoop.Server.dll Syntax public class ServerPed Properties Health Health Declaration public int Health { get; } Property Value Type Description Int32 ID The ped's network ID (not handle!). Declaration public int ID { get; } Property Value Type Description Int32 IsPlayer Whether this ped is a player. Declaration public bool IsPlayer { get; } Property Value Type Description Boolean LastVehicle The ped's last vehicle. Declaration public ServerVehicle LastVehicle { get; } Property Value Type Description ServerVehicle Owner The Client that is responsible synchronizing for this ped. Declaration public Client Owner { get; } Property Value Type Description Client Position Position of this ped Declaration public Vector3 Position { get; } Property Value Type Description GTA.Math.Vector3 Rotation Gets or sets this ped's rotation Declaration public Vector3 Rotation { get; } Property Value Type Description GTA.Math.Vector3" }, "api/RageCoop.Server.ServerSettings.html": { "href": "api/RageCoop.Server.ServerSettings.html", "title": "Class ServerSettings | RageCoop resource documentation", - "keywords": "Class ServerSettings Settings for RageCoop Server Inheritance Object ServerSettings Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : RageCoop.Server Assembly : RageCoop.Server.dll Syntax public class ServerSettings Fields LogLevel See LogLevel . Declaration public int LogLevel Field Value Type Description Int32 Properties AnnounceSelf Whether or not to announce this server so that it'll appear on server list. Declaration public bool AnnounceSelf { get; set; } Property Value Type Description Boolean MasterServer Master server address, mostly doesn't to be changed. Declaration public string MasterServer { get; set; } Property Value Type Description String MaxLatency Maximum latency allowed for a client, a client will be kicked if it's latency it's higher than this value Declaration public int MaxLatency { get; set; } Property Value Type Description Int32 MaxPlayers Maximum number of players on this server Declaration public int MaxPlayers { get; set; } Property Value Type Description Int32 Name The server name to be shown on master server Declaration public string Name { get; set; } Property Value Type Description String NpcStreamingDistance NPC data won't be sent to a player if their distance is greater than this value. -1 for unlimited. Declaration public float NpcStreamingDistance { get; set; } Property Value Type Description Single PlayerStreamingDistance Player's data won't be sent to another player if their distance is greater than this value. -1 for unlimited. Declaration public float PlayerStreamingDistance { get; set; } Property Value Type Description Single Port Port to listen for incoming connections Declaration public int Port { get; set; } Property Value Type Description Int32 WelcomeMessage The message to send when a client connected (not visible to others) Declaration public string WelcomeMessage { get; set; } Property Value Type Description String" + "keywords": "Class ServerSettings Settings for RageCoop Server Inheritance Object ServerSettings Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : RageCoop.Server Assembly : RageCoop.Server.dll Syntax public class ServerSettings Properties AnnounceSelf Whether or not to announce this server so it'll appear on server list. Declaration public bool AnnounceSelf { get; set; } Property Value Type Description Boolean LogLevel See LogLevel . Declaration public int LogLevel { get; set; } Property Value Type Description Int32 MasterServer Master server address, mostly doesn't need to be changed. Declaration public string MasterServer { get; set; } Property Value Type Description String MaxLatency Maximum latency allowed for a client, a client will be kicked if it's latency it's higher than this value Declaration public int MaxLatency { get; set; } Property Value Type Description Int32 MaxPlayers Maximum number of players on this server Declaration public int MaxPlayers { get; set; } Property Value Type Description Int32 Name The server name to be shown on master server Declaration public string Name { get; set; } Property Value Type Description String NpcStreamingDistance NPC data won't be sent to a player if their distance is greater than this value. -1 for unlimited. Declaration public float NpcStreamingDistance { get; set; } Property Value Type Description Single PlayerStreamingDistance Player's data won't be sent to another player if their distance is greater than this value. -1 for unlimited. Declaration public float PlayerStreamingDistance { get; set; } Property Value Type Description Single Port Port to listen for incoming connections Declaration public int Port { get; set; } Property Value Type Description Int32 WelcomeMessage The message to send when a client connected (not visible to others) Declaration public string WelcomeMessage { get; set; } Property Value Type Description String" + }, + "api/RageCoop.Server.ServerVehicle.html": { + "href": "api/RageCoop.Server.ServerVehicle.html", + "title": "Class ServerVehicle | RageCoop resource documentation", + "keywords": "Class ServerVehicle Represents a vehicle from a client Inheritance Object ServerVehicle Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : RageCoop.Server Assembly : RageCoop.Server.dll Syntax public class ServerVehicle Properties ID The vehicle's network ID (not handle!). Declaration public int ID { get; } Property Value Type Description Int32 Owner The Client that is responsible synchronizing for this vehicle. Declaration public Client Owner { get; } Property Value Type Description Client Position Position of this vehicle Declaration public Vector3 Position { get; } Property Value Type Description GTA.Math.Vector3 Quaternion Gets or sets this vehicle's quaternion Declaration public Quaternion Quaternion { get; } Property Value Type Description GTA.Math.Quaternion" }, "index.html": { "href": "index.html", "title": "Getting started | RageCoop resource documentation", - "keywords": "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() and OnStop() : public class MyFirstResource :ServerScript { public override void OnStart() { // Initiate your script here } public override void OnStop() { // Free all resources and perform cleanup } } That's it! Now you can have some fun by using the API instance, please refer to the GiHub for more examples." + "keywords": "Getting started Resources and Scripts A Script stands for class that inherits from RageCoop's script class ( ServerScript and ClientScript ) and will be loaded at runtime, one assembly can have multiple scripts in it. A Resource consists of one or more assemblies and other files. Server-side resource will be loaded at startup and is isolated from other resources, while client-side resource will be sent to each client and loaded after they connected to the server. A Resource can either be in a folder or packed inside a zip archive. Directory structure Below is the server's directory structure ServerRoot │ Settings.xml | RageCoop.Server.exe │ └───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 server, you can then change the server's configuration option by editing it, refer to ServerSettings for detailed description. Server Reource To create a server resource: 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() and OnStop() , your cs file should look like this: using RageCoop.Server.Scripting; namespace NiceGuy.MyFirstResource { public class Main : ServerScript { public override void OnStart() { // Initiate your script here } public override void OnStop() { // Free all resources and perform cleanup } } } Now you can have some fun by using the API instance, please refer to the GitHub repo for more examples. For convenience, you can create a symlink in ServerRoot/Resources/Server/NiceGuy.MyFirstResource targeting your output folder: mklink /d ServerRoot/Resources/Server/NiceGuy.MyFirstResource C:/MyRepos/NiceGuy.MyFirstResource/bin/Debug That's it! Start your server and you should see your resource loading." }, "README.html": { "href": "README.html", diff --git a/docs/manifest.json b/docs/manifest.json index 5937cbb..8357e27 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -1,6 +1,6 @@ { "homepages": [], - "source_base_path": "M:/SandBox-Shared/repo/RageCoop/RageCoop-V", + "source_base_path": "M:/SandBox-Shared/repos/RageCoop/RageCoop-V", "xrefmap": "xrefmap.yml", "files": [ { @@ -33,19 +33,7 @@ "output": { ".html": { "relative_path": "index.html", - "hash": "xZtR9mnh2bw9nXr6zDQZUznPJ6l0uDhL2mvGT2zIDr8=" - } - }, - "is_incremental": false, - "version": "" - }, - { - "type": "ManagedReference", - "source_relative_path": "obj/api/RageCoop.Client.CoopMap.yml", - "output": { - ".html": { - "relative_path": "api/RageCoop.Client.CoopMap.html", - "hash": "ApXbPPfQzicGTsFcFPF6HEmZXemGkbp3ydNM04CvB+s=" + "hash": "YNzCgE7KQWQPTJGSxetitmT6QG/2CXmz/gdmv3cY68s=" } }, "is_incremental": false, @@ -63,6 +51,18 @@ "is_incremental": false, "version": "" }, + { + "type": "ManagedReference", + "source_relative_path": "obj/api/RageCoop.Client.Map.yml", + "output": { + ".html": { + "relative_path": "api/RageCoop.Client.Map.html", + "hash": "VmVDHWaovZQd41aDgeZZHqZhsu5U4J13K5UwCCsoatM=" + } + }, + "is_incremental": false, + "version": "" + }, { "type": "ManagedReference", "source_relative_path": "obj/api/RageCoop.Client.Scripting.API.Config.yml", @@ -117,7 +117,7 @@ "output": { ".html": { "relative_path": "api/RageCoop.Client.Scripting.API.html", - "hash": "3vouttdhPT7hJ5jKvppmWkEG3dojHlSziwmO9fnUiM4=" + "hash": "Ia+Sh3EBdepmbfJ+BGpzSBf6eKuA/n+d3gtuuWbWeFA=" } }, "is_incremental": false, @@ -141,7 +141,7 @@ "output": { ".html": { "relative_path": "api/RageCoop.Client.Scripting.ClientScript.html", - "hash": "b2p0FPsloqCjtvFEWfrPJOxhHTcvSb+0B8kV+eUg71k=" + "hash": "N73yvdl0ubXKOzOi/yGMNG8u9t/xqzSSN4Jpkk81agE=" } }, "is_incremental": false, @@ -177,7 +177,7 @@ "output": { ".html": { "relative_path": "api/RageCoop.Client.Settings.html", - "hash": "+DDL1PelcoobBpmcXlRvNn69CsFwyaS8UQ6ph9IveAg=" + "hash": "3znLfYhDtMnMnZtwPrZycmfJVDL6PlVBhAfiTgwPFBs=" } }, "is_incremental": false, @@ -237,7 +237,7 @@ "output": { ".html": { "relative_path": "api/RageCoop.Client.html", - "hash": "gG3KIry12mcDBVYt/bMSz1mU6aK9YAP8zUcUX/b4A8M=" + "hash": "AMbF0zXRFnYwdn7WO+/SVe8eooUeMTjR7ozZOxHWzGY=" } }, "is_incremental": false, @@ -321,7 +321,7 @@ "output": { ".html": { "relative_path": "api/RageCoop.Server.Client.html", - "hash": "196mRFYrl2PSnrnVby5qjIdrrrlopjCBf0x/3qMl1kU=" + "hash": "69W19KalHDH5dGJ/uCGVW3nIdmJxPVejA1JQaH5S65A=" } }, "is_incremental": false, @@ -345,19 +345,7 @@ "output": { ".html": { "relative_path": "api/RageCoop.Server.Scripting.API.html", - "hash": "pgIuWA6eyQjIZ84xMQVdEUXSkzOBV/iAfqFi6xQr2G4=" - } - }, - "is_incremental": false, - "version": "" - }, - { - "type": "ManagedReference", - "source_relative_path": "obj/api/RageCoop.Server.Scripting.APIEvents.yml", - "output": { - ".html": { - "relative_path": "api/RageCoop.Server.Scripting.APIEvents.html", - "hash": "/w/hZPH71+WPX9ha03bYmXAvWIwPiw0eeKxx5quz3Ws=" + "hash": "VDClnRrNQDeUyHDlLMKHr1LRqviN0OCHiKxmJuc8fkc=" } }, "is_incremental": false, @@ -435,6 +423,18 @@ "is_incremental": false, "version": "" }, + { + "type": "ManagedReference", + "source_relative_path": "obj/api/RageCoop.Server.Scripting.ServerEvents.yml", + "output": { + ".html": { + "relative_path": "api/RageCoop.Server.Scripting.ServerEvents.html", + "hash": "McBcrN54pUHpjR12BklFgPOqhS0UCxwUKsCuZrBsiKc=" + } + }, + "is_incremental": false, + "version": "" + }, { "type": "ManagedReference", "source_relative_path": "obj/api/RageCoop.Server.Scripting.ServerResource.yml", @@ -453,7 +453,7 @@ "output": { ".html": { "relative_path": "api/RageCoop.Server.Scripting.ServerScript.html", - "hash": "gjH0sBJQgfR49Fh+jkE1VXfpfPd5CpggXRHIQTeLnWM=" + "hash": "+WOGIL+kUdq0OA8WfW5ubzm1kDIizPbNhx36uRXjp0o=" } }, "is_incremental": false, @@ -465,7 +465,7 @@ "output": { ".html": { "relative_path": "api/RageCoop.Server.Scripting.html", - "hash": "0t5785EMzOpUn5q6LcuTvzgM2DgsQkOApYC6+Q9EXjc=" + "hash": "/3wLFw/xx/dj3jj3zSpwT247r5JmANndoC59C1G8mWQ=" } }, "is_incremental": false, @@ -483,13 +483,37 @@ "is_incremental": false, "version": "" }, + { + "type": "ManagedReference", + "source_relative_path": "obj/api/RageCoop.Server.ServerEntities.yml", + "output": { + ".html": { + "relative_path": "api/RageCoop.Server.ServerEntities.html", + "hash": "Y0OE2h706GJqCO4MWB1ZSpXNbng2uwUQ8n2pOwz1Hac=" + } + }, + "is_incremental": false, + "version": "" + }, + { + "type": "ManagedReference", + "source_relative_path": "obj/api/RageCoop.Server.ServerObject.yml", + "output": { + ".html": { + "relative_path": "api/RageCoop.Server.ServerObject.html", + "hash": "e2YLbgW8WsDPmuFRhZFOX2W2E972c5oy8okqkXf0uMI=" + } + }, + "is_incremental": false, + "version": "" + }, { "type": "ManagedReference", "source_relative_path": "obj/api/RageCoop.Server.ServerPed.yml", "output": { ".html": { "relative_path": "api/RageCoop.Server.ServerPed.html", - "hash": "QeEVh7ONgnzYiRLO8nBD5N/qNV89xcJHzHE8lqRM/q0=" + "hash": "Nj4jArT3JTMihW4fsosizupSemIk3p3U806nMWfUQKE=" } }, "is_incremental": false, @@ -501,7 +525,19 @@ "output": { ".html": { "relative_path": "api/RageCoop.Server.ServerSettings.html", - "hash": "R4Q73a2azCJPZ6JGoHGeKudN/ksOzSk8sOfat1ia/+k=" + "hash": "yDhZzdsJSauJbRUBMYqLcfGt1q1YyV5M41B/zNgW8gI=" + } + }, + "is_incremental": false, + "version": "" + }, + { + "type": "ManagedReference", + "source_relative_path": "obj/api/RageCoop.Server.ServerVehicle.yml", + "output": { + ".html": { + "relative_path": "api/RageCoop.Server.ServerVehicle.html", + "hash": "v+94Bus0VzLvu3LXRRUx3HSt21BQcJolGX9nm8FNmyw=" } }, "is_incremental": false, @@ -513,7 +549,7 @@ "output": { ".html": { "relative_path": "api/RageCoop.Server.html", - "hash": "LOSxQJbWgnvBUXDpxsvtof4nr9PvqiA5Fi3Z29HBFKs=" + "hash": "mj01hIwqBkW53XAh3EZsurEbCjFajYL1wYvdrdH0nEY=" } }, "is_incremental": false, @@ -525,7 +561,7 @@ "output": { ".html": { "relative_path": "api/toc.html", - "hash": "PW61lPyS75NuahuDi8YLyx3EyYb0nvxJL/aewak5Sis=" + "hash": "1JzSLOBQvWb4NM8OEoZv8OWAEzpFNGdYv+HJaX0XXBI=" } }, "is_incremental": false, @@ -540,7 +576,7 @@ "output": { ".html": { "relative_path": "toc.html", - "hash": "35U2H1EoDwqwkPz5UkLpx+SDxUt7yJCtoyC7zmUYWcw=" + "hash": "IZVcaCvkW13AieUzohB67bBaEFumWzbslZp8aqQdEc8=" } }, "is_incremental": false, @@ -550,23 +586,25 @@ "incremental_info": [ { "status": { - "can_incremental": true, + "can_incremental": false, + "details": "Cannot build incrementally because last build info is missing.", "incrementalPhase": "build", "total_file_count": 0, - "skipped_file_count": 0 + "skipped_file_count": 0, + "full_build_reason_code": "NoAvailableBuildCache" }, "processors": { "ConceptualDocumentProcessor": { - "can_incremental": true, + "can_incremental": false, "incrementalPhase": "build", "total_file_count": 2, - "skipped_file_count": 1 + "skipped_file_count": 0 }, "ManagedReferenceDocumentProcessor": { - "can_incremental": true, + "can_incremental": false, "incrementalPhase": "build", - "total_file_count": 40, - "skipped_file_count": 34 + "total_file_count": 43, + "skipped_file_count": 0 }, "TocDocumentProcessor": { "can_incremental": false, diff --git a/docs/toc.html b/docs/toc.html index cd422f1..b03857a 100644 --- a/docs/toc.html +++ b/docs/toc.html @@ -19,7 +19,7 @@ About
        • - API Documentation + API Documentation
        • diff --git a/docs/xrefmap.yml b/docs/xrefmap.yml index 3715c47..cee6d80 100644 --- a/docs/xrefmap.yml +++ b/docs/xrefmap.yml @@ -7,25 +7,6 @@ references: commentId: N:RageCoop.Client fullName: RageCoop.Client nameWithType: RageCoop.Client -- uid: RageCoop.Client.CoopMap - name: CoopMap - href: api/RageCoop.Client.CoopMap.html - commentId: T:RageCoop.Client.CoopMap - fullName: RageCoop.Client.CoopMap - nameWithType: CoopMap -- uid: RageCoop.Client.CoopMap.Props - name: Props - href: api/RageCoop.Client.CoopMap.html#RageCoop_Client_CoopMap_Props - commentId: P:RageCoop.Client.CoopMap.Props - fullName: RageCoop.Client.CoopMap.Props - nameWithType: CoopMap.Props -- uid: RageCoop.Client.CoopMap.Props* - name: Props - href: api/RageCoop.Client.CoopMap.html#RageCoop_Client_CoopMap_Props_ - commentId: Overload:RageCoop.Client.CoopMap.Props - isSpec: "True" - fullName: RageCoop.Client.CoopMap.Props - nameWithType: CoopMap.Props - uid: RageCoop.Client.CoopProp name: CoopProp href: api/RageCoop.Client.CoopProp.html @@ -97,6 +78,25 @@ references: isSpec: "True" fullName: RageCoop.Client.CoopProp.Texture nameWithType: CoopProp.Texture +- uid: RageCoop.Client.Map + name: Map + href: api/RageCoop.Client.Map.html + commentId: T:RageCoop.Client.Map + fullName: RageCoop.Client.Map + nameWithType: Map +- uid: RageCoop.Client.Map.Props + name: Props + href: api/RageCoop.Client.Map.html#RageCoop_Client_Map_Props + commentId: P:RageCoop.Client.Map.Props + fullName: RageCoop.Client.Map.Props + nameWithType: Map.Props +- uid: RageCoop.Client.Map.Props* + name: Props + href: api/RageCoop.Client.Map.html#RageCoop_Client_Map_Props_ + commentId: Overload:RageCoop.Client.Map.Props + isSpec: "True" + fullName: RageCoop.Client.Map.Props + nameWithType: Map.Props - uid: RageCoop.Client.Scripting name: RageCoop.Client.Scripting href: api/RageCoop.Client.Scripting.html @@ -221,19 +221,6 @@ references: commentId: E:RageCoop.Client.Scripting.API.Events.OnVehicleSpawned fullName: RageCoop.Client.Scripting.API.Events.OnVehicleSpawned nameWithType: API.Events.OnVehicleSpawned -- uid: RageCoop.Client.Scripting.API.GetLogger - name: GetLogger() - href: api/RageCoop.Client.Scripting.API.html#RageCoop_Client_Scripting_API_GetLogger - commentId: M:RageCoop.Client.Scripting.API.GetLogger - fullName: RageCoop.Client.Scripting.API.GetLogger() - nameWithType: API.GetLogger() -- uid: RageCoop.Client.Scripting.API.GetLogger* - name: GetLogger - href: api/RageCoop.Client.Scripting.API.html#RageCoop_Client_Scripting_API_GetLogger_ - commentId: Overload:RageCoop.Client.Scripting.API.GetLogger - isSpec: "True" - fullName: RageCoop.Client.Scripting.API.GetLogger - nameWithType: API.GetLogger - uid: RageCoop.Client.Scripting.API.IsChatFocused name: IsChatFocused href: api/RageCoop.Client.Scripting.API.html#RageCoop_Client_Scripting_API_IsChatFocused @@ -312,6 +299,19 @@ references: isSpec: "True" fullName: RageCoop.Client.Scripting.API.LocalPlayerID nameWithType: API.LocalPlayerID +- uid: RageCoop.Client.Scripting.API.Logger + name: Logger + href: api/RageCoop.Client.Scripting.API.html#RageCoop_Client_Scripting_API_Logger + commentId: P:RageCoop.Client.Scripting.API.Logger + fullName: RageCoop.Client.Scripting.API.Logger + nameWithType: API.Logger +- uid: RageCoop.Client.Scripting.API.Logger* + name: Logger + href: api/RageCoop.Client.Scripting.API.html#RageCoop_Client_Scripting_API_Logger_ + commentId: Overload:RageCoop.Client.Scripting.API.Logger + isSpec: "True" + fullName: RageCoop.Client.Scripting.API.Logger + nameWithType: API.Logger - uid: RageCoop.Client.Scripting.API.QueueAction(System.Action) name: QueueAction(Action) href: api/RageCoop.Client.Scripting.API.html#RageCoop_Client_Scripting_API_QueueAction_System_Action_ @@ -350,6 +350,15 @@ references: fullName.vb: RageCoop.Client.Scripting.API.SendCustomEvent(System.Int32, System.Collections.Generic.List(Of System.Object)) nameWithType: API.SendCustomEvent(Int32, List) nameWithType.vb: API.SendCustomEvent(Int32, List(Of Object)) +- uid: RageCoop.Client.Scripting.API.SendCustomEvent(System.Int32,System.Object[]) + name: SendCustomEvent(Int32, Object[]) + href: api/RageCoop.Client.Scripting.API.html#RageCoop_Client_Scripting_API_SendCustomEvent_System_Int32_System_Object___ + commentId: M:RageCoop.Client.Scripting.API.SendCustomEvent(System.Int32,System.Object[]) + name.vb: SendCustomEvent(Int32, Object()) + fullName: RageCoop.Client.Scripting.API.SendCustomEvent(System.Int32, System.Object[]) + fullName.vb: RageCoop.Client.Scripting.API.SendCustomEvent(System.Int32, System.Object()) + nameWithType: API.SendCustomEvent(Int32, Object[]) + nameWithType.vb: API.SendCustomEvent(Int32, Object()) - uid: RageCoop.Client.Scripting.API.SendCustomEvent* name: SendCustomEvent href: api/RageCoop.Client.Scripting.API.html#RageCoop_Client_Scripting_API_SendCustomEvent_ @@ -434,6 +443,19 @@ references: isSpec: "True" fullName: RageCoop.Client.Scripting.ClientScript.CurrentFile nameWithType: ClientScript.CurrentFile +- uid: RageCoop.Client.Scripting.ClientScript.CurrentResource + name: CurrentResource + href: api/RageCoop.Client.Scripting.ClientScript.html#RageCoop_Client_Scripting_ClientScript_CurrentResource + commentId: P:RageCoop.Client.Scripting.ClientScript.CurrentResource + fullName: RageCoop.Client.Scripting.ClientScript.CurrentResource + nameWithType: ClientScript.CurrentResource +- uid: RageCoop.Client.Scripting.ClientScript.CurrentResource* + name: CurrentResource + href: api/RageCoop.Client.Scripting.ClientScript.html#RageCoop_Client_Scripting_ClientScript_CurrentResource_ + commentId: Overload:RageCoop.Client.Scripting.ClientScript.CurrentResource + isSpec: "True" + fullName: RageCoop.Client.Scripting.ClientScript.CurrentResource + nameWithType: ClientScript.CurrentResource - uid: RageCoop.Client.Scripting.ClientScript.OnStart name: OnStart() href: api/RageCoop.Client.Scripting.ClientScript.html#RageCoop_Client_Scripting_ClientScript_OnStart @@ -608,6 +630,19 @@ references: isSpec: "True" fullName: RageCoop.Client.Settings.Password nameWithType: Settings.Password +- uid: RageCoop.Client.Settings.ResourceDirectory + name: ResourceDirectory + href: api/RageCoop.Client.Settings.html#RageCoop_Client_Settings_ResourceDirectory + commentId: P:RageCoop.Client.Settings.ResourceDirectory + fullName: RageCoop.Client.Settings.ResourceDirectory + nameWithType: Settings.ResourceDirectory +- uid: RageCoop.Client.Settings.ResourceDirectory* + name: ResourceDirectory + href: api/RageCoop.Client.Settings.html#RageCoop_Client_Settings_ResourceDirectory_ + commentId: Overload:RageCoop.Client.Settings.ResourceDirectory + isSpec: "True" + fullName: RageCoop.Client.Settings.ResourceDirectory + nameWithType: Settings.ResourceDirectory - uid: RageCoop.Client.Settings.Username name: Username href: api/RageCoop.Client.Settings.html#RageCoop_Client_Settings_Username @@ -1229,6 +1264,15 @@ references: fullName.vb: RageCoop.Server.Client.SendCustomEvent(System.Int32, System.Collections.Generic.List(Of System.Object)) nameWithType: Client.SendCustomEvent(Int32, List) nameWithType.vb: Client.SendCustomEvent(Int32, List(Of Object)) +- uid: RageCoop.Server.Client.SendCustomEvent(System.Int32,System.Object[]) + name: SendCustomEvent(Int32, Object[]) + href: api/RageCoop.Server.Client.html#RageCoop_Server_Client_SendCustomEvent_System_Int32_System_Object___ + commentId: M:RageCoop.Server.Client.SendCustomEvent(System.Int32,System.Object[]) + name.vb: SendCustomEvent(Int32, Object()) + fullName: RageCoop.Server.Client.SendCustomEvent(System.Int32, System.Object[]) + fullName.vb: RageCoop.Server.Client.SendCustomEvent(System.Int32, System.Object()) + nameWithType: Client.SendCustomEvent(Int32, Object[]) + nameWithType.vb: Client.SendCustomEvent(Int32, Object()) - uid: RageCoop.Server.Client.SendCustomEvent* name: SendCustomEvent href: api/RageCoop.Server.Client.html#RageCoop_Server_Client_SendCustomEvent_ @@ -1344,6 +1388,19 @@ references: commentId: T:RageCoop.Server.Scripting.API fullName: RageCoop.Server.Scripting.API nameWithType: API +- uid: RageCoop.Server.Scripting.API.Entities + name: Entities + href: api/RageCoop.Server.Scripting.API.html#RageCoop_Server_Scripting_API_Entities + commentId: P:RageCoop.Server.Scripting.API.Entities + fullName: RageCoop.Server.Scripting.API.Entities + nameWithType: API.Entities +- uid: RageCoop.Server.Scripting.API.Entities* + name: Entities + href: api/RageCoop.Server.Scripting.API.html#RageCoop_Server_Scripting_API_Entities_ + commentId: Overload:RageCoop.Server.Scripting.API.Entities + isSpec: "True" + fullName: RageCoop.Server.Scripting.API.Entities + nameWithType: API.Entities - uid: RageCoop.Server.Scripting.API.Events name: Events href: api/RageCoop.Server.Scripting.API.html#RageCoop_Server_Scripting_API_Events @@ -1502,54 +1559,6 @@ references: isSpec: "True" fullName: RageCoop.Server.Scripting.API.SendCustomEvent nameWithType: API.SendCustomEvent -- uid: RageCoop.Server.Scripting.APIEvents - name: APIEvents - href: api/RageCoop.Server.Scripting.APIEvents.html - commentId: T:RageCoop.Server.Scripting.APIEvents - fullName: RageCoop.Server.Scripting.APIEvents - nameWithType: APIEvents -- uid: RageCoop.Server.Scripting.APIEvents.OnChatMessage - name: OnChatMessage - href: api/RageCoop.Server.Scripting.APIEvents.html#RageCoop_Server_Scripting_APIEvents_OnChatMessage - commentId: E:RageCoop.Server.Scripting.APIEvents.OnChatMessage - fullName: RageCoop.Server.Scripting.APIEvents.OnChatMessage - nameWithType: APIEvents.OnChatMessage -- uid: RageCoop.Server.Scripting.APIEvents.OnCommandReceived - name: OnCommandReceived - href: api/RageCoop.Server.Scripting.APIEvents.html#RageCoop_Server_Scripting_APIEvents_OnCommandReceived - commentId: E:RageCoop.Server.Scripting.APIEvents.OnCommandReceived - fullName: RageCoop.Server.Scripting.APIEvents.OnCommandReceived - nameWithType: APIEvents.OnCommandReceived -- uid: RageCoop.Server.Scripting.APIEvents.OnPlayerConnected - name: OnPlayerConnected - href: api/RageCoop.Server.Scripting.APIEvents.html#RageCoop_Server_Scripting_APIEvents_OnPlayerConnected - commentId: E:RageCoop.Server.Scripting.APIEvents.OnPlayerConnected - fullName: RageCoop.Server.Scripting.APIEvents.OnPlayerConnected - nameWithType: APIEvents.OnPlayerConnected -- uid: RageCoop.Server.Scripting.APIEvents.OnPlayerDisconnected - name: OnPlayerDisconnected - href: api/RageCoop.Server.Scripting.APIEvents.html#RageCoop_Server_Scripting_APIEvents_OnPlayerDisconnected - commentId: E:RageCoop.Server.Scripting.APIEvents.OnPlayerDisconnected - fullName: RageCoop.Server.Scripting.APIEvents.OnPlayerDisconnected - nameWithType: APIEvents.OnPlayerDisconnected -- uid: RageCoop.Server.Scripting.APIEvents.OnPlayerHandshake - name: OnPlayerHandshake - href: api/RageCoop.Server.Scripting.APIEvents.html#RageCoop_Server_Scripting_APIEvents_OnPlayerHandshake - commentId: E:RageCoop.Server.Scripting.APIEvents.OnPlayerHandshake - fullName: RageCoop.Server.Scripting.APIEvents.OnPlayerHandshake - nameWithType: APIEvents.OnPlayerHandshake -- uid: RageCoop.Server.Scripting.APIEvents.OnPlayerReady - name: OnPlayerReady - href: api/RageCoop.Server.Scripting.APIEvents.html#RageCoop_Server_Scripting_APIEvents_OnPlayerReady - commentId: E:RageCoop.Server.Scripting.APIEvents.OnPlayerReady - fullName: RageCoop.Server.Scripting.APIEvents.OnPlayerReady - nameWithType: APIEvents.OnPlayerReady -- uid: RageCoop.Server.Scripting.APIEvents.OnPlayerUpdate - name: OnPlayerUpdate - href: api/RageCoop.Server.Scripting.APIEvents.html#RageCoop_Server_Scripting_APIEvents_OnPlayerUpdate - commentId: E:RageCoop.Server.Scripting.APIEvents.OnPlayerUpdate - fullName: RageCoop.Server.Scripting.APIEvents.OnPlayerUpdate - nameWithType: APIEvents.OnPlayerUpdate - uid: RageCoop.Server.Scripting.ChatEventArgs name: ChatEventArgs href: api/RageCoop.Server.Scripting.ChatEventArgs.html @@ -1846,6 +1855,54 @@ references: isSpec: "True" fullName: RageCoop.Server.Scripting.OnCommandEventArgs.Sender nameWithType: OnCommandEventArgs.Sender +- uid: RageCoop.Server.Scripting.ServerEvents + name: ServerEvents + href: api/RageCoop.Server.Scripting.ServerEvents.html + commentId: T:RageCoop.Server.Scripting.ServerEvents + fullName: RageCoop.Server.Scripting.ServerEvents + nameWithType: ServerEvents +- uid: RageCoop.Server.Scripting.ServerEvents.OnChatMessage + name: OnChatMessage + href: api/RageCoop.Server.Scripting.ServerEvents.html#RageCoop_Server_Scripting_ServerEvents_OnChatMessage + commentId: E:RageCoop.Server.Scripting.ServerEvents.OnChatMessage + fullName: RageCoop.Server.Scripting.ServerEvents.OnChatMessage + nameWithType: ServerEvents.OnChatMessage +- uid: RageCoop.Server.Scripting.ServerEvents.OnCommandReceived + name: OnCommandReceived + href: api/RageCoop.Server.Scripting.ServerEvents.html#RageCoop_Server_Scripting_ServerEvents_OnCommandReceived + commentId: E:RageCoop.Server.Scripting.ServerEvents.OnCommandReceived + fullName: RageCoop.Server.Scripting.ServerEvents.OnCommandReceived + nameWithType: ServerEvents.OnCommandReceived +- uid: RageCoop.Server.Scripting.ServerEvents.OnPlayerConnected + name: OnPlayerConnected + href: api/RageCoop.Server.Scripting.ServerEvents.html#RageCoop_Server_Scripting_ServerEvents_OnPlayerConnected + commentId: E:RageCoop.Server.Scripting.ServerEvents.OnPlayerConnected + fullName: RageCoop.Server.Scripting.ServerEvents.OnPlayerConnected + nameWithType: ServerEvents.OnPlayerConnected +- uid: RageCoop.Server.Scripting.ServerEvents.OnPlayerDisconnected + name: OnPlayerDisconnected + href: api/RageCoop.Server.Scripting.ServerEvents.html#RageCoop_Server_Scripting_ServerEvents_OnPlayerDisconnected + commentId: E:RageCoop.Server.Scripting.ServerEvents.OnPlayerDisconnected + fullName: RageCoop.Server.Scripting.ServerEvents.OnPlayerDisconnected + nameWithType: ServerEvents.OnPlayerDisconnected +- uid: RageCoop.Server.Scripting.ServerEvents.OnPlayerHandshake + name: OnPlayerHandshake + href: api/RageCoop.Server.Scripting.ServerEvents.html#RageCoop_Server_Scripting_ServerEvents_OnPlayerHandshake + commentId: E:RageCoop.Server.Scripting.ServerEvents.OnPlayerHandshake + fullName: RageCoop.Server.Scripting.ServerEvents.OnPlayerHandshake + nameWithType: ServerEvents.OnPlayerHandshake +- uid: RageCoop.Server.Scripting.ServerEvents.OnPlayerReady + name: OnPlayerReady + href: api/RageCoop.Server.Scripting.ServerEvents.html#RageCoop_Server_Scripting_ServerEvents_OnPlayerReady + commentId: E:RageCoop.Server.Scripting.ServerEvents.OnPlayerReady + fullName: RageCoop.Server.Scripting.ServerEvents.OnPlayerReady + nameWithType: ServerEvents.OnPlayerReady +- uid: RageCoop.Server.Scripting.ServerEvents.OnPlayerUpdate + name: OnPlayerUpdate + href: api/RageCoop.Server.Scripting.ServerEvents.html#RageCoop_Server_Scripting_ServerEvents_OnPlayerUpdate + commentId: E:RageCoop.Server.Scripting.ServerEvents.OnPlayerUpdate + fullName: RageCoop.Server.Scripting.ServerEvents.OnPlayerUpdate + nameWithType: ServerEvents.OnPlayerUpdate - uid: RageCoop.Server.Scripting.ServerResource name: ServerResource href: api/RageCoop.Server.Scripting.ServerResource.html @@ -2039,6 +2096,109 @@ references: isSpec: "True" fullName: RageCoop.Server.Server.Stop nameWithType: Server.Stop +- uid: RageCoop.Server.ServerEntities + name: ServerEntities + href: api/RageCoop.Server.ServerEntities.html + commentId: T:RageCoop.Server.ServerEntities + fullName: RageCoop.Server.ServerEntities + nameWithType: ServerEntities +- uid: RageCoop.Server.ServerEntities.GetAllObjects + name: GetAllObjects() + href: api/RageCoop.Server.ServerEntities.html#RageCoop_Server_ServerEntities_GetAllObjects + commentId: M:RageCoop.Server.ServerEntities.GetAllObjects + fullName: RageCoop.Server.ServerEntities.GetAllObjects() + nameWithType: ServerEntities.GetAllObjects() +- uid: RageCoop.Server.ServerEntities.GetAllObjects* + name: GetAllObjects + href: api/RageCoop.Server.ServerEntities.html#RageCoop_Server_ServerEntities_GetAllObjects_ + commentId: Overload:RageCoop.Server.ServerEntities.GetAllObjects + isSpec: "True" + fullName: RageCoop.Server.ServerEntities.GetAllObjects + nameWithType: ServerEntities.GetAllObjects +- uid: RageCoop.Server.ServerEntities.GetAllPeds + name: GetAllPeds() + href: api/RageCoop.Server.ServerEntities.html#RageCoop_Server_ServerEntities_GetAllPeds + commentId: M:RageCoop.Server.ServerEntities.GetAllPeds + fullName: RageCoop.Server.ServerEntities.GetAllPeds() + nameWithType: ServerEntities.GetAllPeds() +- uid: RageCoop.Server.ServerEntities.GetAllPeds* + name: GetAllPeds + href: api/RageCoop.Server.ServerEntities.html#RageCoop_Server_ServerEntities_GetAllPeds_ + commentId: Overload:RageCoop.Server.ServerEntities.GetAllPeds + isSpec: "True" + fullName: RageCoop.Server.ServerEntities.GetAllPeds + nameWithType: ServerEntities.GetAllPeds +- uid: RageCoop.Server.ServerEntities.GetAllVehicle + name: GetAllVehicle() + href: api/RageCoop.Server.ServerEntities.html#RageCoop_Server_ServerEntities_GetAllVehicle + commentId: M:RageCoop.Server.ServerEntities.GetAllVehicle + fullName: RageCoop.Server.ServerEntities.GetAllVehicle() + nameWithType: ServerEntities.GetAllVehicle() +- uid: RageCoop.Server.ServerEntities.GetAllVehicle* + name: GetAllVehicle + href: api/RageCoop.Server.ServerEntities.html#RageCoop_Server_ServerEntities_GetAllVehicle_ + commentId: Overload:RageCoop.Server.ServerEntities.GetAllVehicle + isSpec: "True" + fullName: RageCoop.Server.ServerEntities.GetAllVehicle + nameWithType: ServerEntities.GetAllVehicle +- uid: RageCoop.Server.ServerObject + name: ServerObject + href: api/RageCoop.Server.ServerObject.html + commentId: T:RageCoop.Server.ServerObject + fullName: RageCoop.Server.ServerObject + nameWithType: ServerObject +- uid: RageCoop.Server.ServerObject.IsInvincible + name: IsInvincible + href: api/RageCoop.Server.ServerObject.html#RageCoop_Server_ServerObject_IsInvincible + commentId: P:RageCoop.Server.ServerObject.IsInvincible + fullName: RageCoop.Server.ServerObject.IsInvincible + nameWithType: ServerObject.IsInvincible +- uid: RageCoop.Server.ServerObject.IsInvincible* + name: IsInvincible + href: api/RageCoop.Server.ServerObject.html#RageCoop_Server_ServerObject_IsInvincible_ + commentId: Overload:RageCoop.Server.ServerObject.IsInvincible + isSpec: "True" + fullName: RageCoop.Server.ServerObject.IsInvincible + nameWithType: ServerObject.IsInvincible +- uid: RageCoop.Server.ServerObject.Model + name: Model + href: api/RageCoop.Server.ServerObject.html#RageCoop_Server_ServerObject_Model + commentId: P:RageCoop.Server.ServerObject.Model + fullName: RageCoop.Server.ServerObject.Model + nameWithType: ServerObject.Model +- uid: RageCoop.Server.ServerObject.Model* + name: Model + href: api/RageCoop.Server.ServerObject.html#RageCoop_Server_ServerObject_Model_ + commentId: Overload:RageCoop.Server.ServerObject.Model + isSpec: "True" + fullName: RageCoop.Server.ServerObject.Model + nameWithType: ServerObject.Model +- uid: RageCoop.Server.ServerObject.Position + name: Position + href: api/RageCoop.Server.ServerObject.html#RageCoop_Server_ServerObject_Position + commentId: P:RageCoop.Server.ServerObject.Position + fullName: RageCoop.Server.ServerObject.Position + nameWithType: ServerObject.Position +- uid: RageCoop.Server.ServerObject.Position* + name: Position + href: api/RageCoop.Server.ServerObject.html#RageCoop_Server_ServerObject_Position_ + commentId: Overload:RageCoop.Server.ServerObject.Position + isSpec: "True" + fullName: RageCoop.Server.ServerObject.Position + nameWithType: ServerObject.Position +- uid: RageCoop.Server.ServerObject.Quaternion + name: Quaternion + href: api/RageCoop.Server.ServerObject.html#RageCoop_Server_ServerObject_Quaternion + commentId: P:RageCoop.Server.ServerObject.Quaternion + fullName: RageCoop.Server.ServerObject.Quaternion + nameWithType: ServerObject.Quaternion +- uid: RageCoop.Server.ServerObject.Quaternion* + name: Quaternion + href: api/RageCoop.Server.ServerObject.html#RageCoop_Server_ServerObject_Quaternion_ + commentId: Overload:RageCoop.Server.ServerObject.Quaternion + isSpec: "True" + fullName: RageCoop.Server.ServerObject.Quaternion + nameWithType: ServerObject.Quaternion - uid: RageCoop.Server.ServerPed name: ServerPed href: api/RageCoop.Server.ServerPed.html @@ -2071,6 +2231,32 @@ references: isSpec: "True" fullName: RageCoop.Server.ServerPed.ID nameWithType: ServerPed.ID +- uid: RageCoop.Server.ServerPed.IsPlayer + name: IsPlayer + href: api/RageCoop.Server.ServerPed.html#RageCoop_Server_ServerPed_IsPlayer + commentId: P:RageCoop.Server.ServerPed.IsPlayer + fullName: RageCoop.Server.ServerPed.IsPlayer + nameWithType: ServerPed.IsPlayer +- uid: RageCoop.Server.ServerPed.IsPlayer* + name: IsPlayer + href: api/RageCoop.Server.ServerPed.html#RageCoop_Server_ServerPed_IsPlayer_ + commentId: Overload:RageCoop.Server.ServerPed.IsPlayer + isSpec: "True" + fullName: RageCoop.Server.ServerPed.IsPlayer + nameWithType: ServerPed.IsPlayer +- uid: RageCoop.Server.ServerPed.LastVehicle + name: LastVehicle + href: api/RageCoop.Server.ServerPed.html#RageCoop_Server_ServerPed_LastVehicle + commentId: P:RageCoop.Server.ServerPed.LastVehicle + fullName: RageCoop.Server.ServerPed.LastVehicle + nameWithType: ServerPed.LastVehicle +- uid: RageCoop.Server.ServerPed.LastVehicle* + name: LastVehicle + href: api/RageCoop.Server.ServerPed.html#RageCoop_Server_ServerPed_LastVehicle_ + commentId: Overload:RageCoop.Server.ServerPed.LastVehicle + isSpec: "True" + fullName: RageCoop.Server.ServerPed.LastVehicle + nameWithType: ServerPed.LastVehicle - uid: RageCoop.Server.ServerPed.Owner name: Owner href: api/RageCoop.Server.ServerPed.html#RageCoop_Server_ServerPed_Owner @@ -2097,19 +2283,19 @@ references: isSpec: "True" fullName: RageCoop.Server.ServerPed.Position nameWithType: ServerPed.Position -- uid: RageCoop.Server.ServerPed.VehicleID - name: VehicleID - href: api/RageCoop.Server.ServerPed.html#RageCoop_Server_ServerPed_VehicleID - commentId: P:RageCoop.Server.ServerPed.VehicleID - fullName: RageCoop.Server.ServerPed.VehicleID - nameWithType: ServerPed.VehicleID -- uid: RageCoop.Server.ServerPed.VehicleID* - name: VehicleID - href: api/RageCoop.Server.ServerPed.html#RageCoop_Server_ServerPed_VehicleID_ - commentId: Overload:RageCoop.Server.ServerPed.VehicleID +- uid: RageCoop.Server.ServerPed.Rotation + name: Rotation + href: api/RageCoop.Server.ServerPed.html#RageCoop_Server_ServerPed_Rotation + commentId: P:RageCoop.Server.ServerPed.Rotation + fullName: RageCoop.Server.ServerPed.Rotation + nameWithType: ServerPed.Rotation +- uid: RageCoop.Server.ServerPed.Rotation* + name: Rotation + href: api/RageCoop.Server.ServerPed.html#RageCoop_Server_ServerPed_Rotation_ + commentId: Overload:RageCoop.Server.ServerPed.Rotation isSpec: "True" - fullName: RageCoop.Server.ServerPed.VehicleID - nameWithType: ServerPed.VehicleID + fullName: RageCoop.Server.ServerPed.Rotation + nameWithType: ServerPed.Rotation - uid: RageCoop.Server.ServerSettings name: ServerSettings href: api/RageCoop.Server.ServerSettings.html @@ -2132,7 +2318,14 @@ references: - uid: RageCoop.Server.ServerSettings.LogLevel name: LogLevel href: api/RageCoop.Server.ServerSettings.html#RageCoop_Server_ServerSettings_LogLevel - commentId: F:RageCoop.Server.ServerSettings.LogLevel + commentId: P:RageCoop.Server.ServerSettings.LogLevel + fullName: RageCoop.Server.ServerSettings.LogLevel + nameWithType: ServerSettings.LogLevel +- uid: RageCoop.Server.ServerSettings.LogLevel* + name: LogLevel + href: api/RageCoop.Server.ServerSettings.html#RageCoop_Server_ServerSettings_LogLevel_ + commentId: Overload:RageCoop.Server.ServerSettings.LogLevel + isSpec: "True" fullName: RageCoop.Server.ServerSettings.LogLevel nameWithType: ServerSettings.LogLevel - uid: RageCoop.Server.ServerSettings.MasterServer @@ -2239,3 +2432,61 @@ references: isSpec: "True" fullName: RageCoop.Server.ServerSettings.WelcomeMessage nameWithType: ServerSettings.WelcomeMessage +- uid: RageCoop.Server.ServerVehicle + name: ServerVehicle + href: api/RageCoop.Server.ServerVehicle.html + commentId: T:RageCoop.Server.ServerVehicle + fullName: RageCoop.Server.ServerVehicle + nameWithType: ServerVehicle +- uid: RageCoop.Server.ServerVehicle.ID + name: ID + href: api/RageCoop.Server.ServerVehicle.html#RageCoop_Server_ServerVehicle_ID + commentId: P:RageCoop.Server.ServerVehicle.ID + fullName: RageCoop.Server.ServerVehicle.ID + nameWithType: ServerVehicle.ID +- uid: RageCoop.Server.ServerVehicle.ID* + name: ID + href: api/RageCoop.Server.ServerVehicle.html#RageCoop_Server_ServerVehicle_ID_ + commentId: Overload:RageCoop.Server.ServerVehicle.ID + isSpec: "True" + fullName: RageCoop.Server.ServerVehicle.ID + nameWithType: ServerVehicle.ID +- uid: RageCoop.Server.ServerVehicle.Owner + name: Owner + href: api/RageCoop.Server.ServerVehicle.html#RageCoop_Server_ServerVehicle_Owner + commentId: P:RageCoop.Server.ServerVehicle.Owner + fullName: RageCoop.Server.ServerVehicle.Owner + nameWithType: ServerVehicle.Owner +- uid: RageCoop.Server.ServerVehicle.Owner* + name: Owner + href: api/RageCoop.Server.ServerVehicle.html#RageCoop_Server_ServerVehicle_Owner_ + commentId: Overload:RageCoop.Server.ServerVehicle.Owner + isSpec: "True" + fullName: RageCoop.Server.ServerVehicle.Owner + nameWithType: ServerVehicle.Owner +- uid: RageCoop.Server.ServerVehicle.Position + name: Position + href: api/RageCoop.Server.ServerVehicle.html#RageCoop_Server_ServerVehicle_Position + commentId: P:RageCoop.Server.ServerVehicle.Position + fullName: RageCoop.Server.ServerVehicle.Position + nameWithType: ServerVehicle.Position +- uid: RageCoop.Server.ServerVehicle.Position* + name: Position + href: api/RageCoop.Server.ServerVehicle.html#RageCoop_Server_ServerVehicle_Position_ + commentId: Overload:RageCoop.Server.ServerVehicle.Position + isSpec: "True" + fullName: RageCoop.Server.ServerVehicle.Position + nameWithType: ServerVehicle.Position +- uid: RageCoop.Server.ServerVehicle.Quaternion + name: Quaternion + href: api/RageCoop.Server.ServerVehicle.html#RageCoop_Server_ServerVehicle_Quaternion + commentId: P:RageCoop.Server.ServerVehicle.Quaternion + fullName: RageCoop.Server.ServerVehicle.Quaternion + nameWithType: ServerVehicle.Quaternion +- uid: RageCoop.Server.ServerVehicle.Quaternion* + name: Quaternion + href: api/RageCoop.Server.ServerVehicle.html#RageCoop_Server_ServerVehicle_Quaternion_ + commentId: Overload:RageCoop.Server.ServerVehicle.Quaternion + isSpec: "True" + fullName: RageCoop.Server.ServerVehicle.Quaternion + nameWithType: ServerVehicle.Quaternion diff --git a/index.md b/index.md index 651bf35..416b156 100644 --- a/index.md +++ b/index.md @@ -1,7 +1,12 @@ - # Getting started -Here you can learn how to create your first resource + +## Resources and Scripts + +A **Script** stands for class that inherits from RageCoop's script class ( [ServerScript](api/RageCoop.Server.Scripting.ServerScript.html) and [ClientScript](api/RageCoop.Client.Scripting.ClientScript.html) ) and will be loaded at runtime, one assembly can have multiple scripts in it. + +A **Resource** consists of one or more assemblies and other files. Server-side resource will be loaded at startup and is isolated from other resources, while client-side resource will be sent to each client and loaded after they connected to the server. A **Resource** can either be in a folder or packed inside a zip archive. + ## Directory structure @@ -9,6 +14,7 @@ Below is the server's directory structure ``` ServerRoot │ Settings.xml +| RageCoop.Server.exe │ └───Resources └───Server @@ -23,38 +29,47 @@ ServerRoot └───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](api/RageCoop.Server.ServerSettings.html) for detailed description. -### Resources -Each directory or zip in represents one resource, which consists of several dlls, and is isolated from another resource. +This file will be generated first time you started the server, you can then change the server's configuration option by editing it, refer to [ServerSettings](api/RageCoop.Server.ServerSettings.html) for detailed description. ## Server Reource -The resource will be running at server side, here's how to create one: + +To create a server resource: 1. Create a C# class library project targeting .NET 6.0. 2. Add reference to **RageCoop.Server.dll** and **RageCoop.Core.dll**. 3. Add following namespace(s): -``` -using RageCoop.Server.Scripting; - -// Optional -using RageCoop.Server; -using RageCoop.Core.Scripting; -using RageCoop.Core; - -``` + ``` + using RageCoop.Server.Scripting; + + // Optional + using RageCoop.Server; + using RageCoop.Core.Scripting; + using RageCoop.Core; + + ``` 4. Inherit a class from [ServerScript](api/RageCoop.Server.Scripting.ServerScript.html). -5. Implement `OnStart()` and `OnStop()`: -``` -public class MyFirstResource :ServerScript -{ - public override void OnStart() - { - // Initiate your script here - } - public override void OnStop() - { - // Free all resources and perform cleanup - } -} -``` -6. That's it! Now you can have some fun by using the [API](api/RageCoop.Server.Scripting.API.html) instance, please refer to the [GiHub](https://github.com/RAGECOOP/GTAV-RESOURCES) for more examples. +5. Implement `OnStart()` and `OnStop()`, your cs file should look like this: + ``` + using RageCoop.Server.Scripting; + + namespace NiceGuy.MyFirstResource + { + public class Main : ServerScript + { + public override void OnStart() + { + // Initiate your script here + } + public override void OnStop() + { + // Free all resources and perform cleanup + } + } + } + ``` +6. Now you can have some fun by using the [API](api/RageCoop.Server.Scripting.API.html) instance, please refer to the [GitHub repo](https://github.com/RAGECOOP/GTAV-RESOURCES) for more examples. +7. For convenience, you can create a symlink in `ServerRoot/Resources/Server/NiceGuy.MyFirstResource` targeting your output folder: + ``` + mklink /d ServerRoot/Resources/Server/NiceGuy.MyFirstResource C:/MyRepos/NiceGuy.MyFirstResource/bin/Debug + ``` +8. That's it! Start your server and you should see your resource loading. \ No newline at end of file diff --git a/toc.yml b/toc.yml index ac01c8f..c38a4f7 100644 --- a/toc.yml +++ b/toc.yml @@ -3,4 +3,4 @@ - name: About href: README.md - name: API Documentation - href: api/RageCoop.Client.html \ No newline at end of file + href: api/RageCoop.Client.Scripting.html \ No newline at end of file