Repository navigation
Renew the Warcraft III sign-in from Battle.net before Run Map - #1624
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dcbf51ef07
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…h it A client Battle.net starts with -loadfile shows the in-game login panel whenever the file exists, so staging the map in Battle.net's launch arguments never signed in. Run Map's -editor launch signs in with EDITOR_TOKEN, which lapses. BattleNetSignIn now has the app start the game, closes that client before it spends the one-time WEB_TOKEN, stores the token as EDITOR_TOKEN, and Run Map launches directly as before. Battle.net's settings are no longer edited, so the restore command and its capability flag are gone. Mechanism and shared lock: wc3-e2e-harness docs/BattleNetSignIn.md.
Releasing the lock right after the renewal let another tool's renewal replace EDITOR_TOKEN before this client had read it, leaving two clients one token. The lock now stays held until the client replaces EDITOR_TOKEN, which it does as it signs in (about ten seconds after launch), or for at most two minutes. This matches wc3-e2e-harness, which holds it until its map reports.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 637082e8ff
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…nceled A run canceled during the "running" progress notification threw before the cleanup that releases the lock, so the lock stayed held. The notification now sits inside that cleanup. A renewal canceled after it asked Battle.net for a client left that client to open and keep running. Once the app has been asked, a failed or canceled renewal now keeps the lock for 30 seconds and closes any client the app starts, sparing games that were already running.
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Behavior
-editorlaunches use, from the signed-in Battle.net app. The map then starts with the usual direct command (-launch -editor -windowmode windowed -loadfile ...), signed in.wc3LaunchMode:auto(default) renews when Battle.net is open, and otherwise launches on the stored sign-in, which may ask for a login.battlenetasks the editor to offer Retry, Use Legacy Launch, and Cancel when it cannot renew.legacynever renews.Why not launch through Battle.net
The first version of this PR staged the map in Battle.net's stored launch arguments and launched through the app. Measured on 3.0.1 and Battle.net 2.53, a client the app starts with
-loadfilenaming an existing file shows the in-game login panel anyway, so that never signed in. A client started with-editorsigns in withEDITOR_TOKEN(HKCU\Software\Blizzard Entertainment\Warcraft III) and replaces it on each sign-in; once it lapses, every Run Map asks for a login.Just before the app starts the game, it writes a one-time
WEB_TOKEN.BattleNetSignIn.renew():Warcraft III.exewhose parent isBattle.net.exe;EDITOR_TOKEN.This takes about a second. It holds a shared loopback lock until the launched client has signed in, which the client shows by replacing
EDITOR_TOKENabout ten seconds after launch; it waits at most two minutes. Released earlier, another tool could replace the token before this client read it.Validation
Tests pass:
BattleNetSignInTest(3)InitialBuildProgressTest(8)MapRequestPatchTargetTests(17)WurstBuildConfigTests(14)BuildDiagnosticsTests(10)MapModelReuseTests(56)The lock port is pinned to the value every tool computes for the same path.
Live on Windows, with an expired
EDITOR_TOKENput back first:BattleNetSignIn.renew()took 1.1 s, and the direct-launch -editor -windowmode windowed -loadfilelaunch then reached the map's loading screen with no login panel.Live, renew, launch, then
releaseWhenSignedIn(): the lock was held through the renewal and freed 10.5 s and 11.6 s after launch in two runs, and the map loaded signed in.A Run Map started from VS Code has not been tried.