-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add installation instructions and first example for a first resource
- Loading branch information
Showing
10 changed files
with
129 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# First resource | ||
|
||
Creating your first resource, is very simple. | ||
All you need is a new **.NET Core 2.1 Class library** with a reference to our NuGet package, more information below. | ||
|
||
## Step 1 - Install NuGet package | ||
|
||
To get started, you need to reference the latest [AlternateLife.RageMP.Net NuGet package](https://www.nuget.org/packages/AlternateLife.RageMP.Net). | ||
|
||
```text | ||
PM> Install-Package AlternateLife.RageMP.Net | ||
``` | ||
|
||
## Step 2 - Main class | ||
|
||
The server is only able to find your resource, if you create a **single** class that implements our interface [IResource](~/api/AlternateLife.RageMP.Net.Scripting.IResource.yml). The class could look like this. | ||
|
||
```cs | ||
using System.Threading.Tasks; | ||
using AlternateLife.RageMP.Net.Scripting; | ||
|
||
namespace MyFirstResource | ||
{ | ||
public class Main : IResource | ||
{ | ||
public Main() | ||
{ | ||
// Register events here or load everything, that needs to be loaded before the first player connects. | ||
} | ||
|
||
public async Task OnStartAsync() | ||
{ | ||
// Load everything else like houses, cars or other things. | ||
} | ||
|
||
public async Task OnStopAsync() | ||
{ | ||
// Save everything before the server will be stopped completely. | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Step 3 - Prepare gamemode | ||
|
||
To finish your first gamemode, you need to copy your compiled `.dll` files to the server's resource folder. If you want to create a resource from the example above, the folder structure looks like this: | ||
|
||
```text | ||
├── ... | ||
├── dotnet/ | ||
| ├── resources/ | ||
| | └── firstresource/ | ||
| | └── MyFirstResource.dll | ||
| └── .. | ||
├── ... | ||
``` |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Installation | ||
|
||
Before you can start using AlternateLife.RageMP.Net, you need to check following requirements: | ||
|
||
## Downloads | ||
|
||
- Latest [.NET Core 2.1 SDK](https://www.microsoft.com/net/download/dotnet-core/2.1) *(Last tested: 2.1.6)* | ||
- Latest RAGE Multiplayer serverfiles [(Download Launcher)](https://www.rage.mp) | ||
- *The server files are contained in the RAGE Multiplayer installation.* | ||
- Latest [AlternateLife.RageMP.Net ZIP](https://github.com/AlternateLife/ragemp-dotnet-core/releases/latest) | ||
|
||
## Step 1 | ||
|
||
Uninstall the pre-installed GTA-Network bridge from the default RAGE Multiplayer server installation: | ||
|
||
- Delete plugin-file `<server-files>/plugins/bridge.dll`. | ||
- Delete folder `<server-files>/bridge/`. | ||
|
||
## Step 2 | ||
|
||
Extract the AlternateLife.RageMP.Net ZIP file (see [downloads](#downloads)) that contains following folders: `dotnet` and `plugins` and paste it into your root server folder. | ||
|
||
The RAGE Multiplayer server folder should look like this now: | ||
|
||
```text | ||
├── client_packages/ | ||
├── dotnet/ | ||
| ├── plugins/ | ||
| | └── ... | ||
| ├── resources/ | ||
| | └── example/ | ||
| ├── runtime/ | ||
| | └── ... | ||
| └── NLog.config | ||
├── maps/ | ||
├── packages/ | ||
├── plugins/ | ||
| └── dotnet-wrapper.dll | ||
├── bt.dat | ||
├── conf.json | ||
├── node.dll | ||
└── server.exe | ||
``` | ||
|
||
*If you want to install your own gamemode, you can delete the `example` folder under `<server-folder>/dotnet/resources`* | ||
|
||
## Step 3 | ||
|
||
Create your first serverside resource by implementing the interface `IResource`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
- name: Introduction | ||
href: index.md | ||
- name: Getting started | ||
items: | ||
- name: Installation | ||
href: installation.md | ||
- name: First resource | ||
href: first-resource.md |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
- name: Intro | ||
href: ../index.md | ||
- name: API | ||
href: ../api/toc.yml | ||
href: ../api/toc.yml | ||
- name: Documentation | ||
href: ../documentation/toc.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
- name: Getting started | ||
href: getting-started/ | ||
- name: Documentation | ||
href: documentation/ | ||
homepage: documentation/index.md | ||
- name: API | ||
href: api/ | ||
homepage: api/index.md |