2021-12-25 23:45:40 -08:00
|
|
|
|
using QSB.Messaging;
|
|
|
|
|
using QSB.Player;
|
|
|
|
|
using QSB.WorldSync;
|
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
namespace QSB.Tools.ProbeTool.Messages;
|
|
|
|
|
|
|
|
|
|
internal class PlayerProbeEventMessage : QSBMessage<ProbeEvent>
|
2021-12-25 23:45:40 -08:00
|
|
|
|
{
|
2022-03-10 17:57:50 -08:00
|
|
|
|
public PlayerProbeEventMessage(ProbeEvent probeEvent) : base(probeEvent) { }
|
2021-12-25 23:45:40 -08:00
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
public override bool ShouldReceive => QSBWorldSync.AllObjectsReady;
|
2021-12-25 23:45:40 -08:00
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
public override void OnReceiveRemote()
|
|
|
|
|
{
|
|
|
|
|
var player = QSBPlayerManager.GetPlayer(From);
|
|
|
|
|
if (!player.IsReady || player.Probe == null)
|
2021-12-25 23:45:40 -08:00
|
|
|
|
{
|
2022-03-02 19:46:33 -08:00
|
|
|
|
return;
|
2022-02-27 04:40:44 -08:00
|
|
|
|
}
|
2022-03-02 19:46:33 -08:00
|
|
|
|
|
|
|
|
|
var probe = player.Probe;
|
|
|
|
|
probe.HandleEvent(Data);
|
2021-12-25 23:45:40 -08:00
|
|
|
|
}
|
2022-02-24 22:04:54 -08:00
|
|
|
|
}
|