You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-16 07:06:30 +09:00
NetConnection.LocalHailMessage exposed. WriteVariableInt64 and ReadVariableInt64 added.
This commit is contained in:
@@ -429,6 +429,24 @@ namespace Lidgren.Network
|
||||
return retval;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write Base128 encoded variable sized signed integer
|
||||
/// </summary>
|
||||
/// <returns>number of bytes written</returns>
|
||||
public int WriteVariableInt64(Int64 value)
|
||||
{
|
||||
int retval = 1;
|
||||
UInt64 num1 = (UInt64)((value << 1) ^ (value >> 31));
|
||||
while (num1 >= 0x80)
|
||||
{
|
||||
this.Write((byte)(num1 | 0x80));
|
||||
num1 = num1 >> 7;
|
||||
retval++;
|
||||
}
|
||||
this.Write((byte)num1);
|
||||
return retval;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write Base128 encoded variable sized unsigned integer
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user