Ejemplo n.º 1
0
        /// <summary>
        /// Saves the gpss to the file
        /// </summary>
        public override void SaveData()
        {
            if (!MySettingsSession.Static.IsEnabled())
            {
                return;
            }

            MyPluginLog.Log("Saving GPS manager data");

            MyObjectBuilder_WorldGpsData ob = new MyObjectBuilder_WorldGpsData();

            foreach (var entry in m_globalGpss)
            {
                PersistentGpsData item = new PersistentGpsData();
                item.Name      = entry.Value.Name;
                item.Color     = entry.Value.Color;
                item.Position  = entry.Value.Position;
                item.PlayerIds = entry.Value.Players;
                item.Id        = entry.Key;
                item.Hidden    = entry.Value.Hidden;

                ob.PersistentGpss.Add(item);
            }

            MyFileUtils.WriteXmlFileToWorld(ob, FILENAME);

            MyPluginLog.Log("Saving GPS manager data completed");
        }
 /// <summary>
 /// Saves the current sessions plugin settings to the world folder.
 /// </summary>
 public override void SaveData()
 {
     if (Sync.IsServer)
     {
         MyFileUtils.WriteXmlFileToWorld(Settings, FILE_NAME);
     }
 }
        /// <summary>
        /// Saves the system objects to a file, if the plugin is enabled.
        /// </summary>
        public override void SaveData()
        {
            if (MySettingsSession.Static.IsEnabled())
            {
                MyPluginLog.Log("Saving system data");

                MyFileUtils.WriteXmlFileToWorld(StarSystem, STORAGE_FILE);
            }
        }
        /// <summary>
        /// Unloads the used data of this session component.
        /// </summary>
        protected override void UnloadData()
        {
            MyPluginLog.Log("Unloading Session settings data");

            if (Sync.IsServer)
            {
                MyFileUtils.WriteXmlFileToWorld(Settings, FILE_NAME);
            }
            Settings = null;

            MySettings.Static.SessionSettings = null;

            MyPluginLog.Log("Unloading Session settings data completed");
        }