Initial Commit

This commit is contained in:
Sebastian Cabrera 2021-08-02 05:44:37 -04:00
parent 53eb92e9af
commit 270ab7d11f
15341 changed files with 700234 additions and 0 deletions

View file

@ -0,0 +1,51 @@
using System;
namespace MLAPI.Messaging
{
/// <summary>
/// RPC delivery types
/// </summary>
public enum RpcDelivery
{
/// <summary>
/// Reliable delivery
/// </summary>
Reliable = 0,
/// <summary>
/// Unreliable delivery
/// </summary>
Unreliable
}
/// <summary>
/// <para>Represents the common base class for Rpc attributes.</para>
/// </summary>
public abstract class RpcAttribute : Attribute
{
/// <summary>
/// Type of RPC delivery method
/// </summary>
public RpcDelivery Delivery = RpcDelivery.Reliable;
}
/// <summary>
/// <para>Marks a method as ServerRpc.</para>
/// <para>A ServerRpc marked method will be fired by a client but executed on the server.</para>
/// </summary>
[AttributeUsage(AttributeTargets.Method)]
public class ServerRpcAttribute : RpcAttribute
{
/// <summary>
/// Whether or not the ServerRpc should only be run if executed by the owner of the object
/// </summary>
public bool RequireOwnership = true;
}
/// <summary>
/// <para>Marks a method as ClientRpc.</para>
/// <para>A ClientRpc marked method will be fired by the server but executed on clients.</para>
/// </summary>
[AttributeUsage(AttributeTargets.Method)]
public class ClientRpcAttribute : RpcAttribute { }
}