mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-04 02:47:22 +00:00
36 lines
811 B
C#
36 lines
811 B
C#
using QSB.AuthoritySync;
|
|
using QSB.Messaging;
|
|
using QSB.OrbSync.WorldObjects;
|
|
using QSB.WorldSync;
|
|
|
|
namespace QSB.OrbSync.Messages
|
|
{
|
|
public class OrbDragMessage : QSBBoolWorldObjectMessage<QSBOrb>
|
|
{
|
|
public OrbDragMessage(bool isDragging) => Value = isDragging;
|
|
|
|
public OrbDragMessage() { }
|
|
|
|
public override void OnReceiveLocal()
|
|
{
|
|
var qsbOrb = QSBWorldSync.GetWorldFromId<QSBOrb>(ObjectId);
|
|
|
|
if (QSBCore.IsHost && Value)
|
|
{
|
|
qsbOrb.TransformSync.NetIdentity.UpdateAuthQueue(From, AuthQueueAction.Force);
|
|
}
|
|
}
|
|
|
|
public override void OnReceiveRemote()
|
|
{
|
|
var qsbOrb = QSBWorldSync.GetWorldFromId<QSBOrb>(ObjectId);
|
|
|
|
if (QSBCore.IsHost && Value)
|
|
{
|
|
qsbOrb.TransformSync.NetIdentity.UpdateAuthQueue(From, AuthQueueAction.Force);
|
|
}
|
|
|
|
qsbOrb.SetDragging(Value);
|
|
}
|
|
}
|
|
} |