-
Notifications
You must be signed in to change notification settings - Fork 117
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
Feature/#1966 friend in game indicator #2034
Feature/#1966 friend in game indicator #2034
Conversation
merge fix
Looks up online friends and matches these to the players inside the game lobby. Games with friends are highlighted Fixes FAForever#1966
src/main/java/com/faforever/client/game/GamesTableController.java
Outdated
Show resolved
Hide resolved
@@ -110,6 +112,8 @@ public void setGame(Game game) { | |||
)); | |||
|
|||
lockIconLabel.visibleProperty().bind(game.passwordProtectedProperty()); | |||
friendsLabel.visibleProperty().bind(new SimpleBooleanProperty(!playerService.friendsInGame(game).isEmpty())); |
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.
Is that updated if a friend joins a game?
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.
yes, you can follow friends when they hop from lobby to lobby
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.
my concern was if setGame is called again if a new player joins or if you add a new friend... the later I doubt
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.
my concern was if setGame is called again if a new player joins or if you add a new friend... the later I doubt
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.
And binding makes no sense if the BooleanProperty
is never updated!!!
src/main/java/com/faforever/client/game/GameTileController.java
Outdated
Show resolved
Hide resolved
src/main/java/com/faforever/client/game/GamesTableController.java
Outdated
Show resolved
Hide resolved
.flatMap(Collection::stream) | ||
.collect(Collectors.toList()); | ||
List<Player> friendsInGame = this.friendsOnline().stream() | ||
.filter(e -> playersInGame.contains(e.getUsername())) |
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.
That will result in some false positives
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.
@axel1200 I may be missing something here, I am unable to find the false positives in the logic you mention.
This weekend I ran some tests and I did not see any false positives occur when running multiple hours with 1000+ users online.
Could you elaborate on the false positives?
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 don't think this will have false positives as each username is assumed to be unique and this checks if the username is in the list correct?
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.
yea that's right
Is this being worked on? If not will close |
Hey @Sheikah45 I'll get on with it again this month, did not have time to contribute to FAF in December. |
Looks up online friends and matches these to the players inside the game lobby. Games with friends are highlighted Fixes FAForever#1966
Hi @Atrocyte |
hey @ivan-gryzunov! The PR is stuck on a comment that my methods friendsOnline and friendInGame in the PlayerService cause false positives. I can't find any false positives in logic and in testing, so could you please comment/help on that? Apart from that bit the change is ready to go IMO, thank you for participating :) |
@Atrocyte it looks like there are also still open issues with the changing of the id rather than state as well |
…icator' into feature/#1966_friend_in_game_indicator # Conflicts: # src/main/java/com/faforever/client/game/GameTileController.java # src/main/java/com/faforever/client/game/GamesTableController.java # src/main/resources/theme/style.css
…icator # Conflicts: # src/main/resources/theme/play/games_table.fxml # src/test/java/com/faforever/client/game/GamesTableControllerTest.java
Codecov Report
@@ Coverage Diff @@
## develop #2034 +/- ##
=============================================
+ Coverage 54.82% 54.84% +0.01%
- Complexity 3730 3739 +9
=============================================
Files 573 573
Lines 19883 19906 +23
Branches 1148 1152 +4
=============================================
+ Hits 10901 10917 +16
Misses 8385 8385
- Partials 597 604 +7
Continue to review full report at Codecov.
|
@@ -110,6 +112,8 @@ public void setGame(Game game) { | |||
)); | |||
|
|||
lockIconLabel.visibleProperty().bind(game.passwordProtectedProperty()); | |||
friendsLabel.visibleProperty().bind(new SimpleBooleanProperty(!playerService.friendsInGame(game).isEmpty())); |
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.
my concern was if setGame is called again if a new player joins or if you add a new friend... the later I doubt
@@ -110,6 +112,8 @@ public void setGame(Game game) { | |||
)); | |||
|
|||
lockIconLabel.visibleProperty().bind(game.passwordProtectedProperty()); | |||
friendsLabel.visibleProperty().bind(new SimpleBooleanProperty(!playerService.friendsInGame(game).isEmpty())); |
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.
my concern was if setGame is called again if a new player joins or if you add a new friend... the later I doubt
@@ -110,6 +112,8 @@ public void setGame(Game game) { | |||
)); | |||
|
|||
lockIconLabel.visibleProperty().bind(game.passwordProtectedProperty()); | |||
friendsLabel.visibleProperty().bind(new SimpleBooleanProperty(!playerService.friendsInGame(game).isEmpty())); |
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.
And binding makes no sense if the BooleanProperty
is never updated!!!
friendsColumn.setCellValueFactory(param -> new SimpleBooleanProperty(!playerService.friendsInGame(param.getValue()).isEmpty())); | ||
friendsColumn.setCellFactory(param -> friendsCell()); |
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.
also here not updated
.collect(Collectors.toList()); | ||
} | ||
|
||
public List<Player> friendsInGame(Game game) { |
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.
Should probably be an Observable list so you can Listen for changes
Some of my comments are marked as resolved but they are not no idea how that happend |
Is this still being worked on? |
Gonna close if not being worked on |
Stale |
Looks up online friends and matches these to the players inside the game lobby.
Games with friends are highlighted and have a smiley
fixes #1966