public EzDeleteDataObjectResult(
     DeleteDataObjectResult result
     )
 {
     if (result.item != null)
     {
         Item = new EzDataObject(result.item);
     }
 }
Beispiel #2
0
 public EzDoneUploadResult(
     DoneUploadResult result
     )
 {
     if (result.item != null)
     {
         Item = new EzDataObject(result.item);
     }
 }
 public EzRestoreDataObjectResult(
     RestoreDataObjectResult result
     )
 {
     if (result.item != null)
     {
         Item = new EzDataObject(result.item);
     }
 }
Beispiel #4
0
 public EzRestoreDataObjectByUserIdAndDataObjectNameResult(
     RestoreDataObjectByUserIdAndDataObjectNameResult result
     )
 {
     if (result.item != null)
     {
         Item = new EzDataObject(result.item);
     }
 }
 public EzPrepareReUploadResult(
     PrepareReUploadResult result
     )
 {
     if (result.item != null)
     {
         Item = new EzDataObject(result.item);
     }
     UploadUrl = result.uploadUrl;
 }
 public EzPrepareDownloadOwnDataResult(
     PrepareDownloadOwnDataResult result
     )
 {
     if (result.item != null)
     {
         Item = new EzDataObject(result.item);
     }
     FileUrl = result.fileUrl;
     if (result.contentLength.HasValue)
     {
         ContentLength = result.contentLength.Value;
     }
 }
 public EzReUploadResult(EzDataObject dataObject)
 {
     Item = dataObject;
 }
Beispiel #8
0
        /// <summary>
        ///  データの再アップロード<br />
        /// </summary>
        ///
        /// <returns>IEnumerator</returns>
        /// <param name="callback">コールバックハンドラ</param>
        /// <param name="session">ゲームセッション</param>
        /// <param name="namespaceName">ネームスペース名</param>
        /// <param name="dataObject">データオブジェクト</param>
        /// <param name="data">アップロードするデータ</param>
        public IEnumerator ReUpload(
            UnityAction <AsyncResult <EzReUploadResult> > callback,
            GameSession session,
            string namespaceName,
            EzDataObject dataObject,
            byte[] data
            )
        {
            string uploadUrl;
            {
                EzPrepareReUploadResult result = null;
                yield return(PrepareReUpload(
                                 r =>
                {
                    if (r.Error != null)
                    {
                        callback.Invoke(
                            new AsyncResult <EzReUploadResult>(
                                null,
                                r.Error
                                )
                            );
                    }
                    else
                    {
                        result = r.Result;
                    }
                },
                                 session,
                                 namespaceName,
                                 dataObject.Name
                                 ));

                if (result == null)
                {
                    yield break;
                }

                uploadUrl  = result.UploadUrl;
                dataObject = result.Item;
            }
            {
                EzUploadImplResult result = null;
                yield return(UploadImpl(
                                 r =>
                {
                    if (r.Error != null)
                    {
                        callback.Invoke(
                            new AsyncResult <EzReUploadResult>(
                                null,
                                r.Error
                                )
                            );
                    }
                    else
                    {
                        result = r.Result;
                    }
                },
                                 uploadUrl,
                                 data
                                 ));

                if (result == null)
                {
                    yield break;
                }
            }
            {
                EzDoneUploadResult result = null;
                yield return(DoneUpload(
                                 r =>
                {
                    if (r.Error != null)
                    {
                        callback.Invoke(
                            new AsyncResult <EzReUploadResult>(
                                null,
                                r.Error
                                )
                            );
                    }
                    else
                    {
                        result = r.Result;
                    }
                },
                                 session,
                                 namespaceName,
                                 dataObject.Name
                                 ));

                if (result == null)
                {
                    yield break;
                }

                dataObject = result.Item;

                callback.Invoke(
                    new AsyncResult <EzReUploadResult>(
                        new EzReUploadResult(dataObject),
                        null
                        )
                    );
            }
        }