diff --git a/de.peeeq.wurstscript/src/main/java/de/peeeq/wurstio/languageserver/requests/BattleNetSignIn.java b/de.peeeq.wurstscript/src/main/java/de/peeeq/wurstio/languageserver/requests/BattleNetSignIn.java index 471f4b88a..fb3f640fc 100644 --- a/de.peeeq.wurstscript/src/main/java/de/peeeq/wurstio/languageserver/requests/BattleNetSignIn.java +++ b/de.peeeq.wurstscript/src/main/java/de/peeeq/wurstio/languageserver/requests/BattleNetSignIn.java @@ -55,8 +55,8 @@ * its token where nothing else reads it; the script then sees the app start the game but no new token, and the user is * told to start Battle.net from the Start menu. * - *
The wc3-e2e-harness does the same (docs/BattleNetSignIn.md there). Both hold the same localhost port as a lock - * from the renewal until the launched client has signed in. + *
Every tool that renews this sign-in holds the same localhost port as a lock from the renewal until the launched
+ * client has signed in.
*/
@SuppressWarnings("StringConcatToTextBlock") // Error Prone 2.50 crashes on this source under javac 27.
public final class BattleNetSignIn {
@@ -425,9 +425,9 @@ private static Path tempDir() {
return Path.of(System.getProperty("java.io.tmpdir"));
}
- /** A copy of the wc3-e2e-harness {@code node/src/runner/battlenet-token.ps1}; keep them equal. */
+ /** The renewal script, run in the user's own registry view. */
static final String TOKEN_SCRIPT = "battlenet-token.ps1";
- /** A copy of the wc3-e2e-harness {@code node/src/runner/battlenet-window.ps1}; keep them equal. */
+ /** The watcher that keeps the app's window out of sight during the renewal. */
static final String WINDOW_SCRIPT = "battlenet-window.ps1";
/** The watcher's limit without a client: every request the renewal may send, then a launch and a slow sign-in. */
static final long WINDOW_WATCH_SECONDS = TIMEOUT_SECONDS + 150;
@@ -540,7 +540,7 @@ private static Optional The wc3-e2e-harness does the same ({@code startOutside} in node/src/runner/win32.cjs there).
*/
final class OutsideStart {
/** The {@code SW_} value WMI passes to the new process's first window. */
diff --git a/de.peeeq.wurstscript/src/test/java/de/peeeq/wurstio/languageserver/requests/BattleNetSignInTest.java b/de.peeeq.wurstscript/src/test/java/de/peeeq/wurstio/languageserver/requests/BattleNetSignInTest.java
index 2b06ef3e4..84da3dec5 100644
--- a/de.peeeq.wurstscript/src/test/java/de/peeeq/wurstio/languageserver/requests/BattleNetSignInTest.java
+++ b/de.peeeq.wurstscript/src/test/java/de/peeeq/wurstio/languageserver/requests/BattleNetSignInTest.java
@@ -201,9 +201,9 @@ public void readsOnlyTheRequestedBinaryValueFromRegQuery() {
}
@Test
- public void takesTheSameLockAsTheE2eHarness() {
+ public void takesTheSharedSignInLockPort() {
if (!Orient.isWindowsSystem()) throw new SkipException("Battle.net paths are Windows paths");
- // node/src/runner/battlenet.cjs in wc3-e2e-harness: 33000 + sha256(lower-cased path) as uint32 BE % 10000
+ // 33000 + sha256(lower-cased path) as uint32 BE % 10000, the port every tool that renews this sign-in binds
assertEquals(BattleNetSignIn.gatePort(Path.of("C:\\Users\\tester\\AppData\\Roaming\\Battle.net\\Battle.net.config")), 36941);
}