quantum-space-buddies/QSB/Tools/ProbeTool/Messages/PlayerProbeEventMessage.cs
2022-03-10 17:57:50 -08:00

24 lines
538 B
C#

using QSB.Messaging;
using QSB.Player;
using QSB.WorldSync;
namespace QSB.Tools.ProbeTool.Messages;
internal class PlayerProbeEventMessage : QSBMessage<ProbeEvent>
{
public PlayerProbeEventMessage(ProbeEvent probeEvent) : base(probeEvent) { }
public override bool ShouldReceive => QSBWorldSync.AllObjectsReady;
public override void OnReceiveRemote()
{
var player = QSBPlayerManager.GetPlayer(From);
if (!player.IsReady || player.Probe == null)
{
return;
}
var probe = player.Probe;
probe.HandleEvent(Data);
}
}