コード例 #1
0
        public void Can_write_diagnostic_info_about_sent_PreGameLogin_packet()
        {
            var packet           = FakePackets.Instantiate(FakePackets.ConnectToGameServer);
            var diagnosticStream = new TextDiagnosticPushStream();
            var connection       = new UltimaClientConnection(UltimaClientConnectionStatus.PreGameLogin, NullDiagnosticPullStream.Instance, diagnosticStream);
            var outputStream     = new TestMemoryStream();

            connection.Send(packet, outputStream);

            var output = diagnosticStream.Flush();

            output.Should().Contain("0x8C, 0x7F, 0x00, 0x00, 0x01, 0x0A, 0x21, 0x7F, 0x00, 0x00, 0x01");
        }
コード例 #2
0
        public void Can_write_diagnostic_info_about_sent_Game_packet()
        {
            var diagnosticStream = new TextDiagnosticPushStream(packetRegistry);
            var connection       = CreateEncryptedConnection(ServerConnectionStatus.Game, diagnosticStream);
            var testStream       = new TestMemoryStream();

            connection.Send(FakePackets.GameServerLoginRequestPacket, testStream);

            var output = diagnosticStream.Flush();

            output.Should().Contain("0x91, 0x7F, 0x00, 0x00, 0x01, 0x61, 0x64")
            .And.Contain("0x22, 0x62, 0xD9, 0x50, 0x47, 0xA6, 0x00");
        }
コード例 #3
0
        public void Can_write_diagnostic_info_about_send_Game_packet()
        {
            var packet           = FakePackets.Instantiate(FakePackets.EnableLockedClientFeatures);
            var diagnosticStream = new TextDiagnosticPushStream();
            var connection       = new UltimaClientConnection(UltimaClientConnectionStatus.Game, NullDiagnosticPullStream.Instance, diagnosticStream);
            var outputStream     = new TestMemoryStream();

            connection.Send(packet, outputStream);

            string output = diagnosticStream.Flush();

            output.Should().Contain("0xB9, 0x80, 0x1F")
            .And.Contain("0xB3, 0x32, 0x98, 0xDA");
        }
コード例 #4
0
        public void Can_write_diagnostic_info_about_sent_PreLogin_packet()
        {
            var diagnosticStream = new TextDiagnosticPushStream();

            var connection = new ServerConnection(ServerConnectionStatus.PreLogin, NullDiagnosticPullStream.Instance,
                                                  diagnosticStream);
            var testStream = new TestMemoryStream();

            connection.Send(FakePackets.Instantiate(FakePackets.InitialLoginRequest), testStream);

            var output = diagnosticStream.Flush();

            output.Should().Contain("0x80, 0x61, 0x64, 0x6D, 0x69, 0x6E")
            .And.Contain("0x7A, 0x63, 0x9A, 0xED, 0x56, 0x0E");
        }