1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-06 02:11:06 +09:00

NetConnection.LocalHailMessage exposed. WriteVariableInt64 and ReadVariableInt64 added.

This commit is contained in:
lidgren
2010-12-28 13:13:00 +00:00
parent b83ec10d8d
commit eb056bc9aa
4 changed files with 58 additions and 3 deletions

View File

@@ -22,11 +22,18 @@ namespace UnitTests
msg.Write(true);
msg.WritePadBits();
int bcnt = 0;
msg.Write(45.0f);
msg.Write(46.0);
msg.WriteVariableInt32(-47);
bcnt += msg.WriteVariableInt32(-47);
msg.WriteVariableInt32(470000);
msg.WriteVariableUInt32(48);
bcnt += msg.WriteVariableInt64(-49);
if (bcnt != 2)
throw new NetException("WriteVariable* wrote too many bytes!");
byte[] data = msg.PeekDataBuffer();
@@ -51,9 +58,11 @@ namespace UnitTests
bdr.Append(inc.ReadSingle());
bdr.Append(inc.ReadDouble());
bdr.Append(inc.ReadVariableInt32());
bdr.Append(inc.ReadVariableInt32());
bdr.Append(inc.ReadVariableUInt32());
bdr.Append(inc.ReadVariableInt64());
if (bdr.ToString().Equals("False-342duke of earl4344True4546-4748"))
if (bdr.ToString().Equals("False-342duke of earl4344True4546-4747000048-49"))
Console.WriteLine("Read/write tests OK");
else
throw new NetException("Read/write tests FAILED!");