Ejemplo n.º 1
0
        public void WillMatchSystemRegular()
        {
            const string localPath = @"C:\Users\johns\Desktop\KvG Client 2.0";

            if (!Directory.Exists(localPath))
            {
                Debug.WriteLine("Not running test, requires Cliloc.enu");
                return;
            }

            Cliloc.Initialize(localPath);

            byte[] packet =
            {
                0xC1, 0x00, 0x32, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x03, 0xB2, 0x00, 0x03, 0x00, 0x07,
                0xA4, 0xE1, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00
            };

            IncomingPacketHandlers.Initialize();

            PacketHandler handler = IncomingPacketHandlers.GetHandler(0xc1);

            Assert.IsNotNull(handler);

            handler.OnReceive(new PacketReader(packet, packet.Length, false));

            Assert.IsTrue(JournalCommands.InJournal("fingers slip!", "system"));
        }
Ejemplo n.º 2
0
        public void WillMatchSystem()
        {
            Engine.Journal.Write(new JournalEntry
            {
                Text = "You are now under the protection of town guards.", SpeechType = JournalSpeech.System
            });

            Assert.IsTrue(JournalCommands.InJournal("town guards", "system"));

            Engine.Journal.Clear();
        }
Ejemplo n.º 3
0
        public void WillMatchAuthor()
        {
            Engine.Journal.Write(new JournalEntry
            {
                Text       = "The quick brown bow jumped over the lazy dog.",
                SpeechType = JournalSpeech.Say,
                Name       = "Tony"
            });

            Assert.IsTrue(JournalCommands.InJournal("lazy dog", "tony"));

            Engine.Journal.Clear();
        }
Ejemplo n.º 4
0
        public void WillClearJournal()
        {
            Engine.Journal.Write(new JournalEntry
            {
                Text       = "The quick brown bow jumped over the lazy dog.",
                SpeechType = JournalSpeech.Say,
                Name       = "Tony"
            });

            JournalCommands.ClearJournal();

            Assert.AreEqual(0, Engine.Journal.Count);

            Engine.Journal.Clear();
        }
Ejemplo n.º 5
0
        public void WillMatchAny()
        {
            Engine.Journal.Write(new JournalEntry
            {
                Text = "You are now under the protection of town guards.", SpeechType = JournalSpeech.System
            });

            Engine.Journal.Write(new JournalEntry
            {
                Text       = "The quick brown bow jumped over the lazy dog.",
                SpeechType = JournalSpeech.Say,
                Name       = "Tony"
            });

            Assert.IsTrue(JournalCommands.InJournal("town guards"));

            Assert.IsTrue(JournalCommands.InJournal("lazy dog"));

            Engine.Journal.Clear();
        }