简体   繁体   English

Unity 多人倒数计时器

[英]Unity multiplayer countdown timer

I have a multiplayer game project that I am writing.我有一个正在编写的多人游戏项目。 I have a countdown timer in the game.我在游戏中有倒计时。 This counter should work on all clients at the same time.此计数器应同时在所有客户端上工作。 For this, I send time from the server every second.为此,我每秒从服务器发送时间。 is this a correct process?这是一个正确的过程吗? or should I let each clients calculate their own time?还是应该让每个客户自己计算时间?

Depending on the type of game, if you let the clients calculate their own time, that introduces the opportunity for cheating when users spoof the timing on their own machine.根据游戏的类型,如果您让客户自己计算时间,那么当用户在自己的机器上欺骗时间时,就会引入作弊的机会。

Here's a pretty thorough article on clock synchronization: https://docs.gamesparks.com/tutorials/real-time-services/clock-synchronization-and-network-programming.html这是一篇关于时钟同步的非常详尽的文章: https://docs.gamesparks.com/tutorials/real-time-services/clock-synchronization-and-network-programming.html

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

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