예제 #1
0
        internal void InitNewGameEncryption(byte[] key)
        {
            if (encryptionSetup != EncryptionSetup.EncryptedClient)
            {
                receiveNewGameStream = new ServerNewGamePullStream(key);
                sendNewGameStream    = new ServerNewGamePushStream(key);

                huffmanStream = new HuffmanStream(new PullStreamToStreamAdapter(receiveNewGameStream));
            }
        }
예제 #2
0
        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);
        }