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 /core/os/os.cpp | |
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 'core/os/os.cpp')
-rw-r--r-- | core/os/os.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/core/os/os.cpp b/core/os/os.cpp index c82f87c731..4123a1d602 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -72,6 +72,10 @@ void OS::add_logger(Logger *p_logger) { } } +String OS::get_identifier() const { + return get_name().to_lower(); +} + void OS::print_error(const char *p_function, const char *p_file, int p_line, const char *p_code, const char *p_rationale, bool p_editor_notify, Logger::ErrorType p_type) { if (!_stderr_enabled) { return; @@ -357,13 +361,7 @@ void OS::set_has_server_feature_callback(HasServerFeatureCallback p_callback) { bool OS::has_feature(const String &p_feature) { // Feature tags are always lowercase for consistency. - if (p_feature == get_name().to_lower()) { - return true; - } - - // Catch-all `linuxbsd` feature tag that matches on both Linux and BSD. - // This is the one exposed in the project settings dialog. - if (p_feature == "linuxbsd" && (get_name() == "Linux" || get_name() == "FreeBSD" || get_name() == "NetBSD" || get_name() == "OpenBSD" || get_name() == "BSD")) { + if (p_feature == get_identifier()) { return true; } @@ -569,6 +567,10 @@ void OS::add_frame_delay(bool p_can_draw) { } } +Error OS::setup_remote_filesystem(const String &p_server_host, int p_port, const String &p_password, String &r_project_path) { + return default_rfs.synchronize_with_server(p_server_host, p_port, p_password, r_project_path); +} + OS::PreferredTextureFormat OS::get_preferred_texture_format() const { #if defined(__arm__) || defined(__aarch64__) || defined(_M_ARM) || defined(_M_ARM64) return PREFERRED_TEXTURE_FORMAT_ETC2_ASTC; // By rule, ARM hardware uses ETC texture compression. |