dongzichan2886 2013-05-06 04:59
浏览 47

保持同时运行的多个游戏实例的一致性

I am making a text based browser rpg and I've stumbled into a bit of a problem and am not sure how to proceed. How do you keep consistency across multiple instances of the game running at the same time?? I don't know the technical term for doing this, but for example....

Say a user is playing the game in one window. He/She is presented with the hyperlink "Open Blue Door" which will load a new screen of the game. Say the user opens that link in a new window. There will now be two instances of the game running, and it would be possible to play the game along one storyline in one window and play the game along another completely seperate storyline in the other window. In other words, there would be two instances of the game running at the same time and they would be inconsistent.

Or another example is if a user is in the middle of a game, opens a new window, goes to the website and hits play, it should go directly to where the user is in the other window and not start a new game.

I apologise if this is a noob question and thank you for your time in advance.

  • 写回答

1条回答 默认 最新

  • dsgixl5195 2013-05-06 05:09
    关注

    You need to sychronize those events on a Server. For example, You make an AJAX call to your server, which writes to a table, what doors have been opened, and what the player states are, and where they're located.

    You can pole for data using long polling or short polling (look them up).

    Or even better, Use firebase!! Firebase is a service that lets you synchronize data between multiple end points, in the browser. I've used firebase in the past, it's pretty impressive:

    https://www.firebase.com/

    评论

报告相同问题?

悬赏问题

  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向