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:
parent
352ebe9725
commit
273a6eeb66
22 changed files with 714 additions and 1039 deletions
|
|
@ -311,7 +311,11 @@ String OS_Android::get_resource_dir() const {
|
|||
#ifdef TOOLS_ENABLED
|
||||
return OS_Unix::get_resource_dir();
|
||||
#else
|
||||
return "/"; //android has its own filesystem for resources inside the APK
|
||||
if (remote_fs_dir.is_empty()) {
|
||||
return "/"; // Android has its own filesystem for resources inside the APK
|
||||
} else {
|
||||
return remote_fs_dir;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -753,5 +757,15 @@ Error OS_Android::kill(const ProcessID &p_pid) {
|
|||
return OS_Unix::kill(p_pid);
|
||||
}
|
||||
|
||||
Error OS_Android::setup_remote_filesystem(const String &p_server_host, int p_port, const String &p_password, String &r_project_path) {
|
||||
r_project_path = get_user_data_dir();
|
||||
Error err = OS_Unix::setup_remote_filesystem(p_server_host, p_port, p_password, r_project_path);
|
||||
if (err == OK) {
|
||||
remote_fs_dir = r_project_path;
|
||||
FileAccess::make_default<FileAccessFilesystemJAndroid>(FileAccess::ACCESS_RESOURCES);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
OS_Android::~OS_Android() {
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue