Exemplo n.º 1
0
 private void OnFinishedSync(DataSerializerErrorCode errNo, Boolean isSuccess, SharedDataPreviewSlot localData, SharedDataPreviewSlot cloudData)
 {
     this.isSyncSuccess = (isSuccess && errNo == DataSerializerErrorCode.Success);
     if (this.isSyncSuccess)
     {
         this.corruptFile      = CloudUI.Sync.None;
         this.isLocalFileExist = (localData != (SharedDataPreviewSlot)null);
         this.isCloudFileExist = (cloudData != (SharedDataPreviewSlot)null);
         this.localPreview     = localData;
         this.cloudPreview     = cloudData;
         if (this.isLocalFileExist)
         {
             FF9StateSystem.Serializer.GetLocalSaveLatestTimestamp(new ISharedDataSerializer.OnGetLatestSaveTimestamp(this.OnFinishGetTimeLocal));
         }
         else
         {
             this.OnFinishGetTimeLocal(DataSerializerErrorCode.Success, true, 0.0);
         }
     }
     else
     {
         if (localData == null)
         {
             this.corruptFile = CloudUI.Sync.Upload;
         }
         else if (cloudData == null)
         {
             this.corruptFile = CloudUI.Sync.Download;
         }
         this.isLocalFileExist = (localData != (SharedDataPreviewSlot)null);
         this.isCloudFileExist = (cloudData != (SharedDataPreviewSlot)null);
         this.localPreview     = localData;
         this.cloudPreview     = cloudData;
         if (this.currentState == CloudUI.State.LoadPreview)
         {
             base.StartCoroutine(this.OnFinishedLoadPreview_delay(false));
         }
         else if (this.currentState == CloudUI.State.Sync)
         {
             base.StartCoroutine(this.OnFinishedSync_delay(false));
         }
     }
 }
Exemplo n.º 2
0
    private void DisplayFileInfo(CloudUI.FileCloudInfoHUD fileHud, SharedDataPreviewSlot file, Boolean isCorrupt, DataSerializerErrorCode status)
    {
        fileHud.Self.SetActive(true);
        if (file != null)
        {
            fileHud.Container.SetActive(true);
            fileHud.EmptySlotTextGameObject.SetActive(false);
            Int32   num   = 1;
            String  text  = String.Empty;
            String  empty = String.Empty;
            Boolean flag  = false;
            Int32   num2  = 0;
            foreach (SharedDataPreviewCharacterInfo sharedDataPreviewCharacterInfo in file.CharacterInfoList)
            {
                fileHud.CharacterAvatarList[num2].alpha      = 0f;
                fileHud.CharacterAvatarList[num2].spriteName = String.Empty;
                if (sharedDataPreviewCharacterInfo != null)
                {
                    if (!flag)
                    {
                        num  = sharedDataPreviewCharacterInfo.Level;
                        text = sharedDataPreviewCharacterInfo.Name;
                        flag = true;
                    }
                    fileHud.CharacterAvatarList[num2].alpha = 1f;
                    FF9UIDataTool.DisplayCharacterAvatar(sharedDataPreviewCharacterInfo.SerialID, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), fileHud.CharacterAvatarList[num2], false);
                }
                num2++;
            }
            fileHud.LeaderNameLabel.text   = text;
            fileHud.LeaderLvLabel.text     = num.ToString();
            fileHud.GilLabel.text          = file.Gil.ToString() + "[YSUB=1.3][sub]G";
            fileHud.LocationNameLabel.text = file.Location;
            Color  color = FF9TextTool.White;
            Double num3  = (Double)(file.PlayDuration % 360000f);
            switch ((Int32)(file.PlayDuration / 360000f))
            {
            case 0:
                color = FF9TextTool.White;
                break;

            case 1:
                color = FF9TextTool.Red;
                break;

            case 2:
                color = FF9TextTool.Yellow;
                break;

            case 3:
                color = FF9TextTool.Cyan;
                break;

            case 4:
                color = FF9TextTool.Magenta;
                break;

            case 5:
                color = FF9TextTool.Green;
                break;

            default:
                num3  = 359999.0;
                color = FF9TextTool.Green;
                break;
            }
            String text2 = ((Int32)(num3 / 3600.0)).ToString("0#");
            String text3 = ((Int32)(num3 / 60.0) % 60).ToString("0#");
            String text4 = ((Int32)num3 % 60).ToString("0#");
            fileHud.TimeLabel.color = color;
            fileHud.TimeLabel.text  = String.Concat(new String[]
            {
                text2,
                " : ",
                text3,
                " : ",
                text4
            });
            this.DisplayWindowBackground(fileHud.Self, (file.win_type != 0UL) ? FF9UIDataTool.BlueAtlas : FF9UIDataTool.GrayAtlas);
        }
        else
        {
            fileHud.Container.SetActive(false);
            fileHud.EmptySlotTextGameObject.SetActive(true);
            fileHud.EmptySlotTextLabel.color = FF9TextTool.White;
            if (isCorrupt)
            {
                switch (status)
                {
                case DataSerializerErrorCode.FileCorruption:
                case DataSerializerErrorCode.DataCorruption:
                    fileHud.EmptySlotTextLabel.text  = Localization.Get("LocalDecryptFailed");
                    fileHud.EmptySlotTextLabel.color = FF9TextTool.Red;
                    goto IL_3E7;

                case DataSerializerErrorCode.CloudDataCorruption:
                    fileHud.EmptySlotTextLabel.text  = Localization.Get("CloudDataCorrupt");
                    fileHud.EmptySlotTextLabel.color = FF9TextTool.Red;
                    goto IL_3E7;

                case DataSerializerErrorCode.CloudConnectionTimeout:
                    fileHud.EmptySlotTextLabel.text = Localization.Get("CloudConnectionTimeout");
                    goto IL_3E7;

                case DataSerializerErrorCode.CloudDataUnknownError:
                    fileHud.EmptySlotTextLabel.text = Localization.Get("CloudDataUnknownError");
                    goto IL_3E7;
                }
                fileHud.EmptySlotTextLabel.text = Localization.Get("EmptyFile");
                IL_3E7 :;
            }
            else
            {
                fileHud.EmptySlotTextLabel.text = Localization.Get("EmptyFile");
            }
            this.UpdateEmptySlotLabelSize(fileHud.EmptySlotTextLabel);
        }
    }
Exemplo n.º 3
0
 private void OnFinishedSaveFile(DataSerializerErrorCode errNo, Int32 slotID, Int32 saveID, Boolean isSuccess, SharedDataPreviewSlot data)
 {
     base.StartCoroutine(this.OnFinishedSaveFile_delay(errNo, slotID, saveID, isSuccess, data));
 }
Exemplo n.º 4
0
    private IEnumerator OnFinishedSaveFile_delay(DataSerializerErrorCode errNo, Int32 slotID, Int32 saveID, Boolean isSuccess, SharedDataPreviewSlot data)
    {
        Single remainTime = Mathf.Max(2f - (Time.time - this.timeCounter), 0f);

        yield return(new WaitForSeconds(remainTime));

        this.progressBar.value = 1f;
        yield return(new WaitForSeconds(0.1f));

        base.Loading = false;
        this.LoadingAccessPanel.SetActive(false);
        if (isSuccess && errNo == DataSerializerErrorCode.Success)
        {
            FF9Sfx.FF9SFX_Play(1261);
            this.isFileExistList[this.currentFile] = true;
            this.isFileCorrupt[this.currentFile]   = false;
            this.DisplayFileInfo(this.currentFile, data);
            this.DisplaySuccessfulAccessDialog();
        }
        else
        {
            FF9Sfx.FF9SFX_Play(1046);
            global::Debug.Log("DISPLAYING CORRUPT DIALOG 2");
            FF9UIDataTool.DisplayTextLocalize(this.HelpTitleLabel, "SaveHelpBlock");
            global::Debug.LogError("Cannot save file");
            this.DisplayCorruptAccessDialog(SaveLoadUI.FileGroupButton, SaveLoadUI.SerializeType.Save, errNo);
            this.isFileCorrupt[saveID] = true;
        }
        yield break;
    }
Exemplo n.º 5
0
    private void DisplayFileInfo(Int32 index, SharedDataPreviewSlot file)
    {
        SaveLoadUI.FileInfoHUD fileInfoHUD = this.fileInfoHudList[index];
        fileInfoHUD.Self.SetActive(true);
        fileInfoHUD.FileNoLabel.text = String.Format(Localization.Get("FileNo"), (index + 1).ToString("0#"));
        if (file != null && !this.isFileCorrupt[index] && !file.IsPreviewCorrupted)
        {
            fileInfoHUD.Container.SetActive(true);
            fileInfoHUD.EmptySlotTextGameObject.SetActive(false);
            Int32   num   = 1;
            String  text  = String.Empty;
            String  text2 = String.Empty;
            Boolean flag  = false;
            Int32   num2  = 0;
            foreach (SharedDataPreviewCharacterInfo sharedDataPreviewCharacterInfo in file.CharacterInfoList)
            {
                fileInfoHUD.CharacterAvatarList[num2].alpha      = 0f;
                fileInfoHUD.CharacterAvatarList[num2].spriteName = String.Empty;
                if (sharedDataPreviewCharacterInfo != null)
                {
                    if (!flag)
                    {
                        num  = sharedDataPreviewCharacterInfo.Level;
                        text = sharedDataPreviewCharacterInfo.Name;
                        flag = true;
                    }
                    fileInfoHUD.CharacterAvatarList[num2].alpha = 1f;
                    FF9UIDataTool.DisplayCharacterAvatar(sharedDataPreviewCharacterInfo.SerialID, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), fileInfoHUD.CharacterAvatarList[num2], false);
                    String text3 = text2;
                    text2 = String.Concat(new String[]
                    {
                        text3,
                        sharedDataPreviewCharacterInfo.Name,
                        "[XTAB=80][YADD=4]",
                        Localization.Get("LvDialogIcon"),
                        "[YSUB=2][FEED=1] ",
                        sharedDataPreviewCharacterInfo.Level.ToString(),
                        "\n"
                    });
                }
                num2++;
            }
            fileInfoHUD.LeaderNameLabel.text   = text;
            fileInfoHUD.LeaderLvLabel.text     = num.ToString();
            fileInfoHUD.GilLabel.text          = file.Gil.ToString() + "[YSUB=1.3][sub]G";
            fileInfoHUD.LocationNameLabel.text = file.Location;
            Color  color = FF9TextTool.White;
            Double num3  = (Double)(file.PlayDuration % 360000f);
            switch ((Int32)(file.PlayDuration / 360000f))
            {
            case 0:
                color = FF9TextTool.White;
                break;

            case 1:
                color = FF9TextTool.Red;
                break;

            case 2:
                color = FF9TextTool.Yellow;
                break;

            case 3:
                color = FF9TextTool.Cyan;
                break;

            case 4:
                color = FF9TextTool.Magenta;
                break;

            case 5:
                color = FF9TextTool.Green;
                break;

            default:
                num3  = 359999.0;
                color = FF9TextTool.Green;
                break;
            }
            String text4 = ((Int32)(num3 / 3600.0)).ToString("0#");
            String text5 = ((Int32)(num3 / 60.0) % 60).ToString("0#");
            String text6 = ((Int32)num3 % 60).ToString("0#");
            fileInfoHUD.TimeLabel.color = color;
            fileInfoHUD.TimeLabel.text  = String.Concat(new String[]
            {
                text4,
                " : ",
                text5,
                " : ",
                text6
            });
            this.DisplayWindowBackground(fileInfoHUD.Self, (file.win_type != 0UL) ? FF9UIDataTool.BlueAtlas : FF9UIDataTool.GrayAtlas);
            fileInfoHUD.Button.Help.TextKey = String.Empty;
            fileInfoHUD.Button.Help.Text    = text2.Remove(text2.Length - 1);
        }
        else if (file == null)
        {
            fileInfoHUD.Container.SetActive(false);
            fileInfoHUD.EmptySlotTextGameObject.SetActive(true);
            if (this.isFileCorrupt[index])
            {
                fileInfoHUD.Button.Help.TextKey      = "CorruptFile";
                fileInfoHUD.EmptySlotTextLabel.text  = Localization.Get("CorruptFile");
                fileInfoHUD.EmptySlotTextLabel.color = FF9TextTool.Red;
            }
            else
            {
                fileInfoHUD.Button.Help.TextKey      = "NoSaveHelp";
                fileInfoHUD.EmptySlotTextLabel.text  = Localization.Get("EmptyFile");
                fileInfoHUD.EmptySlotTextLabel.color = FF9TextTool.White;
            }
            this.DisplayWindowBackground(fileInfoHUD.Self, (UIAtlas)null);
        }
        else if (file.IsPreviewCorrupted)
        {
            fileInfoHUD.Container.SetActive(false);
            fileInfoHUD.EmptySlotTextGameObject.SetActive(true);
            fileInfoHUD.Button.Help.TextKey      = "CorruptFile";
            fileInfoHUD.EmptySlotTextLabel.text  = Localization.Get("CorruptFile");
            fileInfoHUD.EmptySlotTextLabel.color = FF9TextTool.Red;
            this.DisplayWindowBackground(fileInfoHUD.Self, (UIAtlas)null);
        }
    }
Exemplo n.º 6
0
    private void SaveDataFinishDelegate(DataSerializerErrorCode errNo, Int32 slotID, Int32 saveID, Boolean isSuccess, SharedDataPreviewSlot preview)
    {
        global::Debug.Log("SaveDataFinishDelegate()");
        PersistenSingleton <UIManager> .Instance.SetPlayerControlEnable(true, (Action)null);

        if (!PersistenSingleton <EventEngine> .Instance.GetUserControl())
        {
            PersistenSingleton <UIManager> .Instance.IsPlayerControlEnable = false;
        }
    }
Exemplo n.º 7
0
    private IEnumerator ReadSlotPreviewInCoroutine(SharedDataBytesStorage.MetaData metaData, Int32 slotID, Stream stream, BinaryReader reader, ISharedDataEncryption encryption, ISharedDataStorage.OnLoadSlotFinish onFinishDelegate)
    {
        List <SharedDataPreviewSlot> list = new List <SharedDataPreviewSlot>();

        metaData.Read(stream, reader, encryption);
        stream.Seek((Int64)(320 - (Int32)stream.Position), SeekOrigin.Current);
        Int32 seekTo = slotID * 1024 * 15;

        ISharedDataLog.Log("Seek to: " + seekTo);
        stream.Seek((Int64)seekTo, SeekOrigin.Current);
        Int32 previewCipherSize = encryption.GetCipherSize(965);
        Int32 i = 0;

        while (i < 15)
        {
            yield return(onFinishDelegate);

            Int32  prevPosition = (Int32)stream.Position;
            Int32  seekSize     = 0;
            Byte[] cipherText   = new Byte[previewCipherSize];
            reader.Read(cipherText, 0, (Int32)cipherText.Length);
            Byte[] plainText = null;
            try
            {
                plainText = encryption.Decrypt(cipherText);
            }
            catch (Exception ex2)
            {
                Exception ex = ex2;
                list.Add(new SharedDataPreviewSlot
                {
                    IsPreviewCorrupted = true
                });
                ISharedDataLog.LogError(ex);
                ISharedDataSerializer.LastErrno = DataSerializerErrorCode.DataCorruption;
                seekSize = 1024 - ((Int32)stream.Position - prevPosition);
                stream.Seek((Int64)seekSize, SeekOrigin.Current);
                goto IL_597;
            }
            goto IL_1CC;
IL_597:
            i++;
            continue;
IL_1CC:
            Boolean isValidPreview = false;
            SharedDataPreviewSlot preview = new SharedDataPreviewSlot();
            using (MemoryStream memStram = new MemoryStream(plainText))
            {
                using (BinaryReader memReader = new BinaryReader(memStram))
                {
                    Char[] chs = memReader.ReadChars(4);
                    if (chs[0] == 'N' && chs[1] == 'O' && chs[2] == 'N' && chs[3] == 'E')
                    {
                        list.Add((SharedDataPreviewSlot)null);
                        seekSize = 1024 - ((Int32)stream.Position - prevPosition);
                        stream.Seek((Int64)seekSize, SeekOrigin.Current);
                        goto IL_597;
                    }
                    if (chs[0] != 'P' || chs[1] != 'R' || chs[2] != 'E' || chs[3] != 'V')
                    {
                        list.Add(new SharedDataPreviewSlot
                        {
                            IsPreviewCorrupted = true
                        });
                        ISharedDataLog.LogError("Error! seek to NOT preview position");
                        seekSize = 1024 - ((Int32)stream.Position - prevPosition);
                        stream.Seek((Int64)seekSize, SeekOrigin.Current);
                        goto IL_597;
                    }
                    preview.CharacterInfoList = new List <SharedDataPreviewCharacterInfo>();
                    preview.HasData           = memReader.ReadBoolean();
                    preview.Gil          = memReader.ReadInt64();
                    preview.PlayDuration = memReader.ReadUInt64();
                    preview.win_type     = memReader.ReadUInt64();
                    preview.Location     = Encoding.UTF8.GetString(memReader.ReadBytes(128), 0, 128);
                    preview.Location     = preview.Location.Trim(new Char[1]);
                    if (preview.HasData)
                    {
                        isValidPreview = true;
                    }
                    for (Int32 j = 0; j < 4; j++)
                    {
                        SharedDataPreviewCharacterInfo cInfo = new SharedDataPreviewCharacterInfo();
                        cInfo.SerialID = memReader.ReadInt32();
                        cInfo.Level    = memReader.ReadInt32();
                        cInfo.Name     = Encoding.UTF8.GetString(memReader.ReadBytes(128), 0, 128);
                        cInfo.Name     = cInfo.Name.Trim(new Char[1]);
                        if (cInfo.SerialID == -1)
                        {
                            preview.CharacterInfoList.Add((SharedDataPreviewCharacterInfo)null);
                        }
                        else
                        {
                            preview.CharacterInfoList.Add(cInfo);
                        }
                    }
                    preview.Timestamp = memReader.ReadDouble();
                }
            }
            if (isValidPreview)
            {
                list.Add(preview);
            }
            else
            {
                list.Add((SharedDataPreviewSlot)null);
            }
            seekSize = 1024 - ((Int32)stream.Position - prevPosition);
            stream.Seek((Int64)seekSize, SeekOrigin.Current);
            goto IL_597;
        }
        onFinishDelegate(slotID, list);
        yield break;
    }
Exemplo n.º 8
0
    public void WriteSlotPreview(SharedDataPreviewSlot previewSlot, SharedDataBytesStorage.MetaData metaData, Int32 saveID, Int32 slotID, Stream stream, BinaryReader reader, BinaryWriter writer, ISharedDataEncryption encryption, ISharedDataStorage.OnSaveSlotFinish onFinishDelegate)
    {
        stream.Seek((Int64)(320 - (Int32)stream.Position), SeekOrigin.Current);
        Int32 num = slotID * 1024 * 15 + saveID * 1024;

        ISharedDataLog.Log("Seek to: " + num);
        stream.Seek((Int64)num, SeekOrigin.Current);
        Int32 num2       = (Int32)stream.Position;
        Int32 cipherSize = encryption.GetCipherSize(965);

        Byte[] buffer = new Byte[cipherSize];
        Byte[] array  = null;
        using (MemoryStream memoryStream = new MemoryStream())
        {
            using (BinaryWriter binaryWriter = new BinaryWriter(memoryStream))
            {
                binaryWriter.Write('P');
                binaryWriter.Write('R');
                binaryWriter.Write('E');
                binaryWriter.Write('V');
                previewSlot.HasData = true;
                binaryWriter.Write(previewSlot.HasData);
                binaryWriter.Write(previewSlot.Gil);
                binaryWriter.Write(previewSlot.PlayDuration);
                binaryWriter.Write(previewSlot.win_type);
                Byte[] array2 = new Byte[128];
                Byte[] bytes  = Encoding.UTF8.GetBytes(previewSlot.Location);
                Buffer.BlockCopy(bytes, 0, array2, 0, (Int32)bytes.Length);
                binaryWriter.Write(array2, 0, (Int32)array2.Length);
                Byte[] array3 = new Byte[136];
                for (Int32 i = 0; i < 4; i++)
                {
                    if (previewSlot.CharacterInfoList[i] == null)
                    {
                        Int32 value  = -1;
                        Int32 value2 = -1;
                        binaryWriter.Write(value);
                        binaryWriter.Write(value2);
                        Byte[] array4 = new Byte[128];
                        binaryWriter.Write(array4, 0, (Int32)array4.Length);
                    }
                    else
                    {
                        binaryWriter.Write(previewSlot.CharacterInfoList[i].SerialID);
                        binaryWriter.Write(previewSlot.CharacterInfoList[i].Level);
                        Byte[] array5 = new Byte[128];
                        Byte[] bytes2 = Encoding.UTF8.GetBytes(previewSlot.CharacterInfoList[i].Name);
                        Buffer.BlockCopy(bytes2, 0, array5, 0, (Int32)bytes2.Length);
                        binaryWriter.Write(array5, 0, (Int32)array5.Length);
                    }
                }
                Double totalSeconds = (DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds;
                previewSlot.Timestamp = totalSeconds;
                binaryWriter.Write(previewSlot.Timestamp);
                Byte[] array6 = new Byte[256];
                binaryWriter.Write(array6, 0, (Int32)array6.Length);
                array = memoryStream.ToArray();
                if ((Int32)array.Length != 965)
                {
                    ISharedDataLog.LogError("previewPlainText has incorrect size: " + (Int32)array.Length);
                }
            }
        }
        buffer = encryption.Encrypt(array);
        stream.Seek((Int64)num2, SeekOrigin.Begin);
        writer.Write(buffer, 0, cipherSize);
        onFinishDelegate(slotID, saveID, previewSlot);
    }
Exemplo n.º 9
0
 private void OnMobileAndWindowsGUI(Rect areaRect)
 {
     GUILayout.BeginVertical(new GUILayoutOption[0]);
     GUILayout.FlexibleSpace();
     this.scrollPosition = GUILayout.BeginScrollView(this.scrollPosition, new GUILayoutOption[]
     {
         GUILayout.Width(areaRect.width * 0.7f),
         GUILayout.Height(areaRect.height * 0.7f)
     });
     GUILayout.BeginVertical("box", new GUILayoutOption[0]);
     GUILayout.Label(this.message, new GUILayoutOption[0]);
     GUILayout.EndVertical();
     GUILayout.Space(10f);
     GUILayout.BeginHorizontal("box", new GUILayoutOption[0]);
     GUILayout.BeginVertical(new GUILayoutOption[0]);
     GUILayout.BeginHorizontal(new GUILayoutOption[0]);
     if (GUILayout.Button("<", new GUILayoutOption[0]))
     {
         this.slotID--;
     }
     GUILayout.Label("Slot ID: " + this.slotID.ToString(), new GUILayoutOption[0]);
     if (GUILayout.Button(">", new GUILayoutOption[0]))
     {
         this.slotID++;
     }
     if (this.slotID < 0)
     {
         this.slotID = 0;
     }
     if (this.slotID > 9)
     {
         this.slotID = 9;
     }
     GUILayout.EndHorizontal();
     GUILayout.BeginHorizontal(new GUILayoutOption[0]);
     if (GUILayout.Button("<", new GUILayoutOption[0]))
     {
         this.saveID--;
     }
     GUILayout.Label("Save ID: " + this.saveID.ToString(), new GUILayoutOption[0]);
     if (GUILayout.Button(">", new GUILayoutOption[0]))
     {
         this.saveID++;
     }
     if (this.saveID < 0)
     {
         this.saveID = 0;
     }
     if (this.saveID > 14)
     {
         this.saveID = 14;
     }
     GUILayout.EndHorizontal();
     if (GUILayout.Button("LOAD", new GUILayoutOption[0]) && !this.isLoading)
     {
         this.LoadData();
     }
     if (GUILayout.Button("SAVE", new GUILayoutOption[0]) && !this.isLoading)
     {
         this.SaveData();
     }
     if (this.savedPreviewSlot != null)
     {
         GUILayout.Label("---------------BEGIN SLOT-------------", new GUILayoutOption[0]);
         SharedDataPreviewSlot sharedDataPreviewSlot = this.savedPreviewSlot;
         GUILayout.Label("Preview debug data", new GUILayoutOption[0]);
         GUILayout.Label("Gil: " + sharedDataPreviewSlot.Gil, new GUILayoutOption[0]);
         GUILayout.Label("PlayDuration: " + sharedDataPreviewSlot.PlayDuration, new GUILayoutOption[0]);
         GUILayout.Label("Location: " + sharedDataPreviewSlot.Location, new GUILayoutOption[0]);
         if (sharedDataPreviewSlot.CharacterInfoList != null)
         {
             GUILayout.Label("Character Info -------------------", new GUILayoutOption[0]);
             foreach (SharedDataPreviewCharacterInfo sharedDataPreviewCharacterInfo in sharedDataPreviewSlot.CharacterInfoList)
             {
                 if (sharedDataPreviewCharacterInfo != null)
                 {
                     GUILayout.Label("SlotID: " + sharedDataPreviewCharacterInfo.SerialID, new GUILayoutOption[0]);
                     GUILayout.Label("Level: " + sharedDataPreviewCharacterInfo.Level, new GUILayoutOption[0]);
                     GUILayout.Label("Name: " + sharedDataPreviewCharacterInfo.Name, new GUILayoutOption[0]);
                     GUILayout.Label("---------------------------------", new GUILayoutOption[0]);
                 }
             }
         }
         GUILayout.Label("---------------END SLOT-------------", new GUILayoutOption[0]);
     }
     GUILayout.EndVertical();
     GUILayout.EndHorizontal();
     GUILayout.Space(10f);
     GUILayout.BeginVertical("box", new GUILayoutOption[0]);
     if (GUILayout.Button("HAS AUTOLOAD", new GUILayoutOption[0]))
     {
         this.HasAutoLoadData();
     }
     else if (GUILayout.Button("AUTOLOAD", new GUILayoutOption[0]))
     {
         this.AutoLoadData();
     }
     else if (GUILayout.Button("AUTOSAVE", new GUILayoutOption[0]))
     {
         this.AutoSaveData();
     }
     GUILayout.EndVertical();
     GUILayout.Space(10f);
     GUILayout.BeginVertical("box", new GUILayoutOption[0]);
     GUILayout.BeginHorizontal(new GUILayoutOption[0]);
     if (GUILayout.Button("<", new GUILayoutOption[0]))
     {
         this.previewSlotID--;
     }
     GUILayout.Label("Slot ID: " + this.previewSlotID.ToString(), new GUILayoutOption[0]);
     if (GUILayout.Button(">", new GUILayoutOption[0]))
     {
         this.previewSlotID++;
     }
     if (this.previewSlotID < 0)
     {
         this.previewSlotID = 0;
     }
     if (this.previewSlotID > 9)
     {
         this.previewSlotID = 9;
     }
     GUILayout.EndHorizontal();
     if (GUILayout.Button("LOAD PREVIEW", new GUILayoutOption[0]) && !this.isLoading)
     {
         this.LoadPreview(this.previewSlotID);
     }
     if (this.previewSlotList != null)
     {
         GUILayout.Label("---------------BEGIN DATA-------------", new GUILayoutOption[0]);
         for (Int32 i = 0; i < this.previewSlotList.Count; i++)
         {
             SharedDataPreviewSlot sharedDataPreviewSlot2 = this.previewSlotList[i];
             if (sharedDataPreviewSlot2 != null)
             {
                 GUILayout.Label("Preview # " + i + " -------------------", new GUILayoutOption[0]);
                 GUILayout.Label("Preview debug data", new GUILayoutOption[0]);
                 GUILayout.Label("Gil: " + sharedDataPreviewSlot2.Gil, new GUILayoutOption[0]);
                 GUILayout.Label("PlayDuration: " + sharedDataPreviewSlot2.PlayDuration, new GUILayoutOption[0]);
                 GUILayout.Label("Location: " + sharedDataPreviewSlot2.Location, new GUILayoutOption[0]);
                 if (sharedDataPreviewSlot2.CharacterInfoList != null)
                 {
                     GUILayout.Label("Character Info -------------------", new GUILayoutOption[0]);
                     foreach (SharedDataPreviewCharacterInfo sharedDataPreviewCharacterInfo2 in sharedDataPreviewSlot2.CharacterInfoList)
                     {
                         if (sharedDataPreviewCharacterInfo2 != null)
                         {
                             GUILayout.Label("SlotID: " + sharedDataPreviewCharacterInfo2.SerialID, new GUILayoutOption[0]);
                             GUILayout.Label("Level: " + sharedDataPreviewCharacterInfo2.Level, new GUILayoutOption[0]);
                             GUILayout.Label("Name: " + sharedDataPreviewCharacterInfo2.Name, new GUILayoutOption[0]);
                             GUILayout.Label("---------------------------------", new GUILayoutOption[0]);
                         }
                     }
                 }
                 GUILayout.Label("---------------END SLOT-------------", new GUILayoutOption[0]);
             }
         }
         GUILayout.Label("---------------END DATA-------------", new GUILayoutOption[0]);
     }
     GUILayout.EndVertical();
     GUILayout.Space(10f);
     GUILayout.BeginVertical("box", new GUILayoutOption[0]);
     if (GUILayout.Button("Get latest timestamp", new GUILayoutOption[0]))
     {
         this.GetLatestTimestamp();
     }
     GUILayout.EndVertical();
     GUILayout.Space(10f);
     GUILayout.BeginVertical("box", new GUILayoutOption[0]);
     if (GUILayout.Button("Clear UI", new GUILayoutOption[0]))
     {
         this.ClearUI();
     }
     GUILayout.EndVertical();
     GUILayout.BeginVertical("box", new GUILayoutOption[0]);
     if (GUILayout.Button("Is Game Finish ?", new GUILayoutOption[0]))
     {
         this.IsGameFinish();
     }
     if (GUILayout.Button("Finish Game", new GUILayoutOption[0]))
     {
         this.FinishGame();
     }
     GUILayout.EndVertical();
     GUILayout.EndScrollView();
     GUILayout.FlexibleSpace();
     GUILayout.EndVertical();
 }
Exemplo n.º 10
0
 private void SaveDataFinishDelegate(DataSerializerErrorCode errNo, Int32 slotID, Int32 saveID, Boolean isSuccess, SharedDataPreviewSlot preview)
 {
     if (isSuccess)
     {
         this.message = "Saved. Success. Have fun!";
     }
     else
     {
         this.message = "Fail. Something wrong?";
     }
     this.isLoading        = false;
     this.savedPreviewSlot = preview;
 }
Exemplo n.º 11
0
 private void OnSaveSlotFinish(Int32 slotID, Int32 saveID, SharedDataPreviewSlot data)
 {
     this.previewSlotCache = data;
     this.Parser.ParseFromFF9StateSystem();
     this.Storage.Save(slotID, this.saveIDCache, this.Parser.RootNodeInParser, new ISharedDataStorage.OnSaveFinish(this.OnDataSaveFinish));
 }