Make example rpc messages more verbose

This commit is contained in:
js6pak committed 2021-05-10 10:20:27 +02:00
1 parent a925a5355e
commit 1c4aaa90c0
2 files changed
+8 -4

No files matched your search

+7 -3
View File
@@ -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"));
}
}
}
}
+1 -1
View File
@@ -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}\"");
}
}
}