mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
comments
This commit is contained in:
1 parent
b032e91e08
commit
3d9bbc0833
3 files changed
+49
-3
No files matched your search
@@ -2,5 +2,8 @@
|
||||
|
||||
namespace MiraAPI.Modifiers;
|
||||
|
||||
/// <summary>
|
||||
/// Marks a class as a modifier that can be registered with the <see cref="ModifierManager"/>.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class RegisterModifierAttribute : Attribute;
|
||||
public class RegisterModifierAttribute : Attribute;
|
||||
@@ -1,11 +1,37 @@
|
||||
namespace MiraAPI.Networking;
|
||||
|
||||
/// <summary>
|
||||
/// Mira RPCs.
|
||||
/// </summary>
|
||||
public enum MiraRpc : uint
|
||||
{
|
||||
/// <summary>
|
||||
/// Syncs the game options.
|
||||
/// </summary>
|
||||
SyncGameOptions,
|
||||
|
||||
/// <summary>
|
||||
/// Syncs the role options.
|
||||
/// </summary>
|
||||
SyncRoleOptions,
|
||||
|
||||
/// <summary>
|
||||
/// Adds a modifier to a player.
|
||||
/// </summary>
|
||||
AddModifier,
|
||||
|
||||
/// <summary>
|
||||
/// Removes a modifier from a player.
|
||||
/// </summary>
|
||||
RemoveModifier,
|
||||
|
||||
/// <summary>
|
||||
/// Syncs all modifiers at once.
|
||||
/// </summary>
|
||||
SyncModifiers,
|
||||
|
||||
/// <summary>
|
||||
/// Custom Murder RPC.
|
||||
/// </summary>
|
||||
CustomMurder,
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,25 @@
|
||||
namespace MiraAPI.Networking;
|
||||
|
||||
/// <summary>
|
||||
/// Used to network data and mark it with an ID.
|
||||
/// </summary>
|
||||
/// <param name="id">The ID of the data.</param>
|
||||
/// <param name="data">The byte[] data.</param>
|
||||
public readonly struct NetData(uint id, byte[] data)
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the ID of the data.
|
||||
/// </summary>
|
||||
public uint Id { get; } = id;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the byte[] data.
|
||||
/// </summary>
|
||||
public byte[] Data { get; } = data;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the length of the data in bytes.
|
||||
/// </summary>
|
||||
/// <returns>An int representing the number of bytes this NetData takes up.</returns>
|
||||
public int GetLength() => 4 + Data.Length;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user