Recovering cards from a player who has disconnected?

General discussion about ZunTzu in English.

Moderators: Ichibrothers, Cambronne

Post Reply
User avatar
Easy
Posts: 27
Joined: 04 Dec 2013, 21:42

Recovering cards from a player who has disconnected?

Post by Easy »

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!
User avatar
Jerome
Site Admin
Posts: 974
Joined: 22 Jun 2006, 21:31
Location: France
Contact:

Re: Recovering cards from a player who has disconnected?

Post by Jerome »

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.
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?
Yes, by editing the game file XML manually:
- 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>'.
-- When that player rejoins, how does the game know to give them the correct hand of cards back?
Each hand is tagged with its owner's identifier - or rather with his computer's identifier.
-- 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 a hidden identifier, but you can see it by saving a game with cards in your hand and looking at the XML content.
It is not based on the player name, to an IP or Ethernet MAC address - so no privacy concern here.
-- If this user changed their name before rejoining, would they still get the correct hand of cards back?
Yes.
-- 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?
No. He would have to edit the game file manually and replace the owner's identifier by his own identifier.
-- If the user reconnected from a different location/ip/computer, would they still get the correct hand of cards back?
From a different location or IP : yes.
From a different computer: no.
Jerome, ZunTzu developer.
User avatar
Easy
Posts: 27
Joined: 04 Dec 2013, 21:42

Re: Recovering cards from a player who has disconnected?

Post by Easy »

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.
Post Reply