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

Missing project added; various code cleanups

This commit is contained in:
lidgren
2010-05-14 17:12:26 +00:00
parent bf208b507a
commit 9577d4b4a6
31 changed files with 381 additions and 139 deletions

View File

@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using Lidgren.Network;
namespace UnitTests
@@ -26,11 +24,19 @@ namespace UnitTests
BitVectorTests.Run();
EncryptionTests.Run();
EncryptionTests.Run(peer);
peer.Shutdown("bye");
Console.ReadKey();
}
public static NetIncomingMessage CreateIncomingMessage(byte[] fromData, int bitLength)
{
NetIncomingMessage inc = (NetIncomingMessage)Activator.CreateInstance(typeof(NetIncomingMessage), true);
typeof(NetIncomingMessage).GetField("m_data", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(inc, fromData);
typeof(NetIncomingMessage).GetField("m_bitLength", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(inc, bitLength);
return inc;
}
}
}