简体   繁体   English

防止基于HTML5游戏的实时浏览器进行时间作弊

[英]Prevent Time-Cheating on a real-time browser based html5 game

I am programming a Go server (chess-like game), in html5 (javascript). 我正在用html5(javascript)编程Go服务器(类似象棋的游戏)。 Like Chess, each player is given initial thinking time at the start of the game. 像国际象棋一样,每位玩家在游戏开始时都会得到最初的思考时间。

I use the Google App Engine platform. 我使用Google App Engine平台。 (Current Beta url http://tingting39546.appspot.com/games ) (当前的Beta网址http://tingting39546.appspot.com/games

Let's say each player is given 600 seconds thinking time for their moves. 假设每位玩家的动作时间为600秒。

  • Was would be my options to prevent players messed around with their clocks? 我会采取什么选择来防止玩家弄乱时钟?

So far, my best guess would be to let the clients send the times used for each moves, and let the server compare this to what would be reasonable considering the latency. 到目前为止,我最好的猜测是让客户端发送每次移动所用的时间,并让服务器将其与考虑延迟的合理时间进行比较。

  • Can i use encryption schemes to make this cheat-proof? 我可以使用加密方案来防止欺诈吗?

Maintaining such validations client-side is not the right way. 在客户端维护此类验证不是正确的方法。 You need to maintain all states server-side, client shouldnt calculate anything time-related, server just receives commands and uses the request time stamp to calculate such things. 您需要维护服务器端的所有状态,客户端不应该计算与时间有关的任何内容,服务器仅接收命令并使用请求时间戳来计算此类情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM