-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Save last used IP for client #75
Comments
Shall we use |
Is there anything else except the launcher options which should be saved in a persistent way as well? (f.e. last username,...) |
Username, port, ip, maybe even settings for the new lobby. But that all can be done iteratively, for now I would do only IP, port and username. |
At a later point we could also add a dropdown to choose the language in the launcher. But as a prerequisite we might have to scan which language actually do exist or hardcode them anywhere. |
Agree, we have them hardcoded in one Enum and we have ability to choose it with CLI options so actually only thing missing is adding it a a dropdown to the menu. |
I am not sure if the languages are actually used in the UI but I guess thats entirely different issue |
We could use it but preferences are backend neutral (at least thats what I have learn from a quick google) so we will probably have to write the file saving/loading code at least partially ourselves |
I found this post about the Preferences API and it looks that it would be very easy to implement like in the example: https://www.vogella.com/tutorials/JavaPreferences/article.html |
We could definitely try doing PoC |
Should only the last used ip+port in the launcher window be remembered or the |
Ideally the command line as well |
Saving the currently chosen preferences can happen just after submitting the dialog? Alternatively we could only save the setting if the following server connection was successful but this would be a bit harder. |
After submitting dialog is fine |
@pehala I have a quick question regarding your If I run Is that intended? If yes, how can I get just the |
Yes, it is intended, it is used by the picocli library in CLI. I fetch the version (2.1.0.0-BETA) in that class with this |
Thank you very much for clarification, I will try it out later. I want to save the client version together with the preferences to have the ability to perform migrations when the preferences-concept somehow changes. Do you have an idea on how to integrate the preferences management into the tests? |
Good idea!
You should design the implementation in a way that would allow you to use mocked preferences in test, so you could check the methods and stuff. |
Okay. I never used Mockito before and am currently not able to complete the tests. (Mostly the handling of dismissing/accepting the ServerSettings-Dialog is missing at the moment) Would you mind if I just push my current state so that you can help me getting the tests to work? |
Of course, go for it |
Partially resolves Issue #75 TODO: Also save language setting after it was added to the Launcher Dialog
@pehala I am out of ideas. It seems like my replacement for the |
Just create PR and I will look at it |
We should save somewhere the last IP that the client connected to to show instead of placeholder
127.0.0.1
.The text was updated successfully, but these errors were encountered: