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

feat(messaging): game join failed command #1045

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

Ivan-Shaml
Copy link
Member

When player fails to join a game, instead of notice, a new game_join_failed event is being sent, so the consumer can programmatically handle the exceptional behavior

This will be used in faf-java-commons for handling this situations, and then finally in the client

Closes #1044

 * When player fails to join a game, instead of "notice", a new "game_join_failed" event is being sent, so the consumer can programmatically handle the exceptional behaviour
@Ivan-Shaml Ivan-Shaml force-pushed the feat/game_join_failed branch from fa72e8a to f7f994b Compare February 9, 2025 15:03
Copy link
Collaborator

@Askaholic Askaholic left a comment

Choose a reason for hiding this comment

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

I think this is a great idea, and much needed addition honestly. I would have done it ages ago if I had someone to do the client side work for it, so happy to see someone is able to do that!

Some of the tests are flaky and will pass when we re-run them, although one of them is failing because the notice messages were removed and the test is expecting them to be there. That's why we need to keep sending the notice messages even with the addition of the new game_join_failed messages.


def __init__(self, message, uid, *args, **kwargs):
super().__init__(*args, **kwargs)
self.message = message
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we don't need to include the english messages. We should use fixed error codes instead like invalid_uid, invalid_state, invalid_password etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, I need to think about a structure for the object that we are gonna send, that will be useful for the client. With the new version check we have the ability to do this breaking change now.

server/lobbyconnection.py Outdated Show resolved Hide resolved
server/lobbyconnection.py Outdated Show resolved Hide resolved
server/lobbyconnection.py Outdated Show resolved Hide resolved
server/lobbyconnection.py Show resolved Hide resolved
  - Introduces version check mechanism for the client, so breaking API changes can be introduced, while remaining backwards-compatible
@Ivan-Shaml Ivan-Shaml force-pushed the feat/game_join_failed branch from 2a1b66f to 089887d Compare February 11, 2025 19:36
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 an event object for handling negative game joins
2 participants