You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-19 00:26:30 +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))
|
if (m_peerConfiguration.IsMessageTypeEnabled(NetIncomingMessageType.ConnectionApproval))
|
||||||
{
|
{
|
||||||
// ok, let's not add connection just yet
|
// 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_senderConnection = this;
|
||||||
appMsg.m_senderEndpoint = this.m_remoteEndpoint;
|
appMsg.m_senderEndpoint = this.m_remoteEndpoint;
|
||||||
|
if (m_remoteHailMessage != null)
|
||||||
appMsg.Write(m_remoteHailMessage.m_data, 0, m_remoteHailMessage.LengthBytes);
|
appMsg.Write(m_remoteHailMessage.m_data, 0, m_remoteHailMessage.LengthBytes);
|
||||||
m_peer.ReleaseMessage(appMsg);
|
m_peer.ReleaseMessage(appMsg);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user