#1949 closed enhancement (fixed)
[PATCH] "PlayerX has joined the game" message appears before a player rejoins the game
Reported by: | alpha123 | Owned by: | leper |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 19 |
Component: | Network | Keywords: | |
Cc: | Patch: |
Description
If a client gets disconnected from the host in multiplayer and tries to rejoin, the other players get a "SomePlayer has joined the game" message after SomePlayer downloads the serialization state but before the map is reloaded and everything is synchronized.
Attachments (4)
Change History (13)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
The only real use of this change would be to tell whether a player has crashed on joining.
This bug is fixed at revision 15402
comment:3 by , 9 years ago
It happens frequently that a player crashes or reconnects otherwise in the middle of the battle and rejoins.
(1) In this situation fair enemies and losing teammates pause the game until he reconnected. The problem here is that people think that the "player has joined" message means that the player has control over his army again and continue the game then, while in fact he is loading the game, which can take up to a minute sometimes (Enough time to lose multiple CCs, fortresses and the whole army).
(2) Also players start to talk to the reconnected client, assuming that he can read the chat already, which frequently causes communication issues.
I propose to change the original message to something like "player starts to rejoin" and add another message "player has successfully rejoined" when the game actually started for him/her. Im currently trying to do the patch.
by , 9 years ago
Attachment: | rejoined_message_wip_v1.patch added |
---|
This patch implements that a message is automatically sent as soon as the client finished the loading screen on rejoin. TODO: (1) change the "(player)s has joined the game" message (translation files) and (2) probably implement a custom network message command, if the regular chat function shouldn't be used.
by , 9 years ago
Attachment: | rejoined_message_wip_v2.patch added |
---|
comment:4 by , 9 years ago
The patch above implements the feature as desired.
As indicated by binaries/data/mods/public/gui/session/messages.js, the "%player has joined the game" message was replaced with "player is connecting..." and another message type was added to implement the new "%(player)s has rejoined the game." message.
How it works: When a client rejoins and finishes the loading screen, the GUI / javascript function reallyStartGame() will be called. The rejoined client then sends the RejoinedMessage to the server, which will broadcast the message to all clients, which then display the actual text.
As already done in the first version of the patch, the c++ reallyStartGame() function is changed, so that g_NetClient->LoadFinished() will be called before the RejoinedMessage is sent in the reallyStartGame() part of the GUI/JS. This is required, otherwise an error will appear.
TODO: The translation files need to be updated
comment:5 by , 9 years ago
Keywords: | review added |
---|---|
Milestone: | Backlog → Alpha 19 |
Summary: | "PlayerX has joined the game" message appears before a player rejoins the game → [PATCH] "PlayerX has joined the game" message appears before a player rejoins the game |
Type: | defect → enhancement |
by , 9 years ago
Attachment: | rejoined_message_v3.patch added |
---|
Removed braces in loading.js, moved c++ functions to more logical place. Tested with r16528.
by , 9 years ago
Attachment: | rejoined_message_v4.patch added |
---|
Cleaned 1 or 2 unnecessary whitespace changes in the previous patch. Fixes a whitespace change in r15006 in NetMessage.cpp. Still dont know how you want those functions grouped. Tested with r16533.
I could change it to Player X is trying to join the game