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

NetIncomingMessage and NetOutgoingMessage now implements Stream as base class

This commit is contained in:
lidgren
2010-07-13 14:28:34 +00:00
parent 0a65259e86
commit 551dca6d0e
7 changed files with 35 additions and 8 deletions

View File

@@ -88,6 +88,25 @@ namespace UnitTests
NetException.Assert(readTest.Number == 42);
NetException.Assert(readTest.Name == "Hallon");
NetException.Assert(readTest.Age == 8.2f);
msg = peer.CreateMessage();
System.IO.BinaryWriter br = new System.IO.BinaryWriter(msg);
br.Write(true);
br.Write("hallon");
br.Write((byte)42);
int byteLen = msg.LengthBytes;
byte[] rbts = msg.PeekDataBuffer();
inc = Program.CreateIncomingMessage(rbts, msg.LengthBits);
System.IO.BinaryReader rdr = new System.IO.BinaryReader(inc);
bool one = rdr.ReadBoolean();
string hallon = rdr.ReadString();
byte fourtyTwo = rdr.ReadByte();
}
}