Is there any way for the host to recover the cards that were in a player's hand after that player disconnects from the server?
-- When that player rejoins, how does the game know to give them the correct hand of cards back?
-- Does it use their name as a unique identifier, or is there some other hidden id assigned to a user based on ip/mac address or something?
-- If this user changed their name before rejoining, would they still get the correct hand of cards back?
-- If a user changes their name to that of another player that has disconnected, would they be able to recover the cards that were in the other player's hand?
-- If the user reconnected from a different location/ip/computer, would they still get the correct hand of cards back?
Apologies for the barrage of questions; I'm just hoping to understand how this part of the app works a bit better. I'm gearing up to play some long async games with a risk of players dropping out and not being able to return in a timely fashion, so there is some concern about cards getting lost in a player's hand.
Thanks!
Recovering cards from a player who has disconnected?
Moderators: Ichibrothers, Cambronne
Re: Recovering cards from a player who has disconnected?
Great question!
Each ZunTzu installation is assigned a unique identifier when ZunTzu is installed. That identifier is used to identify players in a game - which is not ideal because it actually only identifies their computers.
When a game is saved, the unique identifier is used to tag the owner of each player hand.
- to assign the player hand to another player, change the value of the 'owner' attribute on the '<hand ...>' element.
- to release all the locked cards and send them back to their sheet, just remove the whole '<hand ...>' element, from '<hand ...>' to '</hand>'.
It is not based on the player name, to an IP or Ethernet MAC address - so no privacy concern here.
From a different computer: no.
Each ZunTzu installation is assigned a unique identifier when ZunTzu is installed. That identifier is used to identify players in a game - which is not ideal because it actually only identifies their computers.
When a game is saved, the unique identifier is used to tag the owner of each player hand.
Yes, by editing the game file XML manually:Is there any way for the host to recover the cards that were in a player's hand after that player disconnects from the server?
- to assign the player hand to another player, change the value of the 'owner' attribute on the '<hand ...>' element.
- to release all the locked cards and send them back to their sheet, just remove the whole '<hand ...>' element, from '<hand ...>' to '</hand>'.
Each hand is tagged with its owner's identifier - or rather with his computer's identifier.-- When that player rejoins, how does the game know to give them the correct hand of cards back?
It is a hidden identifier, but you can see it by saving a game with cards in your hand and looking at the XML content.-- Does it use their name as a unique identifier, or is there some other hidden id assigned to a user based on ip/mac address or something?
It is not based on the player name, to an IP or Ethernet MAC address - so no privacy concern here.
Yes.-- If this user changed their name before rejoining, would they still get the correct hand of cards back?
No. He would have to edit the game file manually and replace the owner's identifier by his own identifier.-- If a user changes their name to that of another player that has disconnected, would they be able to recover the cards that were in the other player's hand?
From a different location or IP : yes.-- If the user reconnected from a different location/ip/computer, would they still get the correct hand of cards back?
From a different computer: no.
Jerome, ZunTzu developer.
Re: Recovering cards from a player who has disconnected?
This is great stuff, thanks!
So if a player re-installs ZunTzu in the middle of a weeks long game, they will lose the cards in their hand. Good to know.
I hadn't thought to look in the save files...that's an unexpectedly simple way to deal with this issue. Fantastic.
So if a player re-installs ZunTzu in the middle of a weeks long game, they will lose the cards in their hand. Good to know.
I hadn't thought to look in the save files...that's an unexpectedly simple way to deal with this issue. Fantastic.