Пример #1
0
 protected override void WriteData(MsgDataStream stream)
 {
     base.WriteData(stream);
     stream.WriteInt16(ErrCode);
     stream.WriteString(QrCode, 150);
     stream.WriteString(ProductImage, 150);
 }
Пример #2
0
 protected override void WriteData(MsgDataStream stream)
 {
     base.WriteData(stream);
     stream.WriteInt32(ProductNum);
     stream.WriteByteArray(DeviceID);
     stream.WriteInt16(DeviceType);
 }
Пример #3
0
 protected override void ReadData(MsgDataStream stream)
 {
     base.ReadData(stream);
     ErrCode      = stream.ReadInt16();
     QrCode       = stream.ReadString(150);
     ProductImage = stream.ReadString(150);
 }
Пример #4
0
 protected override void ReadData(MsgDataStream stream)
 {
     base.ReadData(stream);
     TransID = stream.ReadInt16();
     BoxNum  = stream.ReadInt16();
     Amount  = stream.ReadInt16();
 }
Пример #5
0
 protected override void WriteData(MsgDataStream stream)
 {
     base.WriteData(stream);
     stream.WriteInt16(TransID);
     stream.WriteInt16(Coins);
     stream.WriteByte((byte)CoinType);
 }
Пример #6
0
 protected override void ReadData(MsgDataStream stream)
 {
     base.ReadData(stream);
     TransID  = stream.ReadInt16();
     Coins    = stream.ReadInt16();
     CoinType = stream.ReadByte();
 }
Пример #7
0
 protected override void ReadData(MsgDataStream stream)
 {
     base.ReadData(stream);
     CoinsPerTimes = stream.ReadByte();
     WinCoins      = stream.ReadInt16();
     WinTicket     = stream.ReadInt16();
 }
Пример #8
0
 protected override void WriteData(MsgDataStream stream)
 {
     base.WriteData(stream);
     stream.WriteByte((byte)CoinsPerTimes);
     stream.WriteInt16(WinCoins);
     stream.WriteInt16(WinTicket);
 }
Пример #9
0
 protected virtual void ReadData(MsgDataStream stream)
 {
     stream.ReadByteArray(2);
     ADR = stream.ReadInt16();
     stream.ReadInt16(); //PID
     stream.ReadInt16(); //len
 }
Пример #10
0
        public Byte[] GetMsgData()
        {
            if (_MsgData != null)
            {
                return(_MsgData);
            }
            System.IO.MemoryStream mem    = new System.IO.MemoryStream();
            MsgDataStream          msgstm = new MsgDataStream(mem);

            WriteData(msgstm);
            msgstm.WriteByteArray(new byte[] { 0, 0, 0xFE, 0x73 });
            _MsgData = mem.ToArray();
            mem.Close();
            int datalen = _MsgData.Length - 12;

            _MsgData[6] = (byte)((datalen >> 8) & 0xFF);
            _MsgData[7] = (byte)((datalen) & 0xFF);
            byte sum = _MsgData[0];
            byte xor = _MsgData[0];

            for (int i = 1; i < _MsgData.Length - 4; i++)
            {
                sum = (byte)(sum + _MsgData[i]);
                xor = (byte)(xor ^ _MsgData[i]);
            }
            _MsgData[datalen + 8] = sum;
            _MsgData[datalen + 9] = xor;
            return(_MsgData);
        }
Пример #11
0
 protected override void ReadData(MsgDataStream stream)
 {
     base.ReadData(stream);
     ProductNum = stream.ReadInt32();
     DeviceID   = stream.ReadByteArray(16);
     DeviceType = stream.ReadInt16();
 }
Пример #12
0
 protected override void WriteData(MsgDataStream stream)
 {
     base.WriteData(stream);
     stream.WriteInt16(TransID);
     stream.WriteInt16(BoxNum);
     stream.WriteInt16(Amount);
 }
Пример #13
0
        protected override void WriteData(MsgDataStream stream)
        {
            base.WriteData(stream);
            stream.WriteInt16(ErrCode);
            stream.WriteInt16(ItemID);
            stream.WriteInt32(Value);
            stream.WriteInt32(MaxValue);
            stream.WriteInt32(MinValue);
            byte[] bts = Utility.UnicodeToGB2312ToByte(ItemName, 32);

            stream.WriteByteArray(bts);
            if (ItemDiscribe == null)
            {
                stream.WriteByte(0);
            }
            else
            {
                byte[] bts2 = System.Text.Encoding.Unicode.GetBytes(ItemDiscribe);

                var    gb2312 = Encoding.GetEncoding("GB2312");
                byte[] bts3   = Encoding.Convert(Encoding.Unicode, gb2312, bts2);
                stream.WriteByte((byte)bts3.Length);
                stream.WriteByteArray(bts3);
            }
        }
Пример #14
0
 protected override void ReadData(MsgDataStream stream)
 {
     base.ReadData(stream);
     BoxNum   = stream.ReadInt16();
     Price    = stream.ReadInt32();
     OrderNum = stream.ReadHex(16);
     TimeOut  = stream.ReadByte();
 }
Пример #15
0
 protected override void WriteData(MsgDataStream stream)
 {
     base.WriteData(stream);
     stream.WriteInt16(ErrCode);
     stream.WriteInt16(ItemID);
     stream.WriteInt32(ItemValue);
     stream.WriteByte(Display);
 }
Пример #16
0
 protected override void WriteData(MsgDataStream stream)
 {
     base.WriteData(stream);
     stream.WriteInt16(BoxNum);
     stream.WriteInt32(Price);
     stream.WriteHex(OrderNum);
     stream.WriteByte(TimeOut);
 }
Пример #17
0
 protected override void WriteData(MsgDataStream stream)
 {
     base.WriteData(stream);
     stream.WriteInt16(State);
     stream.WriteInt16(RemainCoin);
     stream.WriteInt16(RemainSec);
     stream.WriteInt16(ErrCode);
 }
Пример #18
0
 protected override void ReadData(MsgDataStream stream)
 {
     base.ReadData(stream);
     State      = stream.ReadInt16();
     RemainCoin = stream.ReadInt16();
     RemainSec  = stream.ReadInt16();
     ErrCode    = stream.ReadInt16();
 }
Пример #19
0
 protected override void WriteData(MsgDataStream stream)
 {
     base.WriteData(stream);
     stream.WriteInt16(TransID);
     stream.WriteInt32(OutGift);
     stream.WriteByte((byte)GiftType);
     stream.WriteByte((byte)GiftPort);
 }
Пример #20
0
 protected override void ReadData(MsgDataStream stream)
 {
     base.ReadData(stream);
     TransID  = stream.ReadInt16();
     OutGift  = stream.ReadInt32();
     GiftType = stream.ReadByte();
     GiftPort = stream.ReadByte();
 }
Пример #21
0
 protected override void ReadData(MsgDataStream stream)
 {
     base.ReadData(stream);
     ErrCode   = stream.ReadInt16();
     ItemID    = stream.ReadInt16();
     ItemValue = stream.ReadInt32();
     Display   = stream.ReadByte();
 }
Пример #22
0
 protected virtual void WriteData(MsgDataStream stream)
 {
     stream.WriteByte(0xEF);
     stream.WriteByte(0x37);
     stream.WriteInt16(ADR);
     stream.WriteInt16(PID);
     stream.WriteInt16(0);//len
 }
Пример #23
0
 protected override void ReadData(MsgDataStream stream)
 {
     base.ReadData(stream);
     ErrCode  = stream.ReadInt16();
     PCoins   = stream.ReadInt32();
     ECoins   = stream.ReadInt32();
     PGifts   = stream.ReadInt32();
     PTickets = stream.ReadInt32();
 }
Пример #24
0
 protected override void WriteData(MsgDataStream stream)
 {
     base.WriteData(stream);
     stream.WriteInt16(ErrCode);
     stream.WriteInt32(PCoins);
     stream.WriteInt32(ECoins);
     stream.WriteInt32(PGifts);
     stream.WriteInt32(PTickets);
 }
Пример #25
0
 protected override void ReadData(MsgDataStream stream)
 {
     base.ReadData(stream);
     TransID = stream.ReadInt16();
     BoxNum  = stream.ReadInt16();
     Price   = stream.ReadInt16();
     Cost    = stream.ReadInt16();
     Name    = stream.ReadString(64);
     Url     = stream.ReadString(200);
 }
Пример #26
0
 protected override void WriteData(MsgDataStream stream)
 {
     base.WriteData(stream);
     stream.WriteByte((byte)CoinsPerTimes);
     stream.WriteByte((byte)GameSec);
     stream.WriteByte((byte)LowPower);
     stream.WriteByte((byte)HightPower);
     stream.WriteInt16(WinCoins);
     stream.WriteInt16(WinGifts);
 }
Пример #27
0
 protected override void WriteData(MsgDataStream stream)
 {
     base.WriteData(stream);
     stream.WriteInt16(TransID);
     stream.WriteInt16(BoxNum);
     stream.WriteInt16(Price);
     stream.WriteInt16(Cost);
     stream.WriteString(Name, 64);
     stream.WriteString(Url, 200);
 }
Пример #28
0
 protected override void ReadData(MsgDataStream stream)
 {
     base.ReadData(stream);
     CoinsPerTimes = stream.ReadByte();
     GameSec       = stream.ReadByte();
     LowPower      = stream.ReadByte();
     HightPower    = stream.ReadByte();
     WinCoins      = stream.ReadInt16();
     WinGifts      = stream.ReadInt16();
 }
Пример #29
0
 protected override void WriteData(MsgDataStream stream)
 {
     base.WriteData(stream);
     stream.WriteInt16(TransID);
     stream.WriteByte((byte)WinList.Count);
     byte[] list = new byte[WinList.Count];
     for (int i = 0; i < WinList.Count; i++)
     {
         list[i] = (byte)WinList[i];
     }
     stream.WriteByteArray(list);
 }
Пример #30
0
        protected override void ReadData(MsgDataStream stream)
        {
            base.ReadData(stream);
            ErrCode = stream.ReadInt16();
            int MenuItemscount = stream.ReadByte();

            MenuItems = new int[MenuItemscount];
            for (int i = 0; i < MenuItemscount; i++)
            {
                MenuItems[i] = stream.ReadInt16();
            }
        }