mirror of
https://github.com/NuclearPowered/Reactor.git
synced 2026-10-19 15:51:54 +00:00
Make example rpc messages more verbose
This commit is contained in:
2 files changed
+8
-4
No files matched your search
@@ -38,9 +38,13 @@ namespace Reactor.Example
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.F3) && AmongUsClient.Instance && PlayerControl.LocalPlayer)
|
||||
{
|
||||
Plugin.Log.LogWarning("Sending example rpc");
|
||||
Rpc<ExampleRpc>.Instance.Send(new ExampleRpc.Data("Cześć :)"));
|
||||
Rpc<ExampleRpc>.Instance.SendTo(AmongUsClient.Instance.HostId, new ExampleRpc.Data("host :O"));
|
||||
var name = PlayerControl.LocalPlayer.Data.PlayerName;
|
||||
Rpc<ExampleRpc>.Instance.Send(new ExampleRpc.Data($"Send: from {name}"));
|
||||
|
||||
if (!AmongUsClient.Instance.AmHost)
|
||||
{
|
||||
Rpc<ExampleRpc>.Instance.SendTo(AmongUsClient.Instance.HostId, new ExampleRpc.Data($"SendTo: from {name} to host"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Reactor.Example
|
||||
|
||||
public override void Handle(PlayerControl innerNetObject, Data data)
|
||||
{
|
||||
Plugin.Log.LogWarning($"{innerNetObject.Data.PlayerId} sent \"{data.Message}\"");
|
||||
Plugin.Log.LogWarning($"Handle: {innerNetObject.Data.PlayerName} sent \"{data.Message}\"");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user