RAGECOOP-V/docs/api/RageCoop.Server.Scripting.API.html
2022-07-02 18:32:49 +08:00

647 lines
30 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>Class API
| RageCoop resource documentation </title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Class API
| 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="sidenav hide-when-search">
<a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
<div class="sidetoggle collapse" id="sidetoggle">
<div id="sidetoc"></div>
</div>
</div>
<div class="article row grid-right">
<div class="col-md-10">
<article class="content wrap" id="_content" data-uid="RageCoop.Server.Scripting.API">
<h1 id="RageCoop_Server_Scripting_API" data-uid="RageCoop.Server.Scripting.API" class="text-break">Class API
</h1>
<div class="markdown level0 summary"><p>An class that can be used to interact with RageCoop server.</p>
</div>
<div class="markdown level0 conceptual"></div>
<div class="inheritance">
<h5>Inheritance</h5>
<div class="level0"><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a></div>
<div class="level1"><span class="xref">API</span></div>
</div>
<div class="inheritedMembers">
<h5>Inherited Members</h5>
<div>
<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">Object.Equals(Object)</a>
</div>
<div>
<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">Object.Equals(Object, Object)</a>
</div>
<div>
<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.gethashcode#system-object-gethashcode">Object.GetHashCode()</a>
</div>
<div>
<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.gettype#system-object-gettype">Object.GetType()</a>
</div>
<div>
<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.memberwiseclone#system-object-memberwiseclone">Object.MemberwiseClone()</a>
</div>
<div>
<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.referenceequals#system-object-referenceequals(system-object-system-object)">Object.ReferenceEquals(Object, Object)</a>
</div>
<div>
<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.tostring#system-object-tostring">Object.ToString()</a>
</div>
</div>
<h6><strong>Namespace</strong>: <a class="xref" href="RageCoop.Server.Scripting.html">RageCoop.Server.Scripting</a></h6>
<h6><strong>Assembly</strong>: RageCoop.Server.dll</h6>
<h5 id="RageCoop_Server_Scripting_API_syntax">Syntax</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public class API</code></pre>
</div>
<h3 id="fields">Fields
</h3>
<h4 id="RageCoop_Server_Scripting_API_Events" data-uid="RageCoop.Server.Scripting.API.Events">Events</h4>
<div class="markdown level1 summary"><p>Server side events</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public readonly ServerEvents Events</code></pre>
</div>
<h5 class="fieldValue">Field Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="RageCoop.Server.Scripting.ServerEvents.html">ServerEvents</a></td>
<td></td>
</tr>
</tbody>
</table>
<h3 id="properties">Properties
</h3>
<a id="RageCoop_Server_Scripting_API_Entities_" data-uid="RageCoop.Server.Scripting.API.Entities*"></a>
<h4 id="RageCoop_Server_Scripting_API_Entities" data-uid="RageCoop.Server.Scripting.API.Entities">Entities</h4>
<div class="markdown level1 summary"><p>All synchronized entities on this server.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public ServerEntities Entities { get; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="RageCoop.Server.ServerEntities.html">ServerEntities</a></td>
<td></td>
</tr>
</tbody>
</table>
<a id="RageCoop_Server_Scripting_API_Logger_" data-uid="RageCoop.Server.Scripting.API.Logger*"></a>
<h4 id="RageCoop_Server_Scripting_API_Logger" data-uid="RageCoop.Server.Scripting.API.Logger">Logger</h4>
<div class="markdown level1 summary"><p>Get a <a class="xref" href="RageCoop.Core.Logger.html">Logger</a> that the server is currently using, you should use <a class="xref" href="RageCoop.Server.Scripting.ServerResource.html#RageCoop_Server_Scripting_ServerResource_Logger">Logger</a> to display resource-specific information.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public Logger Logger { get; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="RageCoop.Core.Logger.html">Logger</a></td>
<td></td>
</tr>
</tbody>
</table>
<h3 id="methods">Methods
</h3>
<a id="RageCoop_Server_Scripting_API_GetAllClients_" data-uid="RageCoop.Server.Scripting.API.GetAllClients*"></a>
<h4 id="RageCoop_Server_Scripting_API_GetAllClients" data-uid="RageCoop.Server.Scripting.API.GetAllClients">GetAllClients()</h4>
<div class="markdown level1 summary"><p>Get a list of all Clients</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public Dictionary&lt;long, Client&gt; GetAllClients()</code></pre>
</div>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.dictionary-2">Dictionary</a>&lt;<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.int64">Int64</a>, <a class="xref" href="RageCoop.Server.Client.html">Client</a>&gt;</td>
<td><p>All clients as a dictionary indexed by NetID</p>
</td>
</tr>
</tbody>
</table>
<a id="RageCoop_Server_Scripting_API_GetClientByUsername_" data-uid="RageCoop.Server.Scripting.API.GetClientByUsername*"></a>
<h4 id="RageCoop_Server_Scripting_API_GetClientByUsername_System_String_" data-uid="RageCoop.Server.Scripting.API.GetClientByUsername(System.String)">GetClientByUsername(String)</h4>
<div class="markdown level1 summary"><p>Get the client by its username</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public Client GetClientByUsername(string username)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
<td><span class="parametername">username</span></td>
<td><p>The username to search for (non case-sensitive)</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="RageCoop.Server.Client.html">Client</a></td>
<td><p>The Client from this user or null</p>
</td>
</tr>
</tbody>
</table>
<a id="RageCoop_Server_Scripting_API_RegisterCommand_" data-uid="RageCoop.Server.Scripting.API.RegisterCommand*"></a>
<h4 id="RageCoop_Server_Scripting_API_RegisterCommand_System_String_System_Action_RageCoop_Server_Scripting_CommandContext__" data-uid="RageCoop.Server.Scripting.API.RegisterCommand(System.String,System.Action{RageCoop.Server.Scripting.CommandContext})">RegisterCommand(String, Action&lt;CommandContext&gt;)</h4>
<div class="markdown level1 summary"><p>Register a new command chat command (Example: &quot;/test&quot;)</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void RegisterCommand(string name, Action&lt;CommandContext&gt; callback)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
<td><span class="parametername">name</span></td>
<td><p>The name of the command (Example: &quot;test&quot; for &quot;/test&quot;)</p>
</td>
</tr>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.action-1">Action</a>&lt;<a class="xref" href="RageCoop.Server.Scripting.CommandContext.html">CommandContext</a>&gt;</td>
<td><span class="parametername">callback</span></td>
<td><p>A callback to invoke when the command received.</p>
</td>
</tr>
</tbody>
</table>
<a id="RageCoop_Server_Scripting_API_RegisterCommand_" data-uid="RageCoop.Server.Scripting.API.RegisterCommand*"></a>
<h4 id="RageCoop_Server_Scripting_API_RegisterCommand_System_String_System_String_System_Int16_System_Action_RageCoop_Server_Scripting_CommandContext__" data-uid="RageCoop.Server.Scripting.API.RegisterCommand(System.String,System.String,System.Int16,System.Action{RageCoop.Server.Scripting.CommandContext})">RegisterCommand(String, String, Int16, Action&lt;CommandContext&gt;)</h4>
<div class="markdown level1 summary"><p>Send CleanUpWorld to all players to delete all objects created by the server</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void RegisterCommand(string name, string usage, short argsLength, Action&lt;CommandContext&gt; callback)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
<td><span class="parametername">name</span></td>
<td><p>The name of the command (Example: &quot;test&quot; for &quot;/test&quot;)</p>
</td>
</tr>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
<td><span class="parametername">usage</span></td>
<td><p>How to use this message (argsLength required!)</p>
</td>
</tr>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.int16">Int16</a></td>
<td><span class="parametername">argsLength</span></td>
<td><p>The length of args (Example: &quot;/message USERNAME MESSAGE&quot; = 2) (usage required!)</p>
</td>
</tr>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.action-1">Action</a>&lt;<a class="xref" href="RageCoop.Server.Scripting.CommandContext.html">CommandContext</a>&gt;</td>
<td><span class="parametername">callback</span></td>
<td><p>A callback to invoke when the command received.</p>
</td>
</tr>
</tbody>
</table>
<a id="RageCoop_Server_Scripting_API_RegisterCommands_" data-uid="RageCoop.Server.Scripting.API.RegisterCommands*"></a>
<h4 id="RageCoop_Server_Scripting_API_RegisterCommands_System_Object_" data-uid="RageCoop.Server.Scripting.API.RegisterCommands(System.Object)">RegisterCommands(Object)</h4>
<div class="markdown level1 summary"><p>Register all commands inside an class instance</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void RegisterCommands(object obj)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a></td>
<td><span class="parametername">obj</span></td>
<td><p>The instance of type containing the commands</p>
</td>
</tr>
</tbody>
</table>
<a id="RageCoop_Server_Scripting_API_RegisterCommands_" data-uid="RageCoop.Server.Scripting.API.RegisterCommands*"></a>
<h4 id="RageCoop_Server_Scripting_API_RegisterCommands__1" data-uid="RageCoop.Server.Scripting.API.RegisterCommands``1">RegisterCommands&lt;T&gt;()</h4>
<div class="markdown level1 summary"><p>Register all commands in a static class</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void RegisterCommands&lt;T&gt;()</code></pre>
</div>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">T</span></td>
<td><p>Your static class with commands</p>
</td>
</tr>
</tbody>
</table>
<a id="RageCoop_Server_Scripting_API_RegisterCustomEventHandler_" data-uid="RageCoop.Server.Scripting.API.RegisterCustomEventHandler*"></a>
<h4 id="RageCoop_Server_Scripting_API_RegisterCustomEventHandler_System_Int32_System_Action_RageCoop_Server_Scripting_CustomEventReceivedArgs__" data-uid="RageCoop.Server.Scripting.API.RegisterCustomEventHandler(System.Int32,System.Action{RageCoop.Server.Scripting.CustomEventReceivedArgs})">RegisterCustomEventHandler(Int32, Action&lt;CustomEventReceivedArgs&gt;)</h4>
<div class="markdown level1 summary"><p>Register an handler to the specifed event hash, one event can have multiple handlers.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void RegisterCustomEventHandler(int hash, Action&lt;CustomEventReceivedArgs&gt; handler)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.int32">Int32</a></td>
<td><span class="parametername">hash</span></td>
<td><p>An unique identifier of the event, you can hash your event name with <a class="xref" href="RageCoop.Core.Scripting.CustomEvents.html#RageCoop_Core_Scripting_CustomEvents_Hash_System_String_">Hash(String)</a></p>
</td>
</tr>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.action-1">Action</a>&lt;<a class="xref" href="RageCoop.Server.Scripting.CustomEventReceivedArgs.html">CustomEventReceivedArgs</a>&gt;</td>
<td><span class="parametername">handler</span></td>
<td><p>An handler to be invoked when the event is received from the server.</p>
</td>
</tr>
</tbody>
</table>
<a id="RageCoop_Server_Scripting_API_RegisterCustomEventHandler_" data-uid="RageCoop.Server.Scripting.API.RegisterCustomEventHandler*"></a>
<h4 id="RageCoop_Server_Scripting_API_RegisterCustomEventHandler_System_String_System_Action_RageCoop_Server_Scripting_CustomEventReceivedArgs__" data-uid="RageCoop.Server.Scripting.API.RegisterCustomEventHandler(System.String,System.Action{RageCoop.Server.Scripting.CustomEventReceivedArgs})">RegisterCustomEventHandler(String, Action&lt;CustomEventReceivedArgs&gt;)</h4>
<div class="markdown level1 summary"><p>Register an event handler for specified event name.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void RegisterCustomEventHandler(string name, Action&lt;CustomEventReceivedArgs&gt; handler)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
<td><span class="parametername">name</span></td>
<td><p>This value will be hashed to an int to reduce overhead</p>
</td>
</tr>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.action-1">Action</a>&lt;<a class="xref" href="RageCoop.Server.Scripting.CustomEventReceivedArgs.html">CustomEventReceivedArgs</a>&gt;</td>
<td><span class="parametername">handler</span></td>
<td><p>The handler to be invoked when the event is received</p>
</td>
</tr>
</tbody>
</table>
<a id="RageCoop_Server_Scripting_API_SendChatMessage_" data-uid="RageCoop.Server.Scripting.API.SendChatMessage*"></a>
<h4 id="RageCoop_Server_Scripting_API_SendChatMessage_System_String_System_Collections_Generic_List_RageCoop_Server_Client__System_String_" data-uid="RageCoop.Server.Scripting.API.SendChatMessage(System.String,System.Collections.Generic.List{RageCoop.Server.Client},System.String)">SendChatMessage(String, List&lt;Client&gt;, String)</h4>
<div class="markdown level1 summary"><p>Send a chat message to all players, use <a class="xref" href="RageCoop.Server.Client.html#RageCoop_Server_Client_SendChatMessage_System_String_System_String_">SendChatMessage(String, String)</a> to send to an individual client.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void SendChatMessage(string message, List&lt;Client&gt; targets = null, string username = &quot;Server&quot;)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
<td><span class="parametername">message</span></td>
<td><p>The chat message</p>
</td>
</tr>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<a class="xref" href="RageCoop.Server.Client.html">Client</a>&gt;</td>
<td><span class="parametername">targets</span></td>
<td><p>The clients to send message, leave it null to send to all clients</p>
</td>
</tr>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
<td><span class="parametername">username</span></td>
<td><p>The username which send this message (default = &quot;Server&quot;)</p>
</td>
</tr>
</tbody>
</table>
<a id="RageCoop_Server_Scripting_API_SendCustomEvent_" data-uid="RageCoop.Server.Scripting.API.SendCustomEvent*"></a>
<h4 id="RageCoop_Server_Scripting_API_SendCustomEvent_System_Int32_System_Collections_Generic_List_System_Object__System_Collections_Generic_List_RageCoop_Server_Client__" data-uid="RageCoop.Server.Scripting.API.SendCustomEvent(System.Int32,System.Collections.Generic.List{System.Object},System.Collections.Generic.List{RageCoop.Server.Client})">SendCustomEvent(Int32, List&lt;Object&gt;, List&lt;Client&gt;)</h4>
<div class="markdown level1 summary"><p>Send an event and data to the specified clients. Use <a class="xref" href="RageCoop.Server.Client.html#RageCoop_Server_Client_SendCustomEvent_System_Int32_System_Collections_Generic_List_System_Object__">SendCustomEvent(Int32, List&lt;Object&gt;)</a> if you want to send event to individual client.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void SendCustomEvent(int eventHash, List&lt;object&gt; args = null, List&lt;Client&gt; targets = null)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.int32">Int32</a></td>
<td><span class="parametername">eventHash</span></td>
<td><p>An unique identifier of the event, you can use <a class="xref" href="RageCoop.Core.Scripting.CustomEvents.html#RageCoop_Core_Scripting_CustomEvents_Hash_System_String_">Hash(String)</a> to get it from a string</p>
</td>
</tr>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a>&gt;</td>
<td><span class="parametername">args</span></td>
<td><p>The objects conataing your data, see <a class="xref" href="RageCoop.Server.Scripting.CustomEventReceivedArgs.html#RageCoop_Server_Scripting_CustomEventReceivedArgs_Args">Args</a> for supported types.</p>
</td>
</tr>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<a class="xref" href="RageCoop.Server.Client.html">Client</a>&gt;</td>
<td><span class="parametername">targets</span></td>
<td><p>The target clients to send. Leave it null to send to all clients</p>
</td>
</tr>
</tbody>
</table>
<a id="RageCoop_Server_Scripting_API_SendCustomEvent_" data-uid="RageCoop.Server.Scripting.API.SendCustomEvent*"></a>
<h4 id="RageCoop_Server_Scripting_API_SendCustomEvent_System_String_System_Collections_Generic_List_System_Object__System_Collections_Generic_List_RageCoop_Server_Client__" data-uid="RageCoop.Server.Scripting.API.SendCustomEvent(System.String,System.Collections.Generic.List{System.Object},System.Collections.Generic.List{RageCoop.Server.Client})">SendCustomEvent(String, List&lt;Object&gt;, List&lt;Client&gt;)</h4>
<div class="markdown level1 summary"><p>Send an event and data to the specified clients. Use <a class="xref" href="RageCoop.Server.Client.html#RageCoop_Server_Client_SendCustomEvent_System_Int32_System_Collections_Generic_List_System_Object__">SendCustomEvent(Int32, List&lt;Object&gt;)</a> if you want to send event to individual client.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void SendCustomEvent(string name, List&lt;object&gt; args = null, List&lt;Client&gt; targets = null)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
<td><span class="parametername">name</span></td>
<td><p>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 <a class="xref" href="RageCoop.Server.Scripting.API.html#RageCoop_Server_Scripting_API_SendCustomEvent_System_Int32_System_Collections_Generic_List_System_Object__System_Collections_Generic_List_RageCoop_Server_Client__">SendCustomEvent(Int32, List&lt;Object&gt;, List&lt;Client&gt;)</a>.</p>
</td>
</tr>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a>&gt;</td>
<td><span class="parametername">args</span></td>
<td><p>See <a class="xref" href="RageCoop.Server.Scripting.CustomEventReceivedArgs.html">CustomEventReceivedArgs</a> for a list of supported types.</p>
</td>
</tr>
<tr>
<td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<a class="xref" href="RageCoop.Server.Client.html">Client</a>&gt;</td>
<td><span class="parametername">targets</span></td>
<td><p>The target clients to send. Leave it null to send to all clients</p>
</td>
</tr>
</tbody>
</table>
</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>