using Mirror; using QSB.Messaging; using QSB.WorldSync; namespace QSB.OwnershipSync; /// /// always sent to host /// public class OwnerQueueMessage : QSBMessage<(uint NetId, OwnerQueueAction Action)> { public OwnerQueueMessage(uint netId, OwnerQueueAction action) : base((netId, action)) => To = 0; public override bool ShouldReceive => QSBWorldSync.AllObjectsReady; public override void OnReceiveLocal() => OnReceiveRemote(); public override void OnReceiveRemote() => NetworkServer.spawned[Data.NetId].ServerUpdateOwnerQueue(From, Data.Action); } public enum OwnerQueueAction { /// /// add player to the queue /// Add, /// /// remove player from the queue /// Remove, /// /// add player to the queue and force them to the front /// Force }