Пример #1
0
 public void getBytesTest()
 {
     byte[] bytes = null; // TODO: Initialize to an appropriate value
     Packet target = new Packet(bytes); // TODO: Initialize to an appropriate value
     byte[] expected = null; // TODO: Initialize to an appropriate value
     byte[] actual;
     actual = target.getBytes();
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Пример #2
0
 public static void SendPosUpdate(string nPlayerId, Vector2 nPos)
 {
     PacketHeader header = new PacketHeader(32, 0x01);
     byte[] packet = new byte[32];
     Array.Copy(ArrayUtil.StringToBytes(nPlayerId), packet, 24);
     byte[] temp = BitConverter.GetBytes((int)nPos.X);
     temp.Reverse();
     Array.Copy(temp, 0, packet, 24, 4);
     temp = BitConverter.GetBytes((int)nPos.Y);
     temp.Reverse();
     Array.Copy(temp, 0, packet, 28, 4);
     Packet realpacket = new Packet(header, packet);
     mConnection.Write(realpacket.getBytes());
 }