Exemplo n.º 1
0
        public override void BinaryToData(byte[] binary)
        {
            MasterDataT src;

            TypeSerializeHelper.BytesToData <MasterDataT>(binary, out src);
            this.PrepareData(src);
        }
Exemplo n.º 2
0
 public IEnumerator Write(string filePath, string jsonText, Action <bool> onCompleted)
 {
     this.isException = false;
     byte[] binary = null;
     try
     {
         TypeSerializeHelper.DataToBytes <string>(jsonText, out binary);
     }
     catch
     {
     }
     return(this.fileControlHelper.Write(filePath, binary, delegate(Type exceptionType)
     {
         if (exceptionType != null)
         {
             this.isException = true;
             this.exceptionType = exceptionType;
         }
         if (!this.iCloudBackup)
         {
         }
         if (onCompleted != null)
         {
             onCompleted(!this.isException);
         }
     }));
 }
Exemplo n.º 3
0
 private string GetEncryptoDungeonId(string dungeonId)
 {
     byte[] array;
     TypeSerializeHelper.DataToBytes <string>(dungeonId, out array);
     array = this.cryptoHelper.EncryptWithDES(array);
     return(Convert.ToBase64String(array));
 }
Exemplo n.º 4
0
 private byte[] MasterDataToBinary(WebAPI.ResponseData masterData)
 {
     byte[] result = null;
     try
     {
         TypeSerializeHelper.DataToBytes <WebAPI.ResponseData>(masterData, out result);
     }
     catch
     {
         global::Debug.LogWarning("MasterDataのSerializeでエラーが発生しました");
     }
     return(result);
 }
        private void OnLoadScriptFile(byte[] loadData)
        {
            string empty = string.Empty;

            try
            {
                TypeSerializeHelper.BytesToData <string>(loadData, out empty);
            }
            catch
            {
                global::Debug.Log("動画シーン用のスクリプトファイルの読み込みに失敗しました。");
            }
            this.scriptEngine.Deserialize(empty);
        }
Exemplo n.º 6
0
 public IEnumerator Read(string filePath, Action <bool, string> onCompleted)
 {
     this.isException = false;
     return(this.fileControlHelper.Read(filePath, new Action <Type>(this.OnFailedFileRead), delegate(byte[] loadData)
     {
         if (onCompleted != null)
         {
             string empty = string.Empty;
             try
             {
                 TypeSerializeHelper.BytesToData <string>(loadData, out empty);
             }
             catch (Exception ex)
             {
                 this.OnFailedFileRead(ex.GetType());
             }
             onCompleted(false == this.isException, empty);
         }
     }));
 }
Exemplo n.º 7
0
        public IEnumerator ReadMasterDataVersionFile(Action <GameWebAPI.RespDataCM_MDVersion> onRead)
        {
            string fileName = this.GetFileName("MASTER_DATA_VERSION");

            return(this.persistentFile.Read(fileName, delegate(bool isSuccess, byte[] binary)
            {
                if (isSuccess)
                {
                    try
                    {
                        if (onRead != null)
                        {
                            GameWebAPI.RespDataCM_MDVersion obj;
                            TypeSerializeHelper.BytesToData <GameWebAPI.RespDataCM_MDVersion>(binary, out obj);
                            onRead(obj);
                        }
                    }
                    catch
                    {
                    }
                }
            }));
        }
    protected IEnumerator LoadScriptFile(string fileName, Action <string> onCompleted)
    {
        string          filePath     = this.GetFilePath(fileName);
        TextAsset       textAsset    = AssetDataMng.Instance().LoadObject(filePath, null, true) as TextAsset;
        Action <byte[]> onCompleted2 = delegate(byte[] loadData)
        {
            string empty = string.Empty;
            try
            {
                TypeSerializeHelper.BytesToData <string>(loadData, out empty);
            }
            catch
            {
                global::Debug.Log("チュートリアルファイルの読み込みに失敗しました。");
            }
            if (onCompleted != null)
            {
                onCompleted(empty);
            }
        };
        FileControlHelper fileControlHelper = new FileControlHelper();

        return(fileControlHelper.Decrypt(textAsset.bytes, onCompleted2));
    }