private void HandleActionSavesResolved(GK_SavesResolveResult res) { ISN_GameSaves.ActionSavesResolved -= HandleActionSavesResolved; if (res.IsSucceeded) { Debug.Log("The conflict is resolved"); foreach (GK_SavedGame game in res.SavedGames) { SavesConflicts.Remove(game.Name); if (!GameSaves.ContainsKey(game.Name)) { GameSaves.Add(game.Name, new List <GK_SavedGame> ()); GameSaves [game.Name].Add(game); } } Debug.Log("------------------------------------------"); Debug.Log("Duplicates " + SavesConflicts.Count); Debug.Log("Unique saves " + GameSaves.Count); Debug.Log("------------------------------------------"); foreach (GK_SavedGame game in res.SavedGames) { Debug.Log("The name of the save game " + game.Name); } } else { Debug.Log("Failed: " + res.Error.Description); } }
public void OnResolveSuccess(string data) { List <GK_SavedGame> gamesList = new List <GK_SavedGame>(); string[] DataArray = data.Split(new string[] { SA.Common.Data.Converter.DATA_SPLITTER2 }, StringSplitOptions.None); for (int i = 0; i < DataArray.Length; i++) { if (DataArray[i] == SA.Common.Data.Converter.DATA_EOF) { break; } GK_SavedGame gameSave = DeserializeGameSave(DataArray[i]); gamesList.Add(gameSave); } GK_SavesResolveResult result = new GK_SavesResolveResult(gamesList); ActionSavesResolved(result); }
private void HandleActionSavesResolved (GK_SavesResolveResult res) { ISN_GameSaves.ActionSavesResolved -= HandleActionSavesResolved; if(res.IsSucceeded) { ISN_Logger.Log("The conflict is resolved"); foreach (GK_SavedGame game in res.SavedGames) { SavesConflicts.Remove (game.Name); if (!GameSaves.ContainsKey (game.Name)) { GameSaves.Add (game.Name, new List<GK_SavedGame> ()); GameSaves [game.Name].Add (game); } } ISN_Logger.Log("------------------------------------------"); ISN_Logger.Log("Duplicates " + SavesConflicts.Count); ISN_Logger.Log("Unique saves " + GameSaves.Count); ISN_Logger.Log("------------------------------------------"); foreach (GK_SavedGame game in res.SavedGames) { ISN_Logger.Log("The name of the save game " + game.Name); } } else { ISN_Logger.Log("Failed: " + res.Error.Description); } }
public void OnResolveFailed(string errorData) { GK_SavesResolveResult result = new GK_SavesResolveResult(errorData); ActionSavesResolved(result); }