Im designing a game with both digital currency and player progression, but have hit a confusing snag, where I possibly can't be the first to come to a decent solution.
To keep it simple, it's a mobile game, where the player is identified by his Device ID in the beginning. He is encuraged to connect with facebook, and if he does so, will be identified by his Facebook User ID (FBID) instead. For security reasons (and because its core to the game) you can only play online, and progression and resources are maintained by the server.
So far, the flow is simple:
- If the server has no FBID on the user, an account is created based on his DeviceID, and he plays on that.
- If the user connects to facebook, the account is updated with the new FBID, and all resources are carried over.
- If the player deletes the app, and redownloads it, we still identify him based on device id, and he gets his old account back.
But here are the area that I'm concerned:
If the same player has a second device, he would like to play from instead/also.
It's a fair scenario that if the player requires an tablet next to his phone, and he wants to play with the same account.
So my play so far, is to wipe the "temporary account" from the server, find the account with the matching FBID, and add this new device to an array of devices on the original account.
I have session based control, so they can't be playing on the same time. The old device will simply be logged out if the same user appears on the new one.
But I have a feeling this is not the best way of doing things. What if the "temporary" game is played by someone else, and that person will technicly get his account wiped and device "taken over" by the logged in user ? Im especially concerned about family-type scenarios, where devices are shared.
Does anyone have any good suggestions on structure on this ? Maybe I'm completely in the woods with my method here, and doing it all wrong.
My priorities are :
- Duplication of ingame resources must not occur
- A player should never be "punished" by starting over, if he signs in using facebook.
- A player should be able to maintain and restore his progress in the game, even if he logs out.