public ServerConnection(ServerConnectionStatus status, IDiagnosticPullStream diagnosticPullStream,
                         IDiagnosticPushStream diagnosticPushStream, byte[] newGameKey, uint loginSeed, LoginEncryptionKey loginKey)
     : this(status, diagnosticPullStream, diagnosticPushStream, PacketDefinitionRegistryFactory.CreateClassicClient(), EncryptionSetup.Autodetect)
 {
     InitNewGameEncryption(newGameKey);
     this.loginStream = new LoginPushStream(loginSeed, loginKey);
 }
 internal void InitLoginEncryption(uint seed, LoginEncryptionKey key)
 {
     if (encryptionSetup != EncryptionSetup.EncryptedClient)
     {
         loginStream = new LoginPushStream(seed, key);
     }
 }
        public ServerConnection(ServerConnectionStatus status, IDiagnosticPullStream diagnosticPullStream,
                                IDiagnosticPushStream diagnosticPushStream, PacketDefinitionRegistry packetRegistry, EncryptionSetup encryptionSetup)
        {
            this.Status = status;
            this.diagnosticPullStream = diagnosticPullStream;
            this.diagnosticPushStream = diagnosticPushStream;
            this.packetRegistry       = packetRegistry;
            this.encryptionSetup      = encryptionSetup;
            this.loginStream          = new LoginPushStream();

            this.receiveNewGameStream = new ServerNewGamePullStream();
            this.sendNewGameStream    = new ServerNewGamePushStream();

            huffmanStream  = new HuffmanStream(new PullStreamToStreamAdapter(receiveNewGameStream));
            preLoginStream = new PullStreamToStreamAdapter(diagnosticPullStream);
        }