mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkLobbyManager.OnValidate simplified by using Mathf.Clamp
This commit is contained in:
parent
0c89e11c9f
commit
d1e53f5811
@ -214,14 +214,9 @@ void InitializeSingleton()
|
||||
|
||||
void OnValidate()
|
||||
{
|
||||
if (m_SimulatedLatency < 1) m_SimulatedLatency = 1;
|
||||
if (m_SimulatedLatency > 500) m_SimulatedLatency = 500;
|
||||
|
||||
if (m_PacketLossPercentage < 0) m_PacketLossPercentage = 0;
|
||||
if (m_PacketLossPercentage > 99) m_PacketLossPercentage = 99;
|
||||
|
||||
if (m_MaxConnections <= 0) m_MaxConnections = 1;
|
||||
if (m_MaxConnections > 32000) m_MaxConnections = 32000;
|
||||
m_SimulatedLatency = Mathf.Clamp(m_SimulatedLatency, 1, 500); // [1, 500]
|
||||
m_PacketLossPercentage = Mathf.Clamp(m_PacketLossPercentage, 0, 99); // [0, 99]
|
||||
m_MaxConnections = Mathf.Clamp(m_MaxConnections, 1, 32000); // [1, 32000]
|
||||
|
||||
if (m_MaxBufferedPackets <= 0) m_MaxBufferedPackets = 0;
|
||||
if (m_MaxBufferedPackets > ChannelBuffer.MaxBufferedPackets)
|
||||
|
Loading…
Reference in New Issue
Block a user