You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-06 02:11:06 +09:00
approval fixed for cases where remotehailmessage is null
This commit is contained in:
@@ -210,9 +210,10 @@ namespace Lidgren.Network
|
||||
if (m_peerConfiguration.IsMessageTypeEnabled(NetIncomingMessageType.ConnectionApproval))
|
||||
{
|
||||
// ok, let's not add connection just yet
|
||||
NetIncomingMessage appMsg = m_peer.CreateIncomingMessage(NetIncomingMessageType.ConnectionApproval, m_remoteHailMessage.LengthBytes);
|
||||
NetIncomingMessage appMsg = m_peer.CreateIncomingMessage(NetIncomingMessageType.ConnectionApproval, (m_remoteHailMessage == null ? 0 : m_remoteHailMessage.LengthBytes));
|
||||
appMsg.m_senderConnection = this;
|
||||
appMsg.m_senderEndpoint = this.m_remoteEndpoint;
|
||||
if (m_remoteHailMessage != null)
|
||||
appMsg.Write(m_remoteHailMessage.m_data, 0, m_remoteHailMessage.LengthBytes);
|
||||
m_peer.ReleaseMessage(appMsg);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user