コード例 #1
0
ファイル: TCPOutbound.cs プロジェクト: miromancekimika/hola
        public static byte[] ClientCompressed(byte[] data)
        {
            TCPPacketWriter packet = new TCPPacketWriter();

            packet.WriteBytes(Zip.Compress(data));
            return(packet.ToAresPacket(TCPMsg.MSG_CHAT_CLIENTCOMPRESSED));
        }
コード例 #2
0
        public static String EncodeHashlink(IHashlinkRoom room)
        {
            List <byte> list = new List <byte>();

            list.AddRange(new byte[20]);
            list.AddRange(Encoding.UTF8.GetBytes("CHATCHANNEL"));
            list.Add(0);
            list.AddRange(room.IP.GetAddressBytes());
            list.AddRange(BitConverter.GetBytes(room.Port));
            list.AddRange(room.IP.GetAddressBytes());
            list.AddRange(Encoding.UTF8.GetBytes(room.Name));
            list.Add(0);
            list.Add(0);

            byte[] buf = list.ToArray();
            buf = Zip.Compress(buf);
            buf = e67(buf, 28435);

            return(Convert.ToBase64String(buf));
        }