Closed colinwerner closed 5 years ago
Thank you again for a very nice contribution! I like the approach you took; it's a nice balance between separation and pragmatic access.
Since this is a substantial contribution, I'll be a little more picky in this code review. The points I'm raising are minor blemishes, so I'm sure you won't have trouble taking care of them. :)
Instead of client.getClientListeners().get(gameName)
, it might be cleaner to add a getter to do client.getClientListener(gameName)
The copyright/attribution header at the top of MessageHandler.java doesn't quite reflect this new file; see SwingMainDisplay.java for an example for a file broken out from SOCPlayerClient. Please also put a copyright line there to give yourself credit for this work; if you'd rather not have an email address there, just put your name.
The project coding style in Readme.developer.md
calls for 4 spaces instead of tabs to indent. This is pretty trivial but it affects every line when someone runs "git blame" later, so I'd rather keep your name on those lines you've updated instead of fixing the whitespace myself
A few places in comments and javadocs say SOCPlayerClient.MessageHandler
instead of just MessageHandler
I'll comment at a couple specific lines of code with very minor fixes
So, a few really small things. If you can please add a follow-up commit for them to your branch, that should take care of it.
Thanks again for putting this together!
-Jeremy
There is one instance where the entire map is required (I believe for broadcast message). So I left it as a getter -- it can be simplified later?
- Instead of
client.getClientListeners().get(gameName)
, it might be cleaner to add a getter to doclient.getClientListener(gameName)
I could add both?
Adding both sounds good :)
I believe I have updated everything (and some more). Please let me know...
1.) rename MessageTreater to MessageHandler 2.) move MessageHandler to its own class 3.) added a couple comments about follow-up commits 4.) added two getters to facilitate the move to its own class
To test I beat up a bunch of bots with unrelenting ferocity.
I also ran a bunch of bots (as per jdmonin). java -jar JSettlersServer-2.0.00.jar -Djsettlers.bots.botgames.total=9 -Djsettlers.bots.botgames.parallel=5 -Djsettlers.bots.fast_pause_percent=1