You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-16 23:26:32 +09:00
Added NetBuffer.WriteAt()
This commit is contained in:
@@ -217,6 +217,17 @@ namespace Lidgren.Network
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Writes a 32 bit signed integer at a given offset in the buffer
|
||||||
|
/// </summary>
|
||||||
|
public void WriteAt(Int32 offset, Int32 source)
|
||||||
|
{
|
||||||
|
int newBitLength = Math.Max(m_bitLength + 32, offset + 32);
|
||||||
|
EnsureBufferSize(newBitLength);
|
||||||
|
NetBitWriter.WriteUInt32((UInt32)source, 32, m_data, offset);
|
||||||
|
m_bitLength = newBitLength;
|
||||||
|
}
|
||||||
|
|
||||||
#if UNSAFE
|
#if UNSAFE
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Writes a 32 bit unsigned integer
|
/// Writes a 32 bit unsigned integer
|
||||||
@@ -253,6 +264,17 @@ namespace Lidgren.Network
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Writes a 32 bit unsigned integer at a given offset in the buffer
|
||||||
|
/// </summary>
|
||||||
|
public void WriteAt(Int32 offset, UInt32 source)
|
||||||
|
{
|
||||||
|
int newBitLength = Math.Max(m_bitLength + 32, offset + 32);
|
||||||
|
EnsureBufferSize(newBitLength);
|
||||||
|
NetBitWriter.WriteUInt32(source, 32, m_data, offset);
|
||||||
|
m_bitLength = newBitLength;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Writes a 32 bit signed integer
|
/// Writes a 32 bit signed integer
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user