예제 #1
0
 // Token: 0x0600065A RID: 1626 RVA: 0x00026178 File Offset: 0x00024578
 public void Save_Picture(SaveDataFormat sData, SaveType sType, int chgIdx, bool upDate)
 {
     if (sType != SaveType.Album)
     {
         if (sType == SaveType.Temp)
         {
             string text  = Define.PicSaveDict[SaveType.Temp] + DateTime.Now.ToString("yyyymmddhhmmssfff") + ".sav";
             string text2 = Define.SaveName_Binary_PicDir + text;
             byte[] array = sData.ConvertBinary_Picture(true, null, SaveType.Temp, chgIdx);
             if (!upDate)
             {
                 this.tmp_Path.Add(text);
             }
             File.WriteAllBytes(Define.SaveName_Binary_PicDir + this.tmp_Path[chgIdx], array);
             File.WriteAllBytes(Define.SaveName_Binary_PicDir + this.tmp_Path[chgIdx] + ".back", array);
             Debug.Log(string.Concat(new object[]
             {
                 "[SaveManager] 一時保存写真を保存しました: chgIdx = ",
                 chgIdx,
                 " [",
                 array.Length,
                 "] name = ",
                 this.tmp_Path[chgIdx]
             }));
         }
     }
     else
     {
         string text3  = Define.PicSaveDict[SaveType.Album] + DateTime.Now.ToString("yyyymmddhhmmssfff") + ".sav";
         string text4  = Define.SaveName_Binary_PicDir + text3;
         byte[] array2 = sData.ConvertBinary_Picture(true, null, SaveType.Album, chgIdx);
         if (!upDate)
         {
             this.album_Path.Add(text3);
         }
         File.WriteAllBytes(Define.SaveName_Binary_PicDir + this.album_Path[chgIdx], array2);
         File.WriteAllBytes(Define.SaveName_Binary_PicDir + this.album_Path[chgIdx] + ".back", array2);
         Debug.Log(string.Concat(new object[]
         {
             "[SaveManager] アルバム写真を保存しました: chgIdx = ",
             chgIdx,
             "[",
             this.album_Path.Count,
             "] (",
             array2.Length,
             ") name = ",
             this.album_Path[chgIdx]
         }));
     }
     this.Update_PictureIndex();
 }
예제 #2
0
    // Token: 0x06000661 RID: 1633 RVA: 0x0002668C File Offset: 0x00024A8C
    public IEnumerator Load_Picture_Tmp(SaveDataFormat lData)
    {
        bool back = false;
        int  i    = 0;

        while (i < this.tmp_Path.Count)
        {
            string lName_tmp = Define.SaveName_Binary_PicDir + this.tmp_Path[i];
            if (back)
            {
                lName_tmp += ".back";
            }
            byte[] lByte_tmp = new byte[0];
            try
            {
                lByte_tmp = File.ReadAllBytes(lName_tmp);
                lData.ConvertBinary_Picture(false, lByte_tmp, SaveType.Temp, i);
                if (back)
                {
                    this.Save_Picture_Update(lData, SaveType.Temp, i);
                }
            }
            catch (FileNotFoundException ex)
            {
                Debug.LogWarning(string.Concat(new object[]
                {
                    "[SaveManager] 一時保存写真 の読み込みに失敗しました (FileNotFoundException):",
                    i,
                    " / ",
                    lName_tmp,
                    " / ",
                    ex.ToString()
                }));
                this.Delete_Picture(lData, SaveType.Temp, i);
                if (this.tmp_Path.Count < lData.tmpPicture.Count)
                {
                    lData.tmpPicture.RemoveAt(i);
                }
                if (this.tmp_Path.Count < lData.tmpPictureId.Count)
                {
                    lData.tmpPictureId.RemoveAt(i);
                }
                i--;
                goto IL_41B;
            }
            catch (IsolatedStorageException ex2)
            {
                Debug.LogWarning(string.Concat(new object[]
                {
                    "[SaveManager] 一時保存写真 の読み込みに失敗しました (IsolatedStorageException):",
                    i,
                    " / ",
                    lName_tmp,
                    " / ",
                    ex2.ToString()
                }));
                this.Delete_Picture(lData, SaveType.Temp, i);
                if (this.tmp_Path.Count < lData.tmpPicture.Count)
                {
                    lData.tmpPicture.RemoveAt(i);
                }
                if (this.tmp_Path.Count < lData.tmpPictureId.Count)
                {
                    lData.tmpPictureId.RemoveAt(i);
                }
                i--;
                goto IL_41B;
            }
            catch (Exception ex3)
            {
                if (!back)
                {
                    Debug.LogWarning("[SaveManager] 一時保存写真 の読み込みに失敗したため、バックアップから復元します " + lName_tmp + " / " + ex3.ToString());
                    i--;
                    back = true;
                    goto IL_41B;
                }
                Debug.LogError("[SaveManager] 一時保存写真 のバックアップからの読み込みに失敗しました。写真を削除します。:" + lName_tmp + " / " + ex3.ToString());
                this.Delete_Picture(lData, SaveType.Temp, i);
                if (this.tmp_Path.Count < lData.tmpPicture.Count)
                {
                    lData.tmpPicture.RemoveAt(i);
                }
                if (this.tmp_Path.Count < lData.tmpPictureId.Count)
                {
                    lData.tmpPictureId.RemoveAt(i);
                }
                i--;
            }
            goto IL_3C3;
IL_41B:
            i++;
            continue;
IL_3C3:
            if (i % 2 == 1)
            {
                SuperGameMaster.LoadingProgress += 2f / (float)this.tmp_Path.Count * 5f;
                yield return(null);
            }
            back = false;
            goto IL_41B;
        }
        Debug.Log(string.Concat(new object[]
        {
            "[SaveManager] 一時保存写真 を読み込みました:",
            this.tmp_Path.Count,
            " / tmpPicture.Count = ",
            lData.tmpPicture.Count,
            " / tmpPictureId.Count = ",
            lData.tmpPictureId.Count
        }));
        yield return(null);

        yield break;
    }