Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log project and port number #578

Closed
git2013vb opened this issue Mar 13, 2020 · 14 comments
Closed

Log project and port number #578

git2013vb opened this issue Mar 13, 2020 · 14 comments

Comments

@git2013vb
Copy link

Describe the project you are working on:
client server project
Describe the problem or limitation you are having in your project:
Every time I debug my client and my server at same time I have to set different port to show the debug result in dock
Describe the feature / enhancement and how it helps to overcome the problem or limitation:
move the port setting in project only
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
NA
If this enhancement will not be used often, can it be worked around with a few lines of script?:
nope
Is there a reason why this should be core and not an add-on in the asset library?:
NA

@KoBeWi
Copy link
Member

KoBeWi commented Mar 14, 2020

This needs more details.

@Calinou
Copy link
Member

Calinou commented Mar 15, 2020

You can create custom project settings that are then read in the client or server code:

# Default to 25000 if the setting evaluates to `false`
# (which will happen if it's not defined, as it will return `null`).
var port = ProjectSettings.get_setting("application/server/port") or 25000

@git2013vb
Copy link
Author

I'm talking about this:

image

@Calinou
Copy link
Member

Calinou commented Mar 16, 2020

Wouldn't this proposal become obsolete if godotengine/godot#37067 is merged anyaway?

@git2013vb
Copy link
Author

git2013vb commented Mar 16, 2020

Both solution are valid. In my case we will have more control?
My question is: what will happen if some ports are already reserved or we have in mind to use a port for any reasons and we don't want to became busy while we work?
If i consider this aspect I prefer to be able to set it by myself for each project. For someone else maybe is better the automatic solution.

@git2013vb
Copy link
Author

You can create custom project settings that are then read in the client or server code:

# Default to 25000 if the setting evaluates to `false`
# (which will happen if it's not defined, as it will return `null`).
var port = ProjectSettings.get_setting("application/server/port") or 25000

How I can access to editor settings likewise? - i use C# but I guess will be the same as gdscript.

@tanjunior
Copy link

I recently made a plugin to make changing ports more convenient
https://godotengine.org/asset-library/asset/641

@git2013vb
Copy link
Author

@tanjunior Thank you for your suggestion but I have already found a workaround with a plugin of mine as described here #37687 . It work setting to port when the project start.
Here I was asking to "move" the current editor settings in "project" settings.. Or make some sort of priority where if I set it in "project" settings it became the current setting for that project otherwise it will get the "editor" value setting instead.

@tanjunior
Copy link

@git2013vb That is a good idea, i will try to add it to my plugin.

@tanjunior
Copy link

I successfully added that to my plugin. It now saves the port in project settings. And everytime you open up the project it will retrieve the setting and apply it to editor settings. Waiting for it to be approved on Asset Library.
Meanwhile you can get it from my git https://github.com/tanjunior/Remote-Port-on-Toolbar

@KoBeWi
Copy link
Member

KoBeWi commented May 21, 2020

So this issue was basically solved by a plugin?

@git2013vb
Copy link
Author

git2013vb commented May 21, 2020

I still think that will be better to move it in Project property without be forced to use a plugin.
For something so simple its worth, too many plugins to load if not.
edit:
I'm wrong or this is already in place? #37067 as @Calinou said before in this tread?

@tanjunior
Copy link

Yea I made this plugin to use just until godot release new version with #37067 committed.

@git2013vb
Copy link
Author

So it is the same so we can close this :)
Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants