使用 Juggernaut 同步客户端计时器时处理延迟

发布于 2024-11-27 10:57:51 字数 279 浏览 1 评论 0原文

我需要为梦幻体育网站实施申请草案。每个用户将有 1 分 30 秒的时间来选择其团队中的一名球员,如果该时间已过,则会自动选择该球员。我们计划的实施将使用 Juggernaut 将回合更改推送给参与选秀的每个用户。但我仍然不确定如何处理延迟。

这里的主要问题是,如果用户的延迟比其他人更高,他将稍后收到回合更改,并且他的计时器将不会同步。假设某人在自己选择一名球员后收到了轮换,而他认为自己还剩 2 秒,我们该如何处理这种情况?尝试测量每个用户的延迟并调整客户端计时器以最大程度地减少该问题是否更好?如果是这样,我们该如何实施呢?

I need to implement a draft application for a fantasy sports website. Each users will have 1m30 to choose a player on its team and if that time has elapsed it will be selected automatically. Our planned implementation will use Juggernaut to push the turn changes to each user participating in the draft. But I'm still not sure about how to handle latency.

The main issue here is if a user got a higher latency than the others, he will receive the turn changes a little bit later and his timer won't be synchronized. Say someone receive a turn change after choosing a player himself while on his side he think he still got 2 seconds left, how can we handle that case? Is it better to try to measure each user latency and adjust the client-side timer to minimize that issue? If so, how could we implement that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你的呼吸 2024-12-04 10:57:51

这是一个棘手的问题,但有一些很好的解决方案。了解 time.gov 做什么以及如何做;本质上,据我了解,他们使用 Java 对服务器执行多个重复请求,试图了解通信中涉及的延迟,然后生成延迟度量,用于扭曲返回的时间数据。您可以在您的申请中使用相同的流程,甚至更加准确;跟踪延迟是什么以及它如何随时间变化可以让您对延迟数字的可靠性等做出一些统计推断。它可能有点复杂,但它绝对可以让您平滑性能。我的理解是,这也是大多数 MMO 游戏所做的,以管理延迟。

This is a tricky issue, but there are some good solutions out there. Look into what time.gov does, and how it does it; essentially, as I understand it, they use Java to perform multiple repeated requests to the server, to attempt to get an idea of the latency involved in the communication, then they generate a measure of latency that they use to skew the returned time data. You could use the same process for your application, with even more accuracy; keeping track of what the latency is and how it varies over time lets you make some statistical inferences about how reliable your latency numbers are, etc. It can be a bit complex, but it can definitely allow you to smooth out your performance. My understanding is that this is what most MMOs do as well, to manage lag.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文