|
@@ -105,13 +105,8 @@ namespace HotPatch
|
|
|
fresh.Query = fresh.Query.TrimStart('?') + (fresh.Query.Length > 0 ? "&" : "") + "hotpatch=" + DateTime.UtcNow.Ticks;
|
|
fresh.Query = fresh.Query.TrimStart('?') + (fresh.Query.Length > 0 ? "&" : "") + "hotpatch=" + DateTime.UtcNow.Ticks;
|
|
|
var remote = Parse(await ReadTextAsync(fresh.Uri, ct, true));
|
|
var remote = Parse(await ReadTextAsync(fresh.Uri, ct, true));
|
|
|
HotPatchLog.Info($"remote_manifest platform={remote.platform} build={remote.playerBuildId} version={remote.version}");
|
|
HotPatchLog.Info($"remote_manifest platform={remote.platform} build={remote.playerBuildId} version={remote.version}");
|
|
|
- remote.ValidateAgainst(original);
|
|
|
|
|
- var previous = local.resources.ToDictionary(r => r.name, StringComparer.OrdinalIgnoreCase);
|
|
|
|
|
- var changed = remote.resources.Where(resource =>
|
|
|
|
|
- !previous.TryGetValue(resource.name, out var old) || !resource.SameContent(old) ||
|
|
|
|
|
- !IsVerified(Path.Combine(root, resource.RelativePath), resource)).ToArray();
|
|
|
|
|
-
|
|
|
|
|
- changed = changed.Where(r => !IsVerified(Path.Combine(root, r.RelativePath), r)).ToArray();
|
|
|
|
|
|
|
+ remote.Validate(original.assemblyName, original.platform, original.gameSceneName);
|
|
|
|
|
+ var changed = remote.resources.Where(r => !IsVerified(Path.Combine(root, r.RelativePath), r)).ToArray();
|
|
|
long total = changed.Sum(r => checked(r.size)), completed = 0;
|
|
long total = changed.Sum(r => checked(r.size)), completed = 0;
|
|
|
HotPatchLog.Info($"version_compare local={local.version} remote={remote.version} changedFiles={changed.Length} transferBytes={total}");
|
|
HotPatchLog.Info($"version_compare local={local.version} remote={remote.version} changedFiles={changed.Length} transferBytes={total}");
|
|
|
foreach (var resource in changed)
|
|
foreach (var resource in changed)
|
|
@@ -144,7 +139,7 @@ namespace HotPatch
|
|
|
try
|
|
try
|
|
|
{
|
|
{
|
|
|
var manifest = Parse(File.ReadAllText(path));
|
|
var manifest = Parse(File.ReadAllText(path));
|
|
|
- manifest.ValidateAgainst(original);
|
|
|
|
|
|
|
+ manifest.Validate(original.assemblyName, original.platform, original.gameSceneName);
|
|
|
return manifest;
|
|
return manifest;
|
|
|
}
|
|
}
|
|
|
catch (Exception e) when (e is IOException || e is ArgumentException || e is InvalidOperationException)
|
|
catch (Exception e) when (e is IOException || e is ArgumentException || e is InvalidOperationException)
|