You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-18 08:06:33 +09:00
Fixed AcceptIncomingConnections = false actualling having an effect
This commit is contained in:
@@ -614,8 +614,31 @@ namespace Lidgren.Network
|
|||||||
LogWarning("Received unhandled library message " + tp + " from " + senderEndPoint);
|
LogWarning("Received unhandled library message " + tp + " from " + senderEndPoint);
|
||||||
return;
|
return;
|
||||||
case NetMessageType.Connect:
|
case NetMessageType.Connect:
|
||||||
// proceed
|
if (m_configuration.AcceptIncomingConnections == false)
|
||||||
break;
|
{
|
||||||
|
LogWarning("Received Connect, but we're not accepting incoming connections!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// handle connect
|
||||||
|
// It's someone wanting to shake hands with us!
|
||||||
|
|
||||||
|
int reservedSlots = m_handshakes.Count + m_connections.Count;
|
||||||
|
if (reservedSlots >= m_configuration.m_maximumConnections)
|
||||||
|
{
|
||||||
|
// server full
|
||||||
|
NetOutgoingMessage full = CreateMessage("Server full");
|
||||||
|
full.m_messageType = NetMessageType.Disconnect;
|
||||||
|
SendLibrary(full, senderEndPoint);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ok, start handshake!
|
||||||
|
NetConnection conn = new NetConnection(this, senderEndPoint);
|
||||||
|
conn.m_status = NetConnectionStatus.ReceivedInitiation;
|
||||||
|
m_handshakes.Add(senderEndPoint, conn);
|
||||||
|
conn.ReceivedHandshake(now, tp, ptr, payloadByteLength);
|
||||||
|
return;
|
||||||
|
|
||||||
case NetMessageType.Disconnect:
|
case NetMessageType.Disconnect:
|
||||||
// this is probably ok
|
// this is probably ok
|
||||||
LogVerbose("Received Disconnect from unconnected source: " + senderEndPoint);
|
LogVerbose("Received Disconnect from unconnected source: " + senderEndPoint);
|
||||||
@@ -624,26 +647,6 @@ namespace Lidgren.Network
|
|||||||
LogWarning("Received unhandled library message " + tp + " from " + senderEndPoint);
|
LogWarning("Received unhandled library message " + tp + " from " + senderEndPoint);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// It's someone wanting to shake hands with us!
|
|
||||||
|
|
||||||
int reservedSlots = m_handshakes.Count + m_connections.Count;
|
|
||||||
if (reservedSlots >= m_configuration.m_maximumConnections)
|
|
||||||
{
|
|
||||||
// server full
|
|
||||||
NetOutgoingMessage full = CreateMessage("Server full");
|
|
||||||
full.m_messageType = NetMessageType.Disconnect;
|
|
||||||
SendLibrary(full, senderEndPoint);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ok, start handshake!
|
|
||||||
NetConnection conn = new NetConnection(this, senderEndPoint);
|
|
||||||
conn.m_status = NetConnectionStatus.ReceivedInitiation;
|
|
||||||
m_handshakes.Add(senderEndPoint, conn);
|
|
||||||
conn.ReceivedHandshake(now, tp, ptr, payloadByteLength);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void AcceptConnection(NetConnection conn)
|
internal void AcceptConnection(NetConnection conn)
|
||||||
|
|||||||
Reference in New Issue
Block a user