1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-15 14:46:29 +09:00

NetServer.Disconnect added; Buffer.BlockCopy used in NetBitWriter

This commit is contained in:
lidgren
2010-07-26 07:39:02 +00:00
parent ced71204ac
commit bbeb7dfb2a
3 changed files with 19 additions and 5 deletions

View File

@@ -107,6 +107,18 @@ namespace UnitTests
bool one = rdr.ReadBoolean();
string hallon = rdr.ReadString();
byte fourtyTwo = rdr.ReadByte();
// test aligned WriteBytes/ReadBytes
msg = peer.CreateMessage();
byte[] tmparr = new byte[] { 5, 6, 7, 8, 9 };
msg.Write(tmparr);
inc = Program.CreateIncomingMessage(msg.PeekDataBuffer(), msg.LengthBits);
byte[] result = inc.ReadBytes(tmparr.Length);
for (int i = 0; i < tmparr.Length; i++)
if (tmparr[i] != result[i])
throw new Exception("readbytes fail");
}
}