public static void ConvertToSlotSystem(string name, TitleScreen.GameSetup.PlayerModes mode) { string text = PlayerPrefsFile.GetPath(name); if (mode == TitleScreen.GameSetup.PlayerModes.Multiplayer) { text += "MP"; } if (File.Exists(text)) { string localSlotPath = SaveSlotUtils.GetLocalSlotPath(mode, TitleScreen.GameSetup.Slots.Slot1); if (!Directory.Exists(localSlotPath)) { Directory.CreateDirectory(localSlotPath); } File.Move(text, localSlotPath + name); } if (CoopSteamCloud.ShouldUseCloud() && CoopSteamCloud.CloudFileExist(name)) { Debug.Log("Converting cloud file: '" + name + "' to slot system"); byte[] buffer = CoopSteamCloud.CloudLoad(name); CoopSteamCloud.CloudDelete(name); if (CoopSteamCloud.CloudSave(SaveSlotUtils.GetCloudSlotPath() + name, buffer)) { Debug.Log(name + " converted successfully"); } else { Debug.Log(name + " update failed"); } } }
public static void DeleteKey(string name, bool useSlots = true) { string path = ((!useSlots) ? SaveSlotUtils.GetUserPath() : SaveSlotUtils.GetLocalSlotPath()) + name; string filename = ((!useSlots) ? string.Empty : SaveSlotUtils.GetCloudSlotPath()) + name; bool flag = File.Exists(path); bool flag2 = CoopSteamCloud.CloudFileExist(filename); if (flag) { File.Delete(path); } if (flag2 && CoopSteamCloud.ShouldUseCloud()) { CoopSteamCloud.CloudDelete(filename); } }
public static void DeleteSlot(PlayerModes mode, Slots slot) { string localSlotPath = SaveSlotUtils.GetLocalSlotPath(mode, slot); if (Directory.Exists(localSlotPath)) { SaveSlotUtils.DeleteDirectory(localSlotPath); } string[] array = CoopSteamCloud.ListFiles(); string cloudSlotPath = SaveSlotUtils.GetCloudSlotPath(mode, slot); for (int i = 0; i < array.Length; i++) { if (array[i].StartsWith(cloudSlotPath)) { CoopSteamCloud.CloudDelete(array[i]); } } }