本文介绍了UNet随机断开连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于一个基本的网络场景(两次播放器转换和偶尔的RPC),我一直都在不断地被UNet淘汰.由于超时,连接断开.

I've been getting constant UNet dropouts for a basic networked scene (two player transforms and the occasional RPC). The connection drops due to a timeout.

连接可靠地在5分钟内断开,大多数情况下在30秒内断开.我已经在线阅读了UNet所做的很多事情.我尝试将NetworkDropThresholdOverflowDropThreshold最多增加90%.我还将ping超时设置为5秒.

Connections reliably drop within 5 minutes, and mostly within 30 seconds. I've read online that UNet does this a lot. I've tried increasing the NetworkDropThreshold and OverflowDropThreshold up to 90%. I also put the ping timeout up to 5 seconds.

关于如何解决它的任何想法?我在两个播放器上都使用wi-fi,并且在Unity 5.6.0f3上使用.

Any ideas on how to fix it? I'm using wi-fi for both players, and I'm on Unity 5.6.0f3.

推荐答案

升级到Unity 5.6.1f1可以解决这些问题.尽管发行说明或5.6.0系列的任何补丁说明中都没有评论,但至少对我而言,可靠性方面的差异令人震惊.

Upgrading to Unity 5.6.1f1 fixed these issues. While there are no comments in the release notes, or any of the patch notes for the 5.6.0 series, the difference in reliability was astounding, at least for me.

如果遇到问题,请尝试使用最新版本.当最新的稳定版本对我有用时,您可以在以下位置找到最新的修补程序版本: https://unity3d.com/unity/qa/patch-releases .

If you're experiencing issues, try the latest version. While the latest stable release worked for me, you can find the latest patch releases at: https://unity3d.com/unity/qa/patch-releases.

如果您使用的是Unity的Matchmaker,则存在硬带宽限制,这会影响播放器,而且价格昂贵. Photon是联网的不错选择: https://www.photonengine.com/PUN .

If you're using Unity's Matchmaker, there is a hard bandwidth limit that kicks players, and it's expensive. Photon is good alternative for networking: https://www.photonengine.com/PUN.

这篇关于UNet随机断开连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 22:38