Ejemplo n.º 1
0
        public void LoadDataComponents()
        {
            RaiseOnLoading();

            if (SyncLayer.AutoRegisterGameEvents)
            {
                SyncLayer.RegisterGameEvents();
            }

            Sync.Clients.SetLocalSteamId(Sync.MyId, createLocalClient: !(MyMultiplayer.Static is MyMultiplayerClient));
            Sync.Players.RegisterEvents();

            SetAsNotReady();

            HashSet <MySessionComponentBase> processedComponents = new HashSet <MySessionComponentBase>();

            do
            {
                m_sessionComponents.ApplyChanges();
                foreach (var comp in m_sessionComponents.Values)
                {
                    if (processedComponents.Contains(comp))
                    {
                        continue;
                    }
                    LoadComponent(comp);
                    processedComponents.Add(comp);
                }
            } while (m_sessionComponents.HasChanges());
        }