예제 #1
0
 private void NeedUpdate()
 {
     ModState.SaveState();
     if (Session.Instance.MpActive)
     {
         ModState.NetworkUpdate();
     }
 }
예제 #2
0
 public override bool IsSerialized()
 {
     if (MyAPIGateway.Multiplayer.IsServer)
     {
         if (Modulator.Storage != null)
         {
             ModState.SaveState();
             ModSet.SaveSettings();
         }
     }
     return(false);
 }
예제 #3
0
 private void SaveAndSendAll()
 {
     _firstSync = true;
     if (!_isServer)
     {
         return;
     }
     ModSet.SaveSettings();
     ModState.SaveState();
     ModSet.NetworkUpdate();
     ModState.NetworkUpdate();
     if (Session.Enforced.Debug >= 3)
     {
         Log.Line($"SaveAndSendAll: ModualtorId [{Modulator.EntityId}]");
     }
 }
예제 #4
0
        private void Timing()
        {
            if (_tock60 && !_isDedicated && MyAPIGateway.Gui.GetCurrentScreen == MyTerminalPageEnum.ControlPanel && Session.Instance.LastTerminalId == Modulator.EntityId)
            {
                Modulator.RefreshCustomInfo();
                MyCube.UpdateTerminal();
            }

            if (_tock33)
            {
                if (SettingsUpdated)
                {
                    SettingsUpdated = false;
                    ModSet.SaveSettings();
                    ModState.SaveState();
                    if (Session.Enforced.Debug == 3)
                    {
                        Log.Line($"SettingsUpdated: server:{_isServer} - ModulatorId [{Modulator.EntityId}]");
                    }
                }
            }
            else if (_tock34)
            {
                if (ClientUiUpdate)
                {
                    ClientUiUpdate = false;
                    MyCube.UpdateTerminal();
                    Modulator.RefreshCustomInfo();
                    if (!_isServer)
                    {
                        ModSet.NetworkUpdate();
                    }
                }
            }

            if (_isDedicated || (_subDelayed && _tick > _subTick + 9))
            {
                if (Session.Enforced.Debug == 3)
                {
                    Log.Line($"Delayed tick: {_tick} - hierarchytick: {_subTick}");
                }
                _subDelayed = false;
                HierarchyChanged();
            }
        }
예제 #5
0
        private void Timing()
        {
            if (_tock60 && !_isDedicated)
            {
                TerminalRefresh();
            }

            if (_tock33)
            {
                if (SettingsUpdated)
                {
                    SettingsUpdated = false;
                    ModSet.SaveSettings();
                    ModState.SaveState();
                    if (Session.Enforced.Debug == 3)
                    {
                        Log.Line($"SettingsUpdated: server:{_isServer} - ModulatorId [{Modulator.EntityId}]");
                    }
                }
            }
            else if (_tock34)
            {
                if (ClientUiUpdate)
                {
                    ClientUiUpdate = false;
                    MyCube.UpdateTerminal();
                    Modulator.RefreshCustomInfo();
                    if (!_isServer)
                    {
                        ModSet.NetworkUpdate();
                    }
                }
            }

            if (_isDedicated || (_subDelayed && _tick > _subTick + 9))
            {
                if (Session.Enforced.Debug == 3)
                {
                    Log.Line($"Delayed tick: {_tick} - hierarchytick: {_subTick}");
                }
                _subDelayed = false;
                HierarchyChanged();
            }
        }