diff --git a/CMakeLists.txt b/CMakeLists.txt index f92d2d5c63..b3c00c8ae7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -330,7 +330,7 @@ if(EMSCRIPTEN) add_definitions(-s DISABLE_EXCEPTION_CATCHING=0) # Export functions to Javascript. - target_link_libraries(WASM::WASM INTERFACE "-s EXPORTED_FUNCTIONS='[\"_main\", \"_em_openttd_add_server\"]' -s EXPORTED_RUNTIME_METHODS='[\"cwrap\"]'") + target_link_libraries(WASM::WASM INTERFACE "-s EXPORTED_FUNCTIONS='[\"_main\"]' -s EXPORTED_RUNTIME_METHODS='[\"cwrap\"]'") # Preload all the files we generate during build. # As we do not compile with FreeType / FontConfig, we also have no way to diff --git a/os/emscripten/pre.js b/os/emscripten/pre.js index 113a3acc10..603e47a658 100644 --- a/os/emscripten/pre.js +++ b/os/emscripten/pre.js @@ -68,13 +68,6 @@ Module.preRun.push(function() { Module.onAbort(); } - window.openttd_server_list = function() { - add_server = Module.cwrap("em_openttd_add_server", null, ["string", "number"]); - - /* Add servers that support WebSocket here. Example: - * add_server("localhost", 3979); */ - } - var leftButtonDown = false; document.addEventListener("mousedown", e => { if (e.button == 0) { diff --git a/src/network/network.cpp b/src/network/network.cpp index 0687d67f25..f98113fdc3 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -1100,14 +1100,3 @@ void NetworkShutDown() NetworkCoreShutdown(); } - -#ifdef __EMSCRIPTEN__ -extern "C" { - -void CDECL em_openttd_add_server(const char *host, int port) -{ - NetworkUDPQueryServer(NetworkAddress(host, port), true); -} - -} -#endif diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 382cc4b776..743fb0936b 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -471,14 +471,6 @@ public: this->filter_editbox.cancel_button = QueryString::ACTION_CLEAR; this->SetFocusedWidget(WID_NG_FILTER); - /* As the master-server doesn't support "websocket" servers yet, we - * let "os/emscripten/pre.js" hardcode a list of servers people can - * join. This means the serverlist is curated for now, but it is the - * best we can offer. */ -#ifdef __EMSCRIPTEN__ - EM_ASM(if (window["openttd_server_list"]) openttd_server_list()); -#endif - this->last_joined = NetworkGameListAddItem(NetworkAddress(_settings_client.network.last_host, _settings_client.network.last_port)); this->server = this->last_joined; if (this->last_joined != nullptr) NetworkUDPQueryServer(this->last_joined->address); @@ -603,13 +595,6 @@ public: this->GetWidget(WID_NG_NEWGRF_SEL)->SetDisplayedPlane(sel == nullptr || !sel->online || sel->info.grfconfig == nullptr); this->GetWidget(WID_NG_NEWGRF_MISSING_SEL)->SetDisplayedPlane(sel == nullptr || !sel->online || sel->info.grfconfig == nullptr || !sel->info.version_compatible || sel->info.compatible); -#ifdef __EMSCRIPTEN__ - this->SetWidgetDisabledState(WID_NG_SEARCH_INTERNET, true); - this->SetWidgetDisabledState(WID_NG_SEARCH_LAN, true); - this->SetWidgetDisabledState(WID_NG_ADD, true); - this->SetWidgetDisabledState(WID_NG_START, true); -#endif - this->DrawWidgets(); }