예제 #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
파일: Msg_Pay.cs 프로젝트: frankroad/CNGPI
 protected override void WriteData(MsgDataStream stream)
 {
     base.WriteData(stream);
     stream.WriteInt16(TransID);
     stream.WriteInt16(Coins);
     stream.WriteByte((byte)CoinType);
 }
예제 #6
0
파일: Msg_Pay.cs 프로젝트: frankroad/CNGPI
 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
파일: Msg_Sync.cs 프로젝트: frankroad/CNGPI
 protected override void WriteData(MsgDataStream stream)
 {
     base.WriteData(stream);
     stream.WriteInt16(State);
     stream.WriteInt16(RemainCoin);
     stream.WriteInt16(RemainSec);
     stream.WriteInt16(ErrCode);
 }
예제 #18
0
파일: Msg_Sync.cs 프로젝트: frankroad/CNGPI
 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();
            }
        }