Example #1
0
 public HttpRequest(string url, IHttpProtocol protocol, IErrorHandle errorHandle)
 {
     Url                    = url;
     this.protocol          = protocol;
     this.errorHandle       = errorHandle;
     Header["Content-Type"] = "application/json";
 }
Example #2
0
 public HttpRequest(string ip, int port, IHttpProtocol protocol, IErrorHandle errorHandle)
 {
     Header                 = new Dictionary <string, string>();
     Url                    = $"http://{ip}:{port}";
     this.protocol          = protocol;
     this.errorHandle       = errorHandle;
     Header["Content-Type"] = "application/json";
 }
Example #3
0
        public IErrorHandle ErrorStatus; // Error handling object

        /// <summary>
        /// Constructor
        /// </summary>
        public User()
        {
            id          = -1;
            name        = string.Empty;
            updatedAt   = new DateData();
            createAt    = new DateData();
            ErrorStatus = new ErrorHandler();
            //identities = new List<Identity>();
        }
Example #4
0
        /// <summary>
        /// アセットバンドル読み込みエラー(カスタム)
        /// </summary>
        /// <param name="assetBundleManager">アセットバンドルマネージャー</param>
        /// <returns>コルーチン</returns>
        protected IEnumerator CustomErrorAssetBundle(AssetBundleManager assetBundleManager)
        {
            IErrorHandler errorHandlerOld = assetBundleManager.errorHandler;
            IErrorHandle  errorHandleCommon;

            assetBundleManager.errorHandler = new ErrorAction(x => errorHandleCommon = x);

            try {
                errorHandleCommon = null;
                var          isloaded    = false;
                var          assetBundle = assetBundleManager.LoadAssetBundle("AssetBundleShoshaTest/MissingAssetBundle", x => isloaded = true);
                IErrorHandle errorHandle = null;
                assetBundle.errorHandler = new ErrorAction(x => errorHandle = x);
                Assert.IsTrue(assetBundle != null);
                while (!assetBundle.isDone)
                {
                    if (errorHandle != null)
                    {
                        break;
                    }
                    if (errorHandleCommon != null)
                    {
                        break;
                    }
                    yield return(null);
                }
                Assert.IsFalse(assetBundle.isDone);
                Assert.IsFalse(isloaded);
                Assert.IsTrue(errorHandle != null);
                Assert.IsTrue(errorHandleCommon == null);
                errorHandle.Ignore();
                while (!assetBundle.isDone)
                {
                    yield return(null);
                }
                Assert.IsTrue(assetBundle.isDone);
                Assert.IsTrue(isloaded);
                Assert.Throws <System.NullReferenceException>(() => {
                    assetBundle.LoadAllAssets();
                });
                Assert.Throws <System.NullReferenceException>(() => {
                    assetBundle.LoadAllAssetsAsync();
                });

                assetBundle.Dispose();
            } finally {
                assetBundleManager.errorHandler = errorHandlerOld;
            }

            yield break;
        }
Example #5
0
        public IErrorHandle ErrorStatus;    // Error handling object

        /// <summary>
        /// Constructor
        /// </summary>
        public User()
        {
            id = -1;
            activeIdentityID = -1;
            name             = string.Empty;
            email            = string.Empty;
            password         = string.Empty;
            access_token     = string.Empty;
            updated_at       = new DateData();
            created_at       = new DateData();
            ErrorStatus      = new ErrorHandler();
            //roles = new List<Roles>();
            //identities = new List<Identity>();
        }
Example #6
0
        /// <summary>
        /// 配信ストリーミングアセット読み込みエラー(カスタム)
        /// </summary>
        /// <param name="assetBundleManager">アセットバンドルマネージャー</param>
        /// <returns>コルーチン</returns>
        protected IEnumerator CustomErrorDeliveryStreamingAssets(AssetBundleManager assetBundleManager)
        {
            IErrorHandler errorHandlerOld = assetBundleManager.errorHandler;
            IErrorHandle  errorHandleCommon;

            assetBundleManager.errorHandler = new ErrorAction(x => errorHandleCommon = x);

            try {
                errorHandleCommon = null;
                var          isloaded    = false;
                var          assetBundle = assetBundleManager.LoadAssetBundle("DeliveryStreamingAssets:AssetBundleShoshaTest/MissingDeliveryStreamingAssets", x => isloaded = true);
                IErrorHandle errorHandle = null;
                assetBundle.errorHandler = new ErrorAction(x => errorHandle = x);
                Assert.IsTrue(assetBundle != null);
                while (!assetBundle.isDone)
                {
                    if (errorHandle != null)
                    {
                        break;
                    }
                    if (errorHandleCommon != null)
                    {
                        break;
                    }
                    yield return(null);
                }
                Assert.IsFalse(assetBundle.isDone);
                Assert.IsFalse(isloaded);
                Assert.IsTrue(errorHandle != null);
                Assert.IsTrue(errorHandleCommon == null);
                errorHandle.Ignore();
                while (!assetBundle.isDone)
                {
                    yield return(null);
                }
                Assert.IsTrue(assetBundle.isDone);
                Assert.IsTrue(isloaded);
                Assert.IsTrue(string.IsNullOrEmpty(assetBundle.deliveryStreamingAssetPath));

                assetBundle.Dispose();
            } finally {
                assetBundleManager.errorHandler = errorHandlerOld;
            }

            yield break;
        }
Example #7
0
        /// <summary>
        /// エラー発生
        /// </summary>
        /// <param name="handle">エラーハンドル</param>
        public void Error(IErrorHandle handle)
        {
            var message = string.Format(kDownloadErrorMessageFormat, handle.errorCode);

#if UNITY_EDITOR || DEVELOPMENT_BUILD
            message += "\n\n[DebugInfo]\n" + handle.assetBundleNameWithVariant;
#endif
            m_DemoDialog.Create(message, kDownloadErrorButtonTexts, onFinished: x => {
                switch (x)
                {
                case 1:                 //Retry
                    handle.Retry();
                    break;

                case 0:                 //Ignore
                default:
                    handle.Ignore();
                    break;
                }
            });
        }
Example #8
0
 public DefaultSocketListener(ISocketProtocol protocol, IErrorHandle errorHandle)
 {
     this.protocol    = protocol;
     this.errorHandle = errorHandle;
 }
Example #9
0
 /// <summary>
 /// エラー発生
 /// </summary>
 /// <param name="handle">エラーハンドル</param>
 public void Error(IErrorHandle handle)
 {
     m_OnError(handle);
 }