private static IPacket Assembler_PACKET_TEST_PACKET(ByteArray buffer) { PACKET_TEST_PACKET packet = new PACKET_TEST_PACKET(); packet.Read(buffer); return(packet); }
public void SendTest() { Network.Packets.PACKET_TEST_PACKET packet = new Network.Packets.PACKET_TEST_PACKET(); packet.attrib1 = 1; packet.attrib2 = 2; packet.attrib3 = 3; packet.attrib4 = .25f; packet.attrib6 = "attrib6"; packet.attrib7 = (System.Int64) int.MaxValue + 2; packet.pack = new Network.Packets.PACKET_TEST_PACKET_2(); packet.pack.attrib1 = 123; for (int i = 0; i < 10; ++i) { packet.packs.Add(new Network.Packets.PACKET_TEST_PACKET_2() { attrib1 = i }); packet.intlist.Add(i); packet.floatList.Add(i + .1f); packet.shortList.Add((short)i); packet.strList.Add("str: " + i); } ClientTerminal.Instance.SendPacketReliably(packet); }
private void Handle_PACKET_TEST_PACKET(IPacket packet) { Network.Packets.PACKET_TEST_PACKET msg = (Network.Packets.PACKET_TEST_PACKET)packet; Debug.Log("MsgReceive, ID: " + msg.GetPacketID()); }