Skip to content

Commit 9bef306

Browse files
committed
Keep recoverable replay loads visually clean
Current logic replay files can contain a readable prefix when the server is stopped before MessageWriter.Dispose closes the gzip stream. Unity still records that diagnostic internally, but successful loads no longer present it as a scary primary status line. The loaded status is also shortened so the HUD does not wrap awkwardly after the team/player numbers. Constraint: Latest user-provided test replays are readable but end before a clean gzip/protobuf close. Rejected: Treat recoverable replay tails as fatal | would break playback for current logic-group samples. Rejected: Modify logic writer in this interface patch | user asked to inspect logic, and interface PRs should avoid logic/ changes. Confidence: high Scope-risk: narrow Directive: Keep incomplete-tail diagnostics internal unless a load has no usable frames or truly fails. Tested: Unity-Playback WebGL build succeeded. Tested: Unity-Playback-WebGL.zip contents match playback/ directory by SHA256. Tested: CDP WebGL regression loaded playback.thuaipb, mygame.thuaipb, and playback (1).thuaipb across repeated, cross-file, during-playback, URL, and blob scenarios with no playback-error or JS exception. Tested: dotnet format whitespace verify for Unity-Playback scripts; git diff --check; origin/dev PR diff has zero logic/ files. Not-tested: Manual OS file picker in the user's visible Chrome profile.
1 parent 50aa1dd commit 9bef306

6 files changed

Lines changed: 5 additions & 10 deletions

File tree

interface/Unity/Unity-Playback/Assets/Scripts/Playback/PlaybackController.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,8 @@ private static string BuildPlaybackFailureStatus(string fallbackStatus, Exceptio
336336
if (ex is PlaybackFileIncompleteException incomplete)
337337
{
338338
return incomplete.ParsedFrameCount > 0
339-
? $"状态:回放文件末尾不完整,已读取 {incomplete.ParsedFrameCount} 帧但未完成加载"
340-
: "状态:回放文件不完整,未读到可用帧";
339+
? $"状态:已读取 {incomplete.ParsedFrameCount} 帧,但回放加载未完成"
340+
: "状态:回放文件未读到可用帧";
341341
}
342342

343343
if (ex is InvalidProtocolBufferException)
@@ -372,17 +372,12 @@ private static string BuildPlaybackFailureStatus(string fallbackStatus, Exceptio
372372

373373
private string BuildPlaybackLoadedStatus()
374374
{
375-
string baseStatus = $"状态:已加载 {messageReader.GetMessageCount()} 帧(v{messageReader.FileVersion}{messageReader.TeamCount} 队,{messageReader.PlayerCount} 玩家)";
375+
string baseStatus = $"状态:已加载 {messageReader.GetMessageCount()} 帧(v{messageReader.FileVersion}{messageReader.TeamCount}队/{messageReader.PlayerCount}玩家)";
376376
if (messageReader.IsLegacyVersion)
377377
{
378378
baseStatus += ",旧版回放建议用当前逻辑重新生成";
379379
}
380380

381-
if (messageReader.IsIncompleteTail)
382-
{
383-
baseStatus += ",但文件末尾不完整,已保留可读取部分";
384-
}
385-
386381
return baseStatus;
387382
}
388383

13 Bytes
Binary file not shown.
-96 Bytes
Binary file not shown.

interface/Unity/Unity-WebGL/playback/Build/playback.framework.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
-62 Bytes
Binary file not shown.

interface/Unity/Unity-WebGL/playback/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
}
5858

5959
var thuai9Mode = 'playback';
60-
var thuai9BuildStamp = '639152490133014451';
60+
var thuai9BuildStamp = '639152518795461264';
6161
var thuai9Query = new URLSearchParams(window.location.search);
6262
function thuai9CacheBust(url) {
6363
return url + (url.indexOf('?') >= 0 ? '&' : '?') + 'v=' + encodeURIComponent(thuai9BuildStamp);

0 commit comments

Comments
 (0)