Updating multiple instances of a facebook web game
Background
I'm working on a social media game. There is no login screen, a 开发者_运维问答users account is based on their facebook user id. At the moment it is possible for a player to open the game in multiple tabs and when they spend 'in game money' in one window, it's then not updated in the other windows. Allowing players to spend much more money that they have in their account.
Question
Is it possible to update their remaining money in other instances of the game? Or keep a track of how many instances of the game that single user has open, and log them out?
The easiest way would be to setup in ajax call in jquery or javascript to ping your server to see if the 'in game money' value has changed. You could also set up some kind of long polling process.
精彩评论