-
-
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
Fix single player quick start, add ranking icons to player lists in lobbies #117
Conversation
Enumeration is a legacy class used for element iteration and has been superseded by Iterator, which can be looped over using a for-each loop. These are more concise to read and don't pollute variable scopes.
Most of the code was already in place, the regular expression matching packages in the server needed to be adjusted a bit. Also, the game code assumed that everyone starting a game was already in a lobby so I modified the quick start code to join the single player lobby before launching a game.
Instead of constantly polling for changes in the events queue and sleeping, using a BlockingQueue, the server can simply wait until receives any events and then react accordingly. This saves resources and simplifies the server logic.
Registered players have a ranking icon next to their names in lobbies. This also adjusts the default ranking to be 0, instead of 10000 to display the basic ranking icon.
|
||
while (var3.hasMoreElements()) { | ||
var3.nextElement().actionPerformed(var2); | ||
for (ActionListener listener : aVector3280) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you deobfuscate aVector3280
to listeners
or something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a local branch where I convert the codebase from using Vector
s everywhere to List
s and that's exactly what I do there: StenAL@7befbe5
I'd prefer to do the deobfuscation as part of the follow-up PR with that commit instead of backporting the changes here if that works for you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, fine :)
|
||
while (var3.hasMoreElements()) { | ||
var3.nextElement().itemStateChanged(var2); | ||
for (ItemListener listener : aVector3305) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above
|
||
while (var1.hasMoreElements()) { | ||
var1.nextElement().realSetState(false); | ||
for (ColorCheckbox colorCheckbox : aVector1553) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above?
|
||
while (var4.hasMoreElements()) { | ||
ColorListItem var3 = var4.nextElement(); | ||
ColorListItemGroup var2 = var3.getGroup(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Would you mind deobfuscating some trivial variable names used in the foreach loops?
This PR contains the following changes:
Enumeration
class is removed. It is superseded by the more modern approach of using for-each loops which are more concise to read and don't pollute variable scopes.single-player-quick-old.webm
single-player-quick-new.webm