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 /editor/debugger/editor_file_server.h | |
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 'editor/debugger/editor_file_server.h')
-rw-r--r-- | editor/debugger/editor_file_server.h | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/editor/debugger/editor_file_server.h b/editor/debugger/editor_file_server.h index ff2742e73f..4374f508ee 100644 --- a/editor/debugger/editor_file_server.h +++ b/editor/debugger/editor_file_server.h @@ -31,46 +31,24 @@ #ifndef EDITOR_FILE_SERVER_H #define EDITOR_FILE_SERVER_H -#include "core/io/file_access_network.h" #include "core/io/packet_peer.h" #include "core/io/tcp_server.h" #include "core/object/class_db.h" #include "core/os/thread.h" +#include "editor/editor_file_system.h" class EditorFileServer : public Object { GDCLASS(EditorFileServer, Object); - enum Command { - CMD_NONE, - CMD_ACTIVATE, - CMD_STOP, - }; - - struct ClientData { - Thread *thread = nullptr; - Ref<StreamPeerTCP> connection; - HashMap<int, Ref<FileAccess>> files; - EditorFileServer *efs = nullptr; - bool quit = false; - }; - Ref<TCPServer> server; - HashSet<Thread *> to_wait; - - static void _close_client(ClientData *cd); - static void _subthread_start(void *s); - - Mutex wait_mutex; - Thread thread; - static void _thread_start(void *); - bool quit = false; - Command cmd = CMD_NONE; - String password; int port = 0; bool active = false; + void _scan_files_changed(EditorFileSystemDirectory *efd, const Vector<String> &p_tags, HashMap<String, uint64_t> &files_to_send, HashMap<String, uint64_t> &cached_files); public: + void poll(); + void start(); void stop(); |