public static byte[] SerializePlayerPacket <T>(int factionID, PacketType type, T packet)
            where T : struct
        {
            // Make faction packet
            FactionHeader fHeader;

            fHeader.id = factionID;

            // Make header packet
            Packets.TypeHeader header;
            header.type = type;

            // Convert packets to bytes
            byte[] factionPacket = Packets.Serialize(fHeader);
            byte[] headerPacket  = Packets.Serialize(header);
            byte[] bodyPacket    = Packets.Serialize(packet);

            // Merge packets and return
            MemoryStream stream = new MemoryStream();

            stream.Write(headerPacket, 0, headerPacket.Length);
            stream.Write(factionPacket, 0, factionPacket.Length);
            stream.Write(bodyPacket, 0, bodyPacket.Length);


            Debug.Log("SERIALIZATION DONE.");

            return(stream.ToArray());
        }
        public static byte[] SerializePacket <T>(Packets.PacketType type, T packet)
            where T : struct
        {
            Packets.TypeHeader header;
            header.type = type;
            byte[] headerPacket = Packets.Serialize(header);
            byte[] bodyPacket   = Packets.Serialize(packet);

            MemoryStream stream = new MemoryStream();

            stream.Write(headerPacket, 0, headerPacket.Length);
            stream.Write(bodyPacket, 0, bodyPacket.Length);
            return(stream.ToArray());
        }