From 3d9bbc0833f450aea8cdf58df327974ddd2eb80a Mon Sep 17 00:00:00 2001
From: XtraCube <72575280+XtraCube@users.noreply.github.com>
Date: Mon, 2 Sep 2024 13:01:34 -0400
Subject: [PATCH] comments
---
.../Modifiers/RegisterModifierAttribute.cs | 5 +++-
MiraAPI/Networking/MiraRpc.cs | 28 ++++++++++++++++++-
MiraAPI/Networking/NetData.cs | 19 ++++++++++++-
3 files changed, 49 insertions(+), 3 deletions(-)
diff --git a/MiraAPI/Modifiers/RegisterModifierAttribute.cs b/MiraAPI/Modifiers/RegisterModifierAttribute.cs
index 4c2fb56..4858b96 100644
--- a/MiraAPI/Modifiers/RegisterModifierAttribute.cs
+++ b/MiraAPI/Modifiers/RegisterModifierAttribute.cs
@@ -2,5 +2,8 @@
namespace MiraAPI.Modifiers;
+///
+/// Marks a class as a modifier that can be registered with the .
+///
[AttributeUsage(AttributeTargets.Class)]
-public class RegisterModifierAttribute : Attribute;
\ No newline at end of file
+public class RegisterModifierAttribute : Attribute;
diff --git a/MiraAPI/Networking/MiraRpc.cs b/MiraAPI/Networking/MiraRpc.cs
index 40861ce..5126dea 100644
--- a/MiraAPI/Networking/MiraRpc.cs
+++ b/MiraAPI/Networking/MiraRpc.cs
@@ -1,11 +1,37 @@
namespace MiraAPI.Networking;
+///
+/// Mira RPCs.
+///
public enum MiraRpc : uint
{
+ ///
+ /// Syncs the game options.
+ ///
SyncGameOptions,
+
+ ///
+ /// Syncs the role options.
+ ///
SyncRoleOptions,
+
+ ///
+ /// Adds a modifier to a player.
+ ///
AddModifier,
+
+ ///
+ /// Removes a modifier from a player.
+ ///
RemoveModifier,
+
+ ///
+ /// Syncs all modifiers at once.
+ ///
SyncModifiers,
+
+ ///
+ /// Custom Murder RPC.
+ ///
CustomMurder,
-}
\ No newline at end of file
+}
diff --git a/MiraAPI/Networking/NetData.cs b/MiraAPI/Networking/NetData.cs
index 083a9d2..ce5de46 100644
--- a/MiraAPI/Networking/NetData.cs
+++ b/MiraAPI/Networking/NetData.cs
@@ -1,8 +1,25 @@
namespace MiraAPI.Networking;
+///
+/// Used to network data and mark it with an ID.
+///
+/// The ID of the data.
+/// The byte[] data.
public readonly struct NetData(uint id, byte[] data)
{
+ ///
+ /// Gets the ID of the data.
+ ///
public uint Id { get; } = id;
+
+ ///
+ /// Gets the byte[] data.
+ ///
public byte[] Data { get; } = data;
+
+ ///
+ /// Gets the length of the data in bytes.
+ ///
+ /// An int representing the number of bytes this NetData takes up.
public int GetLength() => 4 + Data.Length;
-}
\ No newline at end of file
+}