diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIImage/error.png b/AxibugEmuOnline.Client/Assets/Resources/UIImage/error.png new file mode 100644 index 00000000..e535620f Binary files /dev/null and b/AxibugEmuOnline.Client/Assets/Resources/UIImage/error.png differ diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIImage/error.png.meta b/AxibugEmuOnline.Client/Assets/Resources/UIImage/error.png.meta new file mode 100644 index 00000000..2e207ba1 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Resources/UIImage/error.png.meta @@ -0,0 +1,117 @@ +fileFormatVersion: 2 +guid: f7cefc6af245195478163bba38423795 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 4 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + customData: + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/AxiHttp/AxiHttpProxy.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/AxiHttp/AxiHttpProxy.cs index a559bed8..4ab124f2 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/AxiHttp/AxiHttpProxy.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/AxiHttp/AxiHttpProxy.cs @@ -71,6 +71,10 @@ public static class AxiHttpProxy Debug.Log($"respInfo.fileName =>{resp.fileName}"); Debug.Log($"respInfo.NeedloadedLenght =>{resp.NeedloadedLenght}"); Debug.Log($"respInfo.loadedLenght =>{resp.loadedLenght}"); + if (resp.bHadErr) + { + Debug.LogError($"code->{resp.code} err->{resp.ErrInfo} url->{resp.url}"); + } #else Debug.Log($"==== request url => { resp.url}"); Debug.Log($"code =>{resp.code}"); diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/CacheManager.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/CacheManager.cs index 2f96ef4f..40edc5b7 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/CacheManager.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/CacheManager.cs @@ -33,16 +33,19 @@ namespace AxibugEmuOnline.Client yield return null; //Debug.Log($"下载进度:{respInfo.DownLoadPr} ->{respInfo.loadedLenght}/{respInfo.NeedloadedLenght}"); } - AxiHttpProxy.ShowAxiHttpDebugInfo(request.downloadHandler); - + AxiHttpProxy.ShowAxiHttpDebugInfo(request.downloadHandler); + + if (!request.downloadHandler.bHadErr) { Directory.CreateDirectory(path); File.WriteAllBytes($"{path}/{url.GetHashCode()}", request.downloadHandler.data); callback.Invoke(request.downloadHandler.data); } - else + else + { callback.Invoke(null); + } /* var request = UnityWebRequest.Get($"{App.httpAPI.WebHost}/{url}"); @@ -105,10 +108,19 @@ namespace AxibugEmuOnline.Client if (vt == t_texture2d || vt == t_sprite) { Texture2D texture = new Texture2D(2, 2); - texture.LoadImage(data); - - if (vt == t_texture2d) return texture as T; - else return Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f)) as T; + if (data == null) + { + var errorSpr = Resources.Load("UIImage/error"); + if (vt == t_texture2d) return errorSpr.texture as T; + else return errorSpr as T; + } + else + { + texture.LoadImage(data); + + if (vt == t_texture2d) return texture as T; + else return Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f)) as T; + } } else if (vt == t_byteArray) { diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/RomLib/RomFile.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/RomLib/RomFile.cs index edfd0051..1672801e 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/RomLib/RomFile.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/RomLib/RomFile.cs @@ -294,7 +294,7 @@ namespace AxibugEmuOnline.Client } throw new Exception("Not Valid Rom Data"); - } + } public void SetWebData(HttpAPI.Resp_RomInfo resp_RomInfo) {