2021-12-23 01:50:09 -08:00
|
|
|
|
using QSB.AuthoritySync;
|
|
|
|
|
using QSB.Messaging;
|
|
|
|
|
using QSB.OrbSync.WorldObjects;
|
|
|
|
|
|
2021-12-23 02:17:56 -08:00
|
|
|
|
namespace QSB.OrbSync.Messages
|
2021-12-23 01:50:09 -08:00
|
|
|
|
{
|
2022-01-26 20:35:43 -08:00
|
|
|
|
public class OrbDragMessage : QSBWorldObjectMessage<QSBOrb, bool>
|
2021-12-23 01:50:09 -08:00
|
|
|
|
{
|
|
|
|
|
public OrbDragMessage(bool isDragging) => Value = isDragging;
|
|
|
|
|
|
|
|
|
|
public override void OnReceiveLocal()
|
|
|
|
|
{
|
|
|
|
|
if (QSBCore.IsHost && Value)
|
|
|
|
|
{
|
2022-02-12 21:40:04 -08:00
|
|
|
|
WorldObject.TransformSync.netIdentity.ServerUpdateAuthQueue(From, AuthQueueAction.Force);
|
2021-12-23 01:50:09 -08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void OnReceiveRemote()
|
|
|
|
|
{
|
2022-01-26 20:20:03 -08:00
|
|
|
|
OnReceiveLocal();
|
|
|
|
|
WorldObject.SetDragging(Value);
|
2021-12-23 01:50:09 -08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|