什么是 Totem Ghosting(图腾鬼影)?
在 PvP 中,玩家可能在即将死亡的毫秒级瞬间切换出图腾。由于延迟/网络延迟,他们的客户端显示手中持有图腾,但服务器在物品交换数据包到达之前就已经处理了死亡事件。因此,玩家手持图腾时死亡,导致不公平的死亡情况。
解决方案
此插件尝试使用主动调度器来防止此问题。
当玩家即将死亡时,插件会检查其精确延迟并扫描队列中的物品交换。如果检测到来自客户端的交换,插件会动态取消其死亡状态一小段时间(通常为 1–3 刻,或 50–150 毫秒)。这为服务器提供了足够的时间来处理交换,之后我们通过原始死亡原因手动对玩家造成伤害。
这并不能 100% 防止鬼影现象,因为玩家在延迟结束后仍有可能在主手或副手放入图腾从而“鬼影”。
功能特性
延迟补偿: 根据玩家的延迟控制延迟时间。良好的连接即时处理(1 刻),而高延迟玩家则获得公平的延迟。
高度优化: 使用主动异步系统来捕获数据包,不会对服务器 TPS 产生影响。
模拟伤害: 我们必须在延迟后对玩家造成伤害,因为我们取消了伤害。这种模拟伤害不会通过让玩家承受大量伤害来影响盔甲耐久,而是通过将玩家生命值设置为较低数值并施加少量伤害来实现,同时确保玩家死亡或触发图腾(取决于是否持有图腾)。
几乎不可察觉: 50-150 毫秒的延迟不应让玩家感到烦恼或沮丧,因为它仅是视觉效果,且是尝试防止鬼影现象所必需的。
依赖项:
PacketEvents(用于物品交换数据包必需)
What is Totem Ghosting?
In PVP, a player might swap to a totem at the millisecond they are about to die. Because of ping/latency, their client shows the totem in their hand, but the server processes their death before the item swap packet arrives. So, the player dies while holding a totem, leading to unfair deaths.
The Solution
This plugin tries to prevent this issue using an active scheduler.
When a player is about to die, the plugin checks their exact ping and scans the queue for item swaps. If a swap is detected from the client, the plugin dynamically cancels their death for a fraction of a second (usually 1–3 ticks, or 50–150ms). This gives the server enough time to process the swap, and after the delay we manually damage the player using the original death reason.
This does not prevent ghosting 100% as the player might still be able to 'ghost' if they put a totem in their main-hand or off-hand after the delay.
Features
Ping-Compensated: Controls the delay based on the player's ping. Good connections process instantly (1 tick), while laggy players get a fair delay.
Highly Optimized: Uses an active, asynchronous system to catch packets without having an impact on the server tps.
Fake Damage: We have to damage the player after the delay because we're cancelling the damage. This fake damage does not affect the armor of the player by not making the player take a lot of damage but by setting the player's health to a low amount and also damaging the player by a small amount, still ensuring the player dies or pops depending on if they have a totem.
Barely noticeable: The 50-150ms delay shouldn't be annoying or frustrating for players as it is only visual, and required to try to prevent ghosting.
Dependencies:
PacketEvents (Required for item swap packets)
评论 0
登录后参与评分
还没有评论,来抢沙发吧