mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-29 09:32:38 +00:00
23 lines
680 B
C#
23 lines
680 B
C#
using QSB.Messaging;
|
|
using QSB.Player;
|
|
using QSB.QuantumSync;
|
|
using QSB.WorldSync;
|
|
|
|
namespace QSB.Tools.ProbeLauncherTool.Messages;
|
|
|
|
public class PlayerLauncherTakeSnapshotMessage : QSBMessage<ProbeCamera.ID>
|
|
{
|
|
public PlayerLauncherTakeSnapshotMessage(ProbeCamera.ID cameraId) : base(cameraId) { }
|
|
|
|
public override bool ShouldReceive => QSBWorldSync.AllObjectsReady;
|
|
|
|
public override void OnReceiveLocal() => QuantumManager.OnTakeProbeSnapshot(QSBPlayerManager.LocalPlayer, Data);
|
|
|
|
public override void OnReceiveRemote()
|
|
{
|
|
var player = QSBPlayerManager.GetPlayer(From);
|
|
player.ProbeLauncherTool.TakeSnapshot();
|
|
QuantumManager.OnTakeProbeSnapshot(player, Data);
|
|
}
|
|
}
|