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

Clean up Lobby & Server in general #261

Merged
merged 44 commits into from
Sep 29, 2020
Merged

Clean up Lobby & Server in general #261

merged 44 commits into from
Sep 29, 2020

Conversation

xeruf
Copy link
Member

@xeruf xeruf commented Apr 16, 2020

Many useful more or less independent changes - reviewing the commits independently might be easier, this will also be a rebase merge :)

  • test ScoreDefinition
  • test GameRoom
  • compare GameResult before and after
  • compare PlayerScore before and after

@xeruf xeruf requested a review from SKoschnicke April 16, 2020 15:38
@xeruf xeruf changed the title fix(server): clean up lobby Clean up Lobby & Server in general Apr 16, 2020
Copy link
Contributor

@SKoschnicke SKoschnicke left a comment

Choose a reason for hiding this comment

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

Sieht soweit gut aus.

Zwei Dinge:

  • gab es keine Moeglichkeit beim Refactoring des GameRooms ein paar mehr Tests zu erstellen?
  • GameResult ist relevant fuer XStream. In der Vergangenheit hatten wir Probleme mit XStream wenn annotierte Klassen nach Kotlin umgewandelt wurden. Hast du verifiziert, dass das XML korrekt erstellt und geparst wird?

@xeruf xeruf force-pushed the fix/improve-lobby branch 2 times, most recently from 2c2e49b to 115bd47 Compare April 30, 2020 12:43
Copy link
Contributor

@anarchuser anarchuser left a comment

Choose a reason for hiding this comment

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

This looks good as far as I understand the changes

@xeruf xeruf force-pushed the fix/improve-lobby branch 2 times, most recently from 6032a1d to ca82f1a Compare May 4, 2020 11:01
@xeruf
Copy link
Member Author

xeruf commented May 5, 2020

image
YIKES! All the XML tests were completely off because we didn't configure XStream to process the annotations - see the actual output on the right...

xeruf and others added 15 commits May 5, 2020 14:09
# Conflicts:
#	server/src/sc/server/Lobby.kt
#	server/src/sc/server/network/ClientManager.java
#	server/src/sc/server/network/NewClientListener.java
…gh a separate method

# Conflicts:
#	server/src/sc/server/Lobby.kt
#	server/src/sc/server/network/ClientManager.java
#	server/src/sc/server/network/NewClientListener.java
# Conflicts:
#	server/src/sc/server/Lobby.kt
#	server/src/sc/server/network/ClientManager.java
#	server/src/sc/server/network/NewClientListener.java
# Conflicts:
#	server/src/sc/server/Lobby.kt
#	server/src/sc/server/network/ClientManager.java
#	server/src/sc/server/network/NewClientListener.java
# Conflicts:
#	server/src/sc/server/Lobby.kt
#	server/src/sc/server/network/ClientManager.java
#	server/src/sc/server/network/NewClientListener.java
# Conflicts:
#	server/src/sc/server/Lobby.kt
#	server/src/sc/server/network/ClientManager.java
#	server/src/sc/server/network/NewClientListener.java
# Conflicts:
#	server/src/sc/server/Lobby.kt
#	server/src/sc/server/network/ClientManager.java
#	server/src/sc/server/network/NewClientListener.java
Previously it didn't have an equals method, making proper testing almost impossible.
Also removes isRegular from the XML.

# Conflicts:
#	server/src/sc/server/Lobby.kt
#	server/src/sc/server/network/ClientManager.java
#	server/src/sc/server/network/NewClientListener.java
@xeruf xeruf force-pushed the fix/improve-lobby branch 2 times, most recently from 4ffb31a to 7d78e08 Compare September 11, 2020 18:51
@xeruf
Copy link
Member Author

xeruf commented Sep 11, 2020

@anarchuser the GameResultTest is failing because the ITeam is not serialized like the PlayerColor by XStream. We need to investigate that.

@xeruf
Copy link
Member Author

xeruf commented Sep 22, 2020

@SKoschnicke I am not quite sure how much there is to test in the GameRoom

@anarchuser
Copy link
Contributor

#298

@xeruf
Copy link
Member Author

xeruf commented Sep 25, 2020

@SKoschnicke @anarchuser please do a final review, then I'll merge this with a regular commit - finally!


fun size(): Int = parts.size

val values: List<BigDecimal>
Copy link
Contributor

Choose a reason for hiding this comment

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

Didn't we want to get rid of BigDecimal?
Or is there a good reason to keep it?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think the scores will ever go out of int range. Can't think of a good reason.

Copy link
Member Author

Choose a reason for hiding this comment

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

If we average them, they may not be int anymore. And if we get floating-point errors in a championship scoring, we have a problem. Better safe than sorry I'd say.

@xeruf xeruf merged commit c7b3841 into master Sep 29, 2020
@xeruf xeruf deleted the fix/improve-lobby branch September 29, 2020 09:34
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.

3 participants