public static void SavePersistentPlayerDataXML() { if (GameManager.Instance.persistentPlayers != null) { GameManager.Instance.persistentPlayers.Write(GameIO.GetSaveGameDir(null, null) + "/players.xml"); } }
public static void ResetHardcoreProfile(ClientInfo _cInfo) { try { string filepath1 = string.Format("{0}/Player/{1}.map", GameIO.GetSaveGameDir(), _cInfo.CrossplatformId.CombinedString); string filepath2 = string.Format("{0}/Player/{1}.ttp", GameIO.GetSaveGameDir(), _cInfo.CrossplatformId.CombinedString); if (!File.Exists(filepath1)) { SingletonMonoBehaviour <SdtdConsole> .Instance.Output(string.Format("Could not find file {0}.map", _cInfo.CrossplatformId.CombinedString)); } else { File.Delete(filepath1); } if (!File.Exists(filepath2)) { SingletonMonoBehaviour <SdtdConsole> .Instance.Output(string.Format("Could not find file {0}.ttp", _cInfo.CrossplatformId.CombinedString)); } else { File.Delete(filepath2); } RemovePlayerData(_cInfo); } catch (Exception e) { Log.Out(string.Format("[SERVERTOOLS] Error in Hardcore.ResetHardcoreProfile: {0}", e.Message)); } }
public static void RemoveProfile(string _id) { try { string filepath1 = string.Format("{0}/Player/{1}.map", GameIO.GetSaveGameDir(), _id); string filepath2 = string.Format("{0}/Player/{1}.ttp", GameIO.GetSaveGameDir(), _id); if (!File.Exists(filepath1)) { SingletonMonoBehaviour <SdtdConsole> .Instance.Output(string.Format("[SERVERTOOLS] Could not find file {0}.map", _id)); } else { File.Delete(filepath1); } if (!File.Exists(filepath2)) { SingletonMonoBehaviour <SdtdConsole> .Instance.Output(string.Format("[SERVERTOOLS] Could not find file {0}.ttp", _id)); } else { File.Delete(filepath2); } } catch (Exception e) { Log.Out(string.Format("[SERVERTOOLS] Error in ResetPlayerConsole.RemoveProfile: {0}", e.Message)); } }