Exemple #1
0
        public void Init([NotNull] TcpClient client)
        {
            // Allow Client to close immediately
            client.LingerState = new LingerOption(true, 0);

            byte[] sivBytes = new byte[4];
            byte[] rivBytes = new byte[4];
            Rng.GetBytes(sivBytes);
            Rng.GetBytes(rivBytes);
            Siv = BitConverter.ToUInt32(sivBytes);
            Riv = BitConverter.ToUInt32(rivBytes);

            Client        = client;
            NetworkStream = client.GetStream();
            MapleStream   = new MapleStream();
            SendCipher    = MapleCipher.Encryptor(VERSION, Siv, BLOCK_IV);
            RecvCipher    = MapleCipher.Decryptor(VERSION, Riv, BLOCK_IV);
        }