diff options
author | Juan Linietsky <reduzio@gmail.com> | 2023-04-28 13:15:36 +0200 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2023-05-08 11:57:54 +0200 |
commit | 273a6eeb66ed1ff2fcc1ee3a6eaae4eedf437875 (patch) | |
tree | 6c7531b5b1351a810c87d923fb7f04e1b6de25ca /main | |
parent | 352ebe97259622f20b47627b4bf747cdfc79304d (diff) | |
download | redot-engine-273a6eeb66ed1ff2fcc1ee3a6eaae4eedf437875.tar.gz |
Redo how the remote filesystem works
Instead of reading files over the network, the new version uses a local file cache and only updates files when it changes.
The original remote filesystem was created 14 years ago, when ethernet was faster than hard drives or even flash. Also, mobile devices have a very small amount of storage.
Nowadays, this is no longer the case so the approach is changed to using a persistent cache in the target device.
Co-authored-by: m4gr3d
Diffstat (limited to 'main')
-rw-r--r-- | main/main.cpp | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/main/main.cpp b/main/main.cpp index 5e0187cc7f..707ef6ec3d 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -41,7 +41,6 @@ #include "core/input/input.h" #include "core/input/input_map.h" #include "core/io/dir_access.h" -#include "core/io/file_access_network.h" #include "core/io/file_access_pack.h" #include "core/io/file_access_zip.h" #include "core/io/image_loader.h" @@ -129,7 +128,6 @@ static Time *time_singleton = nullptr; #ifdef MINIZIP_ENABLED static ZipArchive *zip_packed_data = nullptr; #endif -static FileAccessNetworkClient *file_access_network_client = nullptr; static MessageQueue *message_queue = nullptr; // Initialized in setup2() @@ -1384,9 +1382,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph // Network file system needs to be configured before globals, since globals are based on the // 'project.godot' file which will only be available through the network if this is enabled - FileAccessNetwork::configure(); if (!remotefs.is_empty()) { - file_access_network_client = memnew(FileAccessNetworkClient); int port; if (remotefs.contains(":")) { port = remotefs.get_slicec(':', 1).to_int(); @@ -1394,14 +1390,12 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } else { port = 6010; } + Error err = OS::get_singleton()->setup_remote_filesystem(remotefs, port, remotefs_pass, project_path); - Error err = file_access_network_client->connect(remotefs, port, remotefs_pass); if (err) { OS::get_singleton()->printerr("Could not connect to remotefs: %s:%i.\n", remotefs.utf8().get_data(), port); goto error; } - - FileAccess::make_default<FileAccessNetwork>(FileAccess::ACCESS_RESOURCES); } if (globals->setup(project_path, main_pack, upwards, editor) == OK) { @@ -1937,9 +1931,6 @@ error: if (packed_data) { memdelete(packed_data); } - if (file_access_network_client) { - memdelete(file_access_network_client); - } unregister_core_driver_types(); unregister_core_extensions(); @@ -3448,9 +3439,6 @@ void Main::cleanup(bool p_force) { if (packed_data) { memdelete(packed_data); } - if (file_access_network_client) { - memdelete(file_access_network_client); - } if (performance) { memdelete(performance); } |