4
4
using System . Linq ;
5
5
using System . Reflection ;
6
6
using System . Runtime . CompilerServices ;
7
+ using System . Text ;
7
8
using System . Threading . Tasks ;
8
9
using UnityEngine . Networking ;
9
10
@@ -12,10 +13,7 @@ namespace AIO.UEngine.YooAsset
12
13
partial class Proxy
13
14
{
14
15
/// <inheritdoc />
15
- public override IOperationAction < bool > UpdatePackagesTask ( ASConfig config , Action < bool > completed = null )
16
- {
17
- return new ActionUpdatePackages ( config , completed ) ;
18
- }
16
+ public override IOperationAction < bool > UpdatePackagesTask ( ASConfig config , Action < bool > completed = null ) { return new ActionUpdatePackages ( config , completed ) ; }
19
17
20
18
private static bool CheckPackages ( string remote , string content , out AssetsPackageConfig [ ] packages )
21
19
{
@@ -63,8 +61,7 @@ private static bool CheckPackages(string remote, string content, out AssetsPacka
63
61
return true ;
64
62
}
65
63
66
- private static string GetPackageManifestVersionUrl ( ASConfig config , AssetsPackageConfig item ) =>
67
- $ "{ config . URL } /{ AssetSystem . PlatformNameStr } /{ item . Name } /{ item . Version } /PackageManifest_{ item . Name } .version?t={ DateTime . Now . Ticks } ";
64
+ private static string GetPackageManifestVersionUrl ( ASConfig config , AssetsPackageConfig item ) => $ "{ config . URL } /{ AssetSystem . PlatformNameStr } /{ item . Name } /{ item . Version } /PackageManifest_{ item . Name } .version?t={ DateTime . Now . Ticks } ";
68
65
69
66
/// <summary>
70
67
/// 更新资源包列表
@@ -81,7 +78,7 @@ private static bool UpdatePackagesRemoteSync(ASConfig config)
81
78
string content ;
82
79
try
83
80
{
84
- content = AHelper . HTTP . Get ( remote ) ;
81
+ content = AHelper . HTTP . Get ( remote , Encoding . UTF8 ) ;
85
82
}
86
83
catch ( Exception )
87
84
{
@@ -96,7 +93,7 @@ private static bool UpdatePackagesRemoteSync(ASConfig config)
96
93
item . IsLatest = item . Version == "Latest" ; // 如果使用Latest则认为是最新版本 同时需要获取最新版本号
97
94
if ( ! item . IsLatest ) continue ;
98
95
var url = GetPackageManifestVersionUrl ( config , item ) ;
99
- var temp = AHelper . HTTP . Get ( url ) ;
96
+ var temp = AHelper . HTTP . Get ( url , Encoding . UTF8 ) ;
100
97
if ( string . IsNullOrEmpty ( temp ) )
101
98
{
102
99
AssetSystem . LogError ( $ "{ url } Request failed") ;
@@ -127,7 +124,7 @@ private static async Task<bool> UpdatePackagesRemoteTask(ASConfig config)
127
124
string content ;
128
125
try
129
126
{
130
- content = await AHelper . HTTP . GetAsync ( remote ) ;
127
+ content = await AHelper . HTTP . GetAsync ( remote , Encoding . UTF8 ) ;
131
128
}
132
129
catch ( Exception e )
133
130
{
@@ -143,7 +140,7 @@ private static async Task<bool> UpdatePackagesRemoteTask(ASConfig config)
143
140
item . IsLatest = item . Version == "Latest" ; // 如果使用Latest则认为是最新版本 同时需要获取最新版本号
144
141
if ( ! item . IsLatest ) continue ;
145
142
var url = GetPackageManifestVersionUrl ( config , item ) ;
146
- var temp = await AHelper . HTTP . GetAsync ( url ) ;
143
+ var temp = await AHelper . HTTP . GetAsync ( url , Encoding . UTF8 ) ;
147
144
if ( string . IsNullOrEmpty ( temp ) )
148
145
{
149
146
AssetSystem . LogError ( $ "{ url } Request failed") ;
0 commit comments