You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-17 23:56:30 +09:00
Added NetOutgoingMessage.Write(NetIncomingMessage)
This commit is contained in:
@@ -598,5 +598,23 @@ namespace Lidgren.Network
|
|||||||
m_bitLength -= excessBits;
|
m_bitLength -= excessBits;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Append all the bits of message to this message
|
||||||
|
/// </summary>
|
||||||
|
public void Write(NetIncomingMessage message)
|
||||||
|
{
|
||||||
|
EnsureBufferSize(m_bitLength + (message.LengthBytes * 8));
|
||||||
|
|
||||||
|
Write(message.m_data, 0, message.LengthBytes);
|
||||||
|
|
||||||
|
// did we write excessive bits?
|
||||||
|
int bitsInLastByte = (message.m_bitLength % 8);
|
||||||
|
if (bitsInLastByte != 0)
|
||||||
|
{
|
||||||
|
int excessBits = 8 - bitsInLastByte;
|
||||||
|
m_bitLength -= excessBits;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user