RAGECOOP-V/docs/index.html
2022-07-01 17:00:42 +08:00

168 lines
6.0 KiB
HTML

<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Getting started | RageCoop resource documentation </title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Getting started | RageCoop resource documentation ">
<meta name="generator" content="docfx 2.59.2.0">
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" href="styles/docfx.vendor.css">
<link rel="stylesheet" href="styles/docfx.css">
<link rel="stylesheet" href="styles/main.css">
<meta property="docfx:navrel" content="toc.html">
<meta property="docfx:tocrel" content="toc.html">
<meta property="docfx:rel" content="">
</head>
<body data-spy="scroll" data-target="#affix" data-offset="120">
<div id="wrapper">
<header>
<nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">
<img id="logo" class="svg" src="logo.svg" alt="">
</a>
</div>
<div class="collapse navbar-collapse" id="navbar">
<form class="navbar-form navbar-right" role="search" id="search">
<div class="form-group">
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
</div>
</form>
</div>
</div>
</nav>
<div class="subnav navbar navbar-default">
<div class="container hide-when-search" id="breadcrumb">
<ul class="breadcrumb">
<li></li>
</ul>
</div>
</div>
</header>
<div class="container body-content">
<div id="search-results">
<div class="search-list">Search Results for <span></span></div>
<div class="sr-items">
<p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
</div>
<ul id="pagination" data-first="First" data-prev="Previous" data-next="Next" data-last="Last"></ul>
</div>
</div>
<div role="main" class="container body-content hide-when-search">
<div class="article row grid">
<div class="col-md-10">
<article class="content wrap" id="_content" data-uid="">
<h1 id="getting-started">Getting started</h1>
<p>Here you can learn how to create your first resource</p>
<h2 id="directory-structure">Directory structure</h2>
<p>Below is the server's directory structure</p>
<pre><code>ServerRoot
│ Settings.xml
└───Resources
└───Server
│ │ RageCoop.Resources.Management.zip
│ │ RageCoop.Resources.FreeRoam.Server.zip
│ │
│───Client
│ │ RageCoop.Resources.FreeRoam.Client.zip
│ │
└───Temp
</code></pre>
<h3 id="settingsxml">Settings.xml</h3>
<p>This file will be generated first time you started the, you can change the server's configuration option by editing it, refer to <a href="api/RageCoop.Server.ServerSettings.html">this</a> for detailed description.</p>
<h3 id="resources">Resources</h3>
<p>Each directory or zip in represents one resource, which consists of several dlls, and is isolated from another resource.</p>
<h2 id="server-reource">Server Reource</h2>
<p>The resource will be running at server side, here's how to create one:</p>
<ol>
<li>Create a C# class library project targeting .NET 6.0.</li>
<li>Add reference to <strong>RageCoop.Server.dll</strong> and <strong>RageCoop.Core.dll</strong>.</li>
<li>Add following namespace(s):</li>
</ol>
<pre><code>using RageCoop.Server.Scripting;
// Optional
using RageCoop.Server;
using RageCoop.Core.Scripting;
using RageCoop.Core;
</code></pre>
<ol start="4">
<li>Inherit a class from <a href="api/RageCoop.Server.Scripting.ServerScript.html">ServerScript</a>.</li>
<li>Implement <code>OnStart()</code> and <code>OnStop()</code>:</li>
</ol>
<pre><code>public class MyFirstResource :ServerScript
{
public override void OnStart()
{
// Initiate your script here
}
public override void OnStop()
{
// Free all resources and perform cleanup
}
}
</code></pre>
<ol start="6">
<li>That's it! Now you can have some fun by using the <a href="api/RageCoop.Server.Scripting.API.html">API</a> instance, please refer to the <a href="https://github.com/RAGECOOP/GTAV-RESOURCES">GiHub</a> for more examples.</li>
</ol>
</article>
</div>
<div class="hidden-sm col-md-2" role="complementary">
<div class="sideaffix">
<div class="contribution">
<ul class="nav">
</ul>
</div>
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
<h5>In This Article</h5>
<div></div>
</nav>
</div>
</div>
</div>
</div>
<footer>
<div class="grad-bottom"></div>
<div class="footer">
<div class="container">
<span class="pull-right">
<a href="#top">Back to top</a>
</span>
<span>Generated by <strong>DocFX</strong></span>
</div>
</div>
</footer>
</div>
<script type="text/javascript" src="styles/docfx.vendor.js"></script>
<script type="text/javascript" src="styles/docfx.js"></script>
<script type="text/javascript" src="styles/main.js"></script>
</body>
</html>