public override void OnServerReceive(PlayerMessage message) { DebugLog.DebugWrite($"Server get state request from {message.FromId}"); PlayerState.LocalInstance.Send(); foreach (var item in PlayerRegistry.GetSyncObjects <TransformSync.TransformSync>() .Where(x => x != null && x.IsReady && x.ReferenceSector != null)) { GlobalMessenger <uint, QSBSector> .FireEvent(EventNames.QSBSectorChange, item.netId.Value, item.ReferenceSector); } }
private void Update() { if (!QSBSectorManager.Instance.IsReady) { return; } _checkTimer += Time.unscaledDeltaTime; if (_checkTimer < CheckInterval) { return; } PlayerRegistry.GetSyncObjects <TransformSync>().Where(x => x.IsLocal).ToList().ForEach(CheckTransformSyncSector); _checkTimer = 0; }