protected override void Unload() { LogThis(DateTime.Now.ToString("s") + " TDM Unloaded", instance.Configuration.Instance.logFileName); UnturnedPlayerEvents.OnPlayerDeath -= UnturnedPlayerEvents_OnPlayerDeath; U.Events.OnPlayerConnected -= UnturnedEvents_OnPlayerConnected; U.Events.OnPlayerDisconnected -= UnturnedEvents_OnPlayerDisconnected; instance = null; status = null; playerList = null; }
public void LoadStatus() { XmlSerializer xs = new XmlSerializer(typeof(CStatus)); try { StreamReader sr = new StreamReader(instance.Configuration.Instance.statusFileName); status = (CStatus)xs.Deserialize(sr); sr.Close(); } catch (Exception ex) { Rocket.Core.Logging.Logger.LogException(ex, ex.Message); } if (status == null) { LogThis(DateTime.Now.ToString("s") + " No status loaded - using default", instance.Configuration.Instance.logFileName); status = new CStatus(); SaveStatus(); } }