Encrypt() public method

public Encrypt ( PacketOut packet ) : byte[]
packet PacketOut
return byte[]
コード例 #1
0
ファイル: LobbyClient.cs プロジェクト: sNakiex/reAPB
        public void Send(PacketOut packet)
        {
            byte[]       toSend = ECrypt.Encrypt(packet);
            MemoryStream tcpOut = new MemoryStream();

            tcpOut.WriteByte((byte)((toSend.Length & 0xffff) & 0xff));
            tcpOut.WriteByte((byte)((toSend.Length & 0xffff) >> 8));
            tcpOut.WriteByte((byte)((toSend.Length >> 16) & 0xff));
            tcpOut.WriteByte((byte)(toSend.Length >> 24));
            tcpOut.Write(toSend, 4, toSend.Length - 4);
            SendTCP(tcpOut.ToArray());
            tcpOut.Dispose();
            toSend = null;
        }