Browse Source

Merge pull request #9767 from Faless/editor_fix_2.1

[2.1] Remove "debug/remote_port" project setting (completrly moved to editor)
Rémi Verschelde 8 years ago
parent
commit
cfe48f074f

+ 2 - 1
editor/editor_import_export.cpp

@@ -1030,6 +1030,7 @@ static int _get_pad(int p_alignment, int p_n) {
 void EditorExportPlatform::gen_export_flags(Vector<String> &r_flags, int p_flags) {
 void EditorExportPlatform::gen_export_flags(Vector<String> &r_flags, int p_flags) {
 
 
 	String host = EditorSettings::get_singleton()->get("network/debug_host");
 	String host = EditorSettings::get_singleton()->get("network/debug_host");
+	int remote_port = (int)EditorSettings::get_singleton()->get("network/debug_port");
 
 
 	if (p_flags & EXPORT_REMOTE_DEBUG_LOCALHOST)
 	if (p_flags & EXPORT_REMOTE_DEBUG_LOCALHOST)
 		host = "localhost";
 		host = "localhost";
@@ -1049,7 +1050,7 @@ void EditorExportPlatform::gen_export_flags(Vector<String> &r_flags, int p_flags
 
 
 		r_flags.push_back("-rdebug");
 		r_flags.push_back("-rdebug");
 
 
-		r_flags.push_back(host + ":" + String::num(GLOBAL_DEF("network/debug_port", 6007)));
+		r_flags.push_back(host + ":" + String::num(remote_port));
 
 
 		List<String> breakpoints;
 		List<String> breakpoints;
 		ScriptEditor::get_singleton()->get_breakpoints(&breakpoints);
 		ScriptEditor::get_singleton()->get_breakpoints(&breakpoints);

+ 2 - 1
editor/editor_run.cpp

@@ -41,6 +41,7 @@ Error EditorRun::run(const String &p_scene, const String p_custom_args, const Li
 
 
 	String resource_path = Globals::get_singleton()->get_resource_path();
 	String resource_path = Globals::get_singleton()->get_resource_path();
 	String remote_host = EditorSettings::get_singleton()->get("network/debug_host");
 	String remote_host = EditorSettings::get_singleton()->get("network/debug_host");
+	int remote_port = (int)EditorSettings::get_singleton()->get("network/debug_port");
 
 
 	if (resource_path != "") {
 	if (resource_path != "") {
 		args.push_back("-path");
 		args.push_back("-path");
@@ -49,7 +50,7 @@ Error EditorRun::run(const String &p_scene, const String p_custom_args, const Li
 
 
 	if (true) {
 	if (true) {
 		args.push_back("-rdebug");
 		args.push_back("-rdebug");
-		args.push_back(remote_host + ":" + String::num(GLOBAL_DEF("network/debug_port", 6007)));
+		args.push_back(remote_host + ":" + String::num(remote_port));
 	}
 	}
 
 
 	args.push_back("-epid");
 	args.push_back("-epid");

+ 1 - 1
editor/editor_settings.cpp

@@ -413,7 +413,7 @@ void EditorSettings::setup_network() {
 	String lip;
 	String lip;
 	String hint;
 	String hint;
 	String current = has("network/debug_host") ? get("network/debug_host") : "";
 	String current = has("network/debug_host") ? get("network/debug_host") : "";
-	int port = has("network/debug_port") ? (int)get("network/debug_port") : 6007;
+	int port = has("network/debug_port") ? (int)get("network/debug_port") : 6096;
 
 
 	for (List<IP_Address>::Element *E = local_ip.front(); E; E = E->next()) {
 	for (List<IP_Address>::Element *E = local_ip.front(); E; E = E->next()) {
 
 

+ 3 - 3
editor/script_editor_debugger.cpp

@@ -1169,9 +1169,9 @@ void ScriptEditorDebugger::start() {
 		perf_max[i] = 0;
 		perf_max[i] = 0;
 	}
 	}
 
 
-	uint16_t remote_port = GLOBAL_DEF("debug/remote_port", 6007);
-	if (server->listen(remote_port) != OK) {
-		EditorNode::get_log()->add_message(String("** Error listening on port ") + itos(remote_port) + String(" **"));
+	uint16_t debug_port = (int)EditorSettings::get_singleton()->get("network/debug_port");
+	if (server->listen(debug_port) != OK) {
+		EditorNode::get_log()->add_message(String("** Error listening on port ") + itos(debug_port) + String(" **"));
 		return;
 		return;
 	}
 	}
 	set_process(true);
 	set_process(true);

+ 1 - 1
main/main.cpp

@@ -562,7 +562,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
 	if (debug_mode == "remote") {
 	if (debug_mode == "remote") {
 
 
 		ScriptDebuggerRemote *sdr = memnew(ScriptDebuggerRemote);
 		ScriptDebuggerRemote *sdr = memnew(ScriptDebuggerRemote);
-		uint16_t debug_port = GLOBAL_DEF("debug/remote_port", 6007);
+		uint16_t debug_port = 6096;
 		if (debug_host.find(":") != -1) {
 		if (debug_host.find(":") != -1) {
 			int sep_pos = debug_host.find_last(":");
 			int sep_pos = debug_host.find_last(":");
 			debug_port = debug_host.substr(sep_pos + 1, debug_host.length()).to_int();
 			debug_port = debug_host.substr(sep_pos + 1, debug_host.length()).to_int();