diff --git a/editor/fileserver/editor_file_server.cpp b/editor/fileserver/editor_file_server.cpp index 27fe7168553..306f047860e 100644 --- a/editor/fileserver/editor_file_server.cpp +++ b/editor/fileserver/editor_file_server.cpp @@ -150,13 +150,13 @@ void EditorFileServer::_subthread_start(void *s) { s.parse_utf8(fileutf8.ptr()); if (cmd == FileAccessNetwork::COMMAND_FILE_EXISTS) { - DEBUG_PRINT("FILE EXISTS: " + s); + print_verbose("FILE EXISTS: " + s); } if (cmd == FileAccessNetwork::COMMAND_GET_MODTIME) { - DEBUG_PRINT("MOD TIME: " + s); + print_verbose("MOD TIME: " + s); } if (cmd == FileAccessNetwork::COMMAND_OPEN_FILE) { - DEBUG_PRINT("OPEN: " + s); + print_verbose("OPEN: " + s); } if (!s.begins_with("res://")) { @@ -243,7 +243,7 @@ void EditorFileServer::_subthread_start(void *s) { int read = cd->files[id]->get_buffer(buf.ptrw(), blocklen); ERR_CONTINUE(read < 0); - DEBUG_PRINT("GET BLOCK - offset: " + itos(offset) + ", blocklen: " + itos(blocklen)); + print_verbose("GET BLOCK - offset: " + itos(offset) + ", blocklen: " + itos(blocklen)); //not found, continue encode_uint32(id, buf4); @@ -259,7 +259,7 @@ void EditorFileServer::_subthread_start(void *s) { } break; case FileAccessNetwork::COMMAND_CLOSE: { - DEBUG_PRINT("CLOSED"); + print_verbose("CLOSED"); ERR_CONTINUE(!cd->files.has(id)); memdelete(cd->files[id]); cd->files.erase(id); diff --git a/main/main.cpp b/main/main.cpp index 6310281ff82..ca1b03392a4 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -722,6 +722,29 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph I = N; } + // 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 != "") { + + file_access_network_client = memnew(FileAccessNetworkClient); + int port; + if (remotefs.find(":") != -1) { + port = remotefs.get_slicec(':', 1).to_int(); + remotefs = remotefs.get_slicec(':', 0); + } else { + port = 6010; + } + + 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(FileAccess::ACCESS_RESOURCES); + } + if (globals->setup(project_path, main_pack, upwards) == OK) { found_project = true; } else { @@ -768,28 +791,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph script_debugger = memnew(ScriptDebuggerLocal); OS::get_singleton()->initialize_debugging(); } - - FileAccessNetwork::configure(); - - if (remotefs != "") { - - file_access_network_client = memnew(FileAccessNetworkClient); - int port; - if (remotefs.find(":") != -1) { - port = remotefs.get_slicec(':', 1).to_int(); - remotefs = remotefs.get_slicec(':', 0); - } else { - port = 6010; - } - - 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(FileAccess::ACCESS_RESOURCES); - } if (script_debugger) { //there is a debugger, parse breakpoints