I have a weird issue where everything works for about 30-60 seconds, then the client gets disconnected from the host, but ONLY when running the host from a Unity build. Works great when its hosting from Unity editor with no disconnecting issues.
Hi there, is the “Run In Background” option enabled in your player settings?
Yes it is
Tried making a development build so I could see the logs in realtime, but the connection seems to be solid in development builds. Regular builds still don’t work though.
Hmm, could you try disabling the Timeout on the ServerManager and ClientManager components on the network manager?
Hi,
does this also happen if you never loose focus from the unity build?
Which Transport and Version?
These were already disabled
Transport: Fishy Steamworks
Set to Peer To Peer
Fish-Net:
Version: 4.1.6
Fishy Steamworks:
4.1.0
We’re going to try the 4.2.2R Fish-Net update
Updated to 4.2.2R
Still have the issue.
Noticed it disconnects at EXACTLY 30 seconds every single time
Found the issue:
ServerManager.cs
Line 708
#if !DEVELOPMENT_BUILD && !UNITY_EDITOR
/* If hasn't sent LOD recently enough. LODs are sent every half a second, so
* by multiplaying interval by 60 this gives the client a 30 second window. */
if (_cachedUseLod && conn.IsLateForLevelOfDetail(_cachedLevelOfDetailInterval * 60))
{
conn.Kick(KickReason.ExploitAttempt, LoggingType.Common, $"ConnectionId {conn.ClientId} has gone too long without sending a level of detail update. Connection will be kicked immediately.");
return;
}
#endif
Our app is very one-way in data. We stream motion data to a bunch of viewers, but the viewers (client) are not sending any data back. This triggered the Exploit Attempt.
I’d like to still prevent exploits so any advice is welcome. For now, I’ve commented this out and things are working.
You can just disable LOD on the ObserverManager. You can comment out that bit of code if you like as well, but that’s the intended design to prevent people from not sending LOD updates.
The only real harm in commenting that out is if a player doesn’t send LOD updates the server won’t use LOD for that one specific client, costing more bandwidth.