aboutsummaryrefslogtreecommitdiff
path: root/tools/editor/fileserver/editor_file_server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor/fileserver/editor_file_server.cpp')
-rw-r--r--tools/editor/fileserver/editor_file_server.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/editor/fileserver/editor_file_server.cpp b/tools/editor/fileserver/editor_file_server.cpp
index f72498f37..f21d9b4ec 100644
--- a/tools/editor/fileserver/editor_file_server.cpp
+++ b/tools/editor/fileserver/editor_file_server.cpp
@@ -317,12 +317,33 @@ EditorFileServer::EditorFileServer() {
cmd=CMD_NONE;
thread=Thread::create(_thread_start,this);
+ List<IP_Address> local_ip;
+ IP::get_singleton()->get_local_addresses(&local_ip);
EDITOR_DEF("file_server/port",6010);
+ String lip;
+ String hint;
+ for(List<IP_Address>::Element *E=local_ip.front();E;E=E->next()) {
+
+ String ip = E->get();
+ if (ip=="127.0.0.1")
+ continue;
+
+ if (lip!="")
+ lip=ip;
+ if (hint!="")
+ hint+=",";
+ hint+=ip;
+
+ }
+
+ EDITOR_DEF("file_server/host",lip);
+ EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"file_server/host",PROPERTY_HINT_ENUM,hint));
EDITOR_DEF("file_server/password","");
}
EditorFileServer::~EditorFileServer() {
+
quit=true;
Thread::wait_to_finish(thread);
memdelete(wait_mutex);