1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

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
This commit is contained in:
Juan Linietsky
2023-04-28 13:15:36 +02:00
parent 352ebe9725
commit 273a6eeb66
22 changed files with 714 additions and 1039 deletions

View File

@@ -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.