internal void InitNewGameEncryption(byte[] key) { if (encryptionSetup != EncryptionSetup.EncryptedClient) { receiveNewGameStream = new ServerNewGamePullStream(key); sendNewGameStream = new ServerNewGamePushStream(key); huffmanStream = new HuffmanStream(new PullStreamToStreamAdapter(receiveNewGameStream)); } }
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); }