mirror of
https://github.com/NuclearPowered/Reactor.git
synced 2026-10-19 15:51:54 +00:00
Reformat code
This commit is contained in:
52 files changed
+2126
-2180
No files matched your search
@@ -1,40 +1,39 @@
|
||||
using Hazel;
|
||||
using Reactor.Networking;
|
||||
|
||||
namespace Reactor.Example
|
||||
namespace Reactor.Example;
|
||||
|
||||
[RegisterCustomRpc((uint) CustomRpcCalls.Example)]
|
||||
public class ExampleRpc : PlayerCustomRpc<ExamplePlugin, ExampleRpc.Data>
|
||||
{
|
||||
[RegisterCustomRpc((uint) CustomRpcCalls.Example)]
|
||||
public class ExampleRpc : PlayerCustomRpc<ExamplePlugin, ExampleRpc.Data>
|
||||
public ExampleRpc(ExamplePlugin plugin, uint id) : base(plugin, id)
|
||||
{
|
||||
public ExampleRpc(ExamplePlugin plugin, uint id) : base(plugin, id)
|
||||
}
|
||||
|
||||
public readonly struct Data
|
||||
{
|
||||
public readonly string Message;
|
||||
|
||||
public Data(string message)
|
||||
{
|
||||
}
|
||||
|
||||
public readonly struct Data
|
||||
{
|
||||
public readonly string Message;
|
||||
|
||||
public Data(string message)
|
||||
{
|
||||
Message = message;
|
||||
}
|
||||
}
|
||||
|
||||
public override RpcLocalHandling LocalHandling => RpcLocalHandling.None;
|
||||
|
||||
public override void Write(MessageWriter writer, Data data)
|
||||
{
|
||||
writer.Write(data.Message);
|
||||
}
|
||||
|
||||
public override Data Read(MessageReader reader)
|
||||
{
|
||||
return new Data(reader.ReadString());
|
||||
}
|
||||
|
||||
public override void Handle(PlayerControl innerNetObject, Data data)
|
||||
{
|
||||
Plugin.Log.LogWarning($"Handle: {innerNetObject.Data.PlayerName} sent \"{data.Message}\"");
|
||||
Message = message;
|
||||
}
|
||||
}
|
||||
|
||||
public override RpcLocalHandling LocalHandling => RpcLocalHandling.None;
|
||||
|
||||
public override void Write(MessageWriter writer, Data data)
|
||||
{
|
||||
writer.Write(data.Message);
|
||||
}
|
||||
|
||||
public override Data Read(MessageReader reader)
|
||||
{
|
||||
return new Data(reader.ReadString());
|
||||
}
|
||||
|
||||
public override void Handle(PlayerControl innerNetObject, Data data)
|
||||
{
|
||||
Plugin.Log.LogWarning($"Handle: {innerNetObject.Data.PlayerName} sent \"{data.Message}\"");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user