i making text based browser rpg , i've stumbled bit of problem , not sure how proceed. how keep consistency across multiple instances of game running @ same time?? don't know technical term doing this, example....
say user playing game in 1 window. he/she presented hyperlink "open blue door" load new screen of game. user opens link in new window. there 2 instances of game running, , possible play game along 1 storyline in 1 window , play game along seperate storyline in other window. in other words, there 2 instances of game running @ same time , inconsistent.
or example if user in middle of game, opens new window, goes website , hits play, should go directly user in other window , not start new game.
i apologise if noob question , thank time in advance.
you need sychronize events on server. example, make ajax call server, writes table, doors have been opened, , player states are, , they're located.
you can pole data using long polling or short polling (look them up).
or better, use firebase!! firebase service lets synchronize data between multiple end points, in browser. i've used firebase in past, it's pretty impressive:
Comments
Post a Comment