Skip to content

Commit b58fe3f

Browse files
committed
Bundle index.html in launcher
1 parent c48c6b7 commit b58fe3f

File tree

4 files changed

+66
-10
lines changed

4 files changed

+66
-10
lines changed
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Warcraft 3 UI</title>
6+
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, minimal-ui" />
7+
<script>
8+
window.__DEBUG = new Boolean('').valueOf();
9+
</script>
10+
</head>
11+
<body>
12+
<div id="root"></div>
13+
<div id="portal"></div>
14+
15+
<script>
16+
var logCalls = [];
17+
var w3cClientVersion = 1;
18+
console.origLog = console.log;
19+
console.log = (...args) => {
20+
logCalls.push(...args);
21+
console.origLog("log");
22+
console.origLog(...args);
23+
}
24+
25+
</script>
26+
<script src="GlueManager.js"></script>
27+
<script src="https://w3champions.wc3.tools/prod/integration/w3champions.js"></script>
28+
</body>
29+
</html>
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Warcraft 3 UI</title>
6+
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, minimal-ui" />
7+
<script>
8+
window.__DEBUG = new Boolean('').valueOf();
9+
</script>
10+
</head>
11+
<body>
12+
<div id="root"></div>
13+
<div id="portal"></div>
14+
15+
<script>
16+
var logCalls = [];
17+
var w3cClientVersion = 1;
18+
console.origLog = console.log;
19+
console.log = (...args) => {
20+
logCalls.push(...args);
21+
console.origLog("log");
22+
console.origLog(...args);
23+
}
24+
25+
</script>
26+
<script src="GlueManager.js"></script>
27+
<script src="https://w3champions.wc3.tools/test/integration/w3champions.js"></script>
28+
</body>
29+
</html>

src/update-handling/FileService.ts

+4
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,10 @@ export class FileService {
234234
logger.info('reset textures!');
235235
}
236236

237+
public copyW3ChampionsFiles(w3Folder: string, isTest: boolean) {
238+
this.copyFile(`${__static}/w3c-files/${isTest ? "test" : "prod"}`, w3Folder);
239+
}
240+
237241
private copyFile(from: string, to:string) {
238242
try {
239243
logger.info(`Copy from: ${from} to: ${to}`);

src/update-handling/LauncherStrategy.ts

+4-10
Original file line numberDiff line numberDiff line change
@@ -193,23 +193,17 @@ export abstract class LauncherStrategy {
193193
this.store.commit.updateHandling.START_DLS();
194194
await this.downloadWebui();
195195

196-
// never download live webui to PTR
197-
if(this.isBlizzardPTR && this.isTest){
198-
await this.downloadWebuiToPTR();
199-
}
200-
201196
await this.store.dispatch.updateHandling.loadOnlineW3CVersion();
202197
this.store.dispatch.updateHandling.saveLocalW3CVersion(this.onlineW3cVersion);
203198
logger.info(`switched to test/live with w3c version: ${this.localW3cVersion}`)
204199
this.store.commit.updateHandling.FINISH_DLS();
205200
}
206201

207202
private async downloadWebui() {
208-
await this.downloadAndWriteFile("webui", this.w3Path);
209-
}
210-
211-
private async downloadWebuiToPTR() {
212-
await this.downloadAndWriteFile("webui", this.w3Path.replace('retail', 'ptr'));
203+
//await this.downloadAndWriteFile("webui", (this.isTest && this.isBlizzardPTR) ? this.w3Path.replace('_retail_', '_ptr_') : this.w3Path);
204+
this.store.getters.fileService.copyW3ChampionsFiles(
205+
this.isBlizzardPTR ? this.w3Path.replace('_retail_', '_ptr_') : this.w3Path,
206+
this.isTest);
213207
}
214208

215209
private updateDownloadProgress(progress: number) {

0 commit comments

Comments
 (0)