2021-12-23 01:50:09 -08:00
|
|
|
|
using QSB.AuthoritySync;
|
|
|
|
|
using QSB.Messaging;
|
|
|
|
|
using QSB.OrbSync.WorldObjects;
|
|
|
|
|
using QSB.WorldSync;
|
|
|
|
|
|
2021-12-23 02:17:56 -08:00
|
|
|
|
namespace QSB.OrbSync.Messages
|
2021-12-23 01:50:09 -08:00
|
|
|
|
{
|
|
|
|
|
public class OrbDragMessage : QSBBoolWorldObjectMessage<QSBOrb>
|
|
|
|
|
{
|
|
|
|
|
public OrbDragMessage(bool isDragging) => Value = isDragging;
|
|
|
|
|
|
|
|
|
|
public override void OnReceiveLocal()
|
|
|
|
|
{
|
2021-12-25 22:37:20 -08:00
|
|
|
|
var qsbOrb = ObjectId.GetWorldObject<QSBOrb>();
|
2021-12-23 01:50:09 -08:00
|
|
|
|
|
|
|
|
|
if (QSBCore.IsHost && Value)
|
|
|
|
|
{
|
2022-01-14 22:07:32 -08:00
|
|
|
|
qsbOrb.TransformSync.netIdentity.UpdateAuthQueue(From, AuthQueueAction.Force);
|
2021-12-23 01:50:09 -08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void OnReceiveRemote()
|
|
|
|
|
{
|
2021-12-25 22:37:20 -08:00
|
|
|
|
var qsbOrb = ObjectId.GetWorldObject<QSBOrb>();
|
2021-12-23 01:50:09 -08:00
|
|
|
|
|
|
|
|
|
if (QSBCore.IsHost && Value)
|
|
|
|
|
{
|
2022-01-14 22:07:32 -08:00
|
|
|
|
qsbOrb.TransformSync.netIdentity.UpdateAuthQueue(From, AuthQueueAction.Force);
|
2021-12-23 01:50:09 -08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
qsbOrb.SetDragging(Value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|