-
-
Notifications
You must be signed in to change notification settings - Fork 474
Specify reason when on game leave; fix #2624 #2633
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
Conversation
common/pb/event_leave.proto
Outdated
enum LeaveReason { | ||
OTHER = 1; | ||
USER_KICKED = 2; | ||
USER_LEAVED = 3; |
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 be USER_LEFT
; leaved
isn't correct English
cockatrice/src/tab_game.cpp
Outdated
switch(reason) | ||
{ | ||
case Event_Leave::USER_KICKED: | ||
return tr("kicked"); |
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.
kicked by game host or moderator
?
cockatrice/src/tab_game.cpp
Outdated
return tr("kicked"); | ||
break; | ||
case Event_Leave::USER_LEAVED: | ||
return tr("player leaved the 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.
player left the game
cockatrice/src/tab_game.cpp
Outdated
return tr("player leaved the game"); | ||
break; | ||
case Event_Leave::USER_DISCONNECTED: | ||
return tr("disconnected"); |
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.
player disconnected from server
Strings updated, thank you |
OTHER = 1; | ||
USER_KICKED = 2; | ||
USER_LEFT = 3; | ||
USER_DISCONNECTED = 4; |
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.
When a user closes the game it'll show "left"? (other than game --> leave game
)
When a user closes the app it'll show "left" or "disconnect"?
When a user restarts his PC or his Internet connection drops, what will be shown?
When a user closes the game, he gets asked "do you really want to leave the game?" and if he accepts, cockatrice informs the server that the user left the game. So: "left"
If you "menu->disconnect" from the server, or just close the whole cockatrice app, it will show "disconnect".
"disconnect" |
What will the message be if I kill the Do we somehow want to (can?) distinguish between disconnecting intentionally and unintentionally or indirectly? |
"disconnect" once the server hits timeout.
If the server loses connection with a player, it has no way to know if the user wanted to disconnect or it was a connection problem. |
Sure sure, we can't know if they killed the process or restarted their pc. |
We could make cockatrice send a "command_leave" to the server for each open game before it disconnects or closes down. |
Currently that's not true, I'm pretty sure closing is just closing and doesn't inform the server. There's actually perhaps a good reason to keep it that way - you can close the app then reopen, and you will be reconnected to any in-progress games, whereas if you send an explicit disconnect I believe it would close the game |
Didn't think of that, it seems reasonable to keep it as it is. |
Ok, I didn't know. If @ctrlaltca's idea (We could make cockatrice send a "command_leave" to the server for each open game before it disconnects or closes down.) prevent's you from reconnecting that would be bad, yes. Only "problem" left is that rage quitters might tend to just hit "x" and go on, while you might think there is some serious problem and you keep waiting for nothing. A new command |
If they "X" the game, you'll know they left it. If they "X" cockatrice and quit, they solved the problem for you and all the other players :) |
Just kind of. :) For example a player could experience a forced daily disconnect... if you are in the middle of a game and you enjoy it so far you really want to wait for him. But you just see "disconnected". Different for a forced internet 24h disconnect by your provider, he will come back within like 5min and you happily wait! |
I don't know what's the current status of this, but I thought I should leave a comment. So far, all the games I've done with the most recent release (2.3.17-beta004 (2017-04-27)) have shown a "reason unknown" when players leave. It still doesn't distinguish the reasons why players leave (in other words, getting kicked, leaving the game or leaving the server all show the same thing). Is this supposed to be happening? If not, could it be because players are running different versions of Cockatrice? |
I suppose the server has not been updated yet, so it's not passing the information back to clients. |
cc @woogerboy21 next maintenance window, can you upgrade? |
I spoke with Woods a few days ago and this is correct; the server wasn't updated yet. I'll work on a full release at some point |
Related Ticket(s)
Short roundup of the initial problem
When an user leaves a game the reason is not stated, leading to misinterpretations:
What will change with this Pull Request?
The reason why a user leaved the game is passed by the server to clients following @Daenyth's suggestion of keeping the protocol backwards compatible:
#2624 (comment)
Please check the reason strings i chose, they need to be short but correct english.
Explanation with different words: