Beispiel #1
0
        private void sendMessage(MessageType type, string message, string operate)
        {
            Logger.Default.Info("Send Message : {0} - {1} - {2}", type, message, operate);
            MessagePacket packet = new MessagePacket(type, message, operate);

            send(ParamCode.Message, MessagePacket.Encode(packet));
        }
Beispiel #2
0
        public void TestMessagePacket()
        {
            MessagePacket packet = new MessagePacket(MessageType.Error, "errorTest", null);

            byte[]        buffer  = MessagePacket.Encode(packet);
            MessagePacket packet2 = MessagePacket.Decode(buffer);

            Assert.AreNotSame(packet, packet2);
            Assert.AreEqual(packet.Type, packet2.Type);
            Assert.AreEqual(packet.Message, packet2.Message);
            Assert.AreEqual(packet.Operate, packet2.Operate);
        }