2021-12-25 23:45:40 -08:00

28 lines
592 B
C#

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