8000 Add command line argument parsing by pehala · Pull Request #40 · PhilippvK/playforia-minigolf · GitHub
[go: up one dir, main page]

Skip to content

Add command line argument parsing - #40

Merged
PhilippvK merged 2 commits into
PhilippvK:masterfrom
pehala:cli
Sep 5, 2020
Merged

PhilippvK merged 2 commits into
PhilippvK:masterfrom
pehala:cli

Conversation

@pehala
@pehala pehala commented Sep 2, 2020
Copy link
Copy Markdown
Collaborator
  • Use picocli for cli parsing.
  • Separate launcher code from server/client starting code.
    • New main classes are called Launcher.
    • Migrate client starting code into Game class.
    • Migrate server starting code into Server class.
  • Add ability to change the port.
  • Log that server has started.

Fixes #38

@PhilippvK PhilippvK left a comment
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow!

@PhilippvK
Copy link
Copy Markdown
Owner

May I ask you if you are doing this just for fun or do you play the game with others in a "regular" manner?

@pehala
pehala commented Sep 2, 2020 •
Copy link
Copy Markdown
Collaborator Author

Kind of both, we used to play a lot with friends and we are slowly getting back to playing it and also I am a sucker for open source and I like to contribute to stuff I am using, I always have some kind of hobby programming project that I am working on side so right now this is it :D

@PhilippvK
Copy link
Copy Markdown
Owner

Kind of both, we used to play a lot with friends and we are slowly getting back to playing it and also I am a sucker for open source and I like to contribute to stuff I am using.

That's great. But do you have bad experience with the performance of the client-server communication? While the client is almost the same as the playforia JAR the server was reimplemented in a rather unreliable way. Until now I was in the opinion that the effort of fixing the issues with the server is not worth it because it works okay most of the time. Do you have any opinion on this.

I assume that you host the server from your home network for your friends? Do you think this is the best approach for now or would you prefer something else?

@pehala
pehala commented Sep 2, 2020
Copy link
Copy Markdown
Collaborator Author

Kind of both, we used to play a lot with friends and we are slowly getting back to playing it and also I am a sucker for open source and I like to contribute to stuff I am using.

That's great. But do you have bad experience with the performance of the client-server communication? While the client is almost the same as the playforia JAR the server was reimplemented in a rather unreliable way. Until now I was in the opinion that the effort of fixing the issues with the server is not worth it because it works okay most of the time. Do you have any opinion on this.

I assume that you host the server from your home network for your friends? Do you think this is the best approach for now or would you prefer something else?

If you are asking about improvements to the network communication code itself, I think that it is alright for now, although we did not play for long enough yet to have enough data to judge this. It is written in a very suboptimal way, as most of this project is, but it seems to be somehow working for now. Only thing I think might be worthwhile is upgrading to a newer version of Netty to keep this project up to date, but that is only nice to have and should be done with caution as we do not have any test coverage to make sure it is working.

If you are asking about improvements in general for this project, I think that they are no updates actively needed as it is working fine.
With that said, I also think that we can improve on a lot of areas like other distribution packages, better usability, maintaining code and others, but none of this is really necessary just nice to have.

@pehala
pehala commented Sep 2, 2020
Copy link
Copy Markdown
Collaborator Author

Anyway, if you have some issues you would like to help with, just tag me in and I can take a look.

- Add port option
- Separate launcher code into their own class.
@pehala
pehala commented Sep 4, 2020
Copy link
Copy Markdown
Collaborator Author

Rebased to the current master

@PhilippvK
PhilippvK merged commit 700def3 into PhilippvK:master Sep 5, 2020 8000
@PhilippvK
Copy link
Copy Markdown
Owner

@pehala Hey, I can not find /icons/playforia.png inside the repo. Is is possible that you forgot to push it?

@pehala
pehala commented Sep 5, 2020
Copy link
Copy Markdown
Collaborator Author

100% is although I am surprised it passed the CI then

@PhilippvK
Copy link
Copy Markdown
Owner

appletloader_playforia.gif is the file, right?

It just crashes when launching the Jar.

@pehala
pehala commented Sep 5, 2020
Copy link
Copy Markdown
Collaborator Author

Yep it seems to be missing, sorry about that, should I hotfix that or will you can of it?

@PhilippvK
Copy link
Copy Markdown
Owner

I can do it. Should not require a PR.

Should I convert the GIF to PNG before?

@pehala
pehala commented Sep 5, 2020
Copy link
Copy Markdown
Collaborator Author

appletloader_playforia.gif is the file, right?

It just crashes when launching the Jar.

Nope the image is the same as the rest of the items, just in the PNG format. I took it from you distribution branch.

@PhilippvK
Copy link
Copy Markdown
Owner

Ahhh I remember! Thanks.

@PhilippvK
Copy link
Copy Markdown
Owner

Why do you think CI should have caught that missing file. Is there an option to test the compiled program for runtime exeptions?

@pehala
pehala commented Sep 5, 2020
Copy link
Copy Markdown
Collaborator Author

I thought it was compile time :D I forgot I used icon on the runtime.

Anyway I think it would be possible to specify test this (we could write a test case - specifically for this icon) and cli so I created issue for it.

@PhilippvK
Copy link
Copy Markdown
Owner

I recognized that the possibility that the popup with the Host & Port selection is dismissed via the cancel button is not catched. In this case the program is supposed to quit.

Resulting Exception:

Exception in thread "Thread-5" java.lang.IllegalArgumentException: protocol = http host = null
	at sun.net.spi.DefaultProxySelector.select(DefaultProxySelector.java:177)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)
...

@pehala
pehala commented Sep 6, 2020
Copy link
Copy Markdown
Collaborator Author

I recognized that the possibility that the popup with the Host & Port selection is dismissed via the cancel button is not catched. In this case the program is supposed to quit.

Resulting Exception:

Exception in thread "Thread-5" java.lang.IllegalArgumentException: protocol = http host = null
	at sun.net.spi.DefaultProxySelector.select(DefaultProxySelector.java:177)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)
...

I will take look at it, thanks!

@PhilippvK
Copy link
Copy Markdown
Owner

I already kinda fixed it on my master branch. If you want to handle in in another way feel free to propose something.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add commandline arguments
3847

2 participants

0