Fix: [Emscripten] switch to URL for content-service that supports WebSocket (#11106)

In the old days, content.openttd.org and bananas-server.openttd.org
ended up on the same route. But with a recent migration, they do not.
content.openttd.org only serves the custom TCP protocol, and
bananas-server.openttd.org only serves the HTTP(S).

Websockets use HTTPS, and as such, should be routed via the latter.
This commit is contained in:
Patric Stout 2023-07-04 14:39:55 +02:00 committed by GitHub
parent 381fa36450
commit bc83974b38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@ Module.arguments.push('-mnull', '-snull', '-vsdl:relative_mode');
Module['websocket'] = { url: function(host, port, proto) {
/* openttd.org hosts a WebSocket proxy for the content service. */
if (host == "content.openttd.org" && port == 3978 && proto == "tcp") {
return "wss://content.openttd.org/";
return "wss://bananas-server.openttd.org/";
}
/* Everything else just tries to make a default WebSocket connection.
@ -41,7 +41,7 @@ Module.preRun.push(function() {
/* Check if the OpenGFX baseset is already downloaded. */
if (!FS.analyzePath(content_download_dir + '/baseset/opengfx-0.6.0.tar').exists) {
window.openttd_downloaded_opengfx = true;
FS.createPreloadedFile(content_download_dir + '/baseset', 'opengfx-0.6.0.tar', 'https://installer.cdn.openttd.org/emscripten/opengfx-0.6.0.tar', true, true);
FS.createPreloadedFile(content_download_dir + '/baseset', 'opengfx-0.6.0.tar', 'https://binaries.openttd.org/installer/emscripten/opengfx-0.6.0.tar', true, true);
} else {
/* Fake dependency increase, so the counter is stable. */
Module.addRunDependency('opengfx');