Ejemplo n.º 1
0
        /*
         * static public void Read(TarsInputStream _is, ref WebSocketCommand command,
         *                      int tag, bool require = true)
         * {
         *  command = (WebSocketCommand)_is.Read(command, tag, require);
         * }
         *
         * static public void Write(TarsOutputStream _os, WebSocketCommand command, int tag)
         * {
         *  _os.Write(command, tag);
         * }
         * //*/

        public override void ReadFrom(TarsInputStream _is)
        {
            iCmdType   = (int)_is.Read(iCmdType, 0, false);
            vData      = (byte[])_is.Read(vData, 1, false);
            lRequestId = (long)_is.Read(lRequestId, 2, false);
            sTraceId   = (string)_is.Read(sTraceId, 3, false);
        }
Ejemplo n.º 2
0
 public override void ReadFrom(TarsInputStream _is)
 {
     iPushType     = (int)_is.Read(iPushType, 0, false);
     iUri          = (int)_is.Read(iUri, 1, false);
     sMsg          = (byte[])_is.Read(sMsg, 2, false);
     iProtocolType = (int)_is.Read(iProtocolType, 3, false);
 }
Ejemplo n.º 3
0
 public override void ReadFrom(TarsInputStream _is)
 {
     tId          = (UserId)_is.Read(tId, 0, false);
     lTopcid      = (long)_is.Read(lTopcid, 1, false);
     lSubcid      = (long)_is.Read(lSubcid, 2, false);
     sSendContent = (string)_is.Read(sSendContent, 3, false);
 }
Ejemplo n.º 4
0
 public override void ReadFrom(TarsInputStream _is)
 {
     lTid = (long)_is.Read(lTid, 0, false);
     lSid = (long)_is.Read(lSid, 1, false);
     iUserHeartBeatInterval    = (int)_is.Read(iUserHeartBeatInterval, 2, false);
     iPresentHeartBeatInterval = (int)_is.Read(iPresentHeartBeatInterval, 3, false);
 }
Ejemplo n.º 5
0
 public override void ReadFrom(TarsInputStream _is)
 {
     lUid        = (long)_is.Read(lUid, 0, false);
     lBadgeId    = (long)_is.Read(lBadgeId, 1, false);
     iBadgeLevel = (int)_is.Read(iBadgeLevel, 2, false);
     iScore      = (int)_is.Read(iScore, 3, false);
 }
Ejemplo n.º 6
0
 public override void ReadFrom(TarsInputStream _is)
 {
     lUid        = (long)_is.Read(lUid, 0, false);
     lPid        = (long)_is.Read(lPid, 1, false);
     iGuardLevel = (int)_is.Read(iGuardLevel, 2, false);
     lEndTime    = (long)_is.Read(lEndTime, 3, false);
 }
Ejemplo n.º 7
0
 public override void ReadFrom(TarsInputStream _is)
 {
     lUid      = (long)_is.Read(lUid, 0, false);
     lImid     = (long)_is.Read(lImid, 1, false);
     sNickName = (string)_is.Read(sNickName, 2, false);
     iGender   = (int)_is.Read(iGender, 3, false);
 }
Ejemplo n.º 8
0
 public override void ReadFrom(TarsInputStream _is)
 {
     sGuid      = (string)_is.Read(sGuid, 0, false);
     iTime      = (int)_is.Read(iTime, 1, false);
     vProxyList = (List <LiveProxyValue>)_is.Read(vProxyList, 2, false);
     iAccess    = (int)_is.Read(iAccess, 3, false);
 }
Ejemplo n.º 9
0
 public override void ReadFrom(TarsInputStream _is)
 {
     id   = (int)_is.Read(id, 0, false);
     name = (string)_is.Read(name, 1, false);
     uids = (Dictionary <long, short>)_is.Read(uids, 2, false);
     tips = (string)_is.Read(tips, 3, false);
 }
Ejemplo n.º 10
0
 public override void ReadFrom(TarsInputStream _is)
 {
     lUid    = (long)_is.Read(lUid, 0, false);
     sGuid   = (string)_is.Read(sGuid, 1, false);
     sToken  = (string)_is.Read(sToken, 2, false);
     sHuyaUA = (string)_is.Read(sHuyaUA, 3, false);
     sCookie = (string)_is.Read(sCookie, 4, false);
 }
Ejemplo n.º 11
0
 public override void ReadFrom(TarsInputStream _is)
 {
     iFontColor      = (int)_is.Read(iFontColor, 0, false);
     iFontSize       = (int)_is.Read(iFontSize, 1, false);
     iTextSpeed      = (int)_is.Read(iTextSpeed, 2, false);
     iTransitionType = (int)_is.Read(iTransitionType, 3, false);
     iPopupStyle     = (int)_is.Read(iPopupStyle, 4, false);
 }
Ejemplo n.º 12
0
 public override void ReadFrom(TarsInputStream _is)
 {
     vPropsItemList     = (List <PropsItem>)_is.Read(vPropsItemList, 1, false);
     sMd5               = (string)_is.Read(sMd5, 2, false);
     iNewEffectSwitch   = (short)_is.Read(iNewEffectSwitch, 3, false);
     iMirrorRoomShowNum = (short)_is.Read(iMirrorRoomShowNum, 4, false);
     iGameRoomShowNum   = (short)_is.Read(iGameRoomShowNum, 5, false);
 }
Ejemplo n.º 13
0
 public virtual void DecodeResponse(TarsInputStream input, RequestPacket response)
 {
     response.PacketType  = input.Read((byte)0, 2, true);
     response.RequestId   = input.Read(0, 3, true);
     response.MessageType = input.Read(0, 4, true);
     response.Ret         = input.Read(0, 5, true);
     response.Buffer      = input.Read(new byte[0], 6, true);
     response.Status      = input.ReadMap <string, string>(new Dictionary <string, string>(), 7, false);
     response.ResultDesc  = input.ReadString(8, false);
     response.Context     = input.ReadMap <string, string>(new Dictionary <string, string>(), 9, false);
 }
Ejemplo n.º 14
0
 public virtual void DecodeRequest(TarsInputStream input, RequestPacket request)
 {
     request.PacketType  = input.Read(request.PacketType, 2, true);
     request.MessageType = input.Read(request.MessageType, 3, true);
     request.RequestId   = input.Read(request.RequestId, 4, true);
     request.ServantName = input.ReadString(5, true);
     request.FuncName    = input.ReadString(6, true);
     request.Buffer      = input.ReadBytes(7, true);
     request.Timeout     = input.Read(request.Timeout, 8, true);
     request.Context     = input.ReadMap <string, string>(new Dictionary <string, string>(), 9, false);
     request.Status      = input.ReadMap <string, string>(new Dictionary <string, string>(), 10, false);
 }
Ejemplo n.º 15
0
 public override void ReadFrom(TarsInputStream _is)
 {
     iItemType      = (int)_is.Read(iItemType, 0, false);
     iItemCount     = (int)_is.Read(iItemCount, 1, false);
     lSenderUid     = (long)_is.Read(lSenderUid, 3, false);
     sSenderNick    = (string)_is.Read(sSenderNick, 4, false);
     lPresenterUid  = (long)_is.Read(lPresenterUid, 5, false);
     sPresenterNick = (string)_is.Read(sPresenterNick, 6, false);
     lSid           = (long)_is.Read(lSid, 7, false);
     lSubSid        = (int)_is.Read(lSubSid, 8, false);
     lRoomId        = (int)_is.Read(lRoomId, 9, false);
     iTemplateType  = (int)_is.Read(iTemplateType, 10, false);
 }
Ejemplo n.º 16
0
        public virtual Tuple <object, object[]> DecodeReturnValue(byte[] body, RpcMethodMetadata metdata)
        {
            var    buf    = Unpooled.WrappedBuffer(body);
            var    stream = new TarsInputStream(buf);
            object result = metdata.RealReturnType == typeof(void) ? null
                : stream.Read(BasicClassTypeUtil.CreateObject(metdata.RealReturnType), metdata.ReturnInfo.Position + 1, true);
            var ps = metdata.Parameters
                     .Where(i => i.ParameterType.IsByRef)
                     .Select(i => stream.Read(BasicClassTypeUtil.CreateObject(i.ParameterType), i.Position + 1, false))
                     .ToArray();

            return(Tuple.Create(result, ps));
        }
Ejemplo n.º 17
0
 public override void DecodeResponse(TarsInputStream input, RequestPacket response)
 {
     response.PacketType  = input.Read((byte)0, 2, true);
     response.MessageType = input.Read(0, 3, true);
     response.RequestId   = input.Read(0, 4, true);
     response.ServantName = input.ReadString(5, true);
     response.FuncName    = input.ReadString(6, true);
     response.Buffer      = input.Read(new byte[0], 7, true);
     response.Timeout     = input.Read(0, 8, true);
     response.Status      = input.ReadMap <string, string>(new Dictionary <string, string>(), 9, false);
     response.Context     = input.ReadMap <string, string>(new Dictionary <string, string>(), 10, false);
     response.GetRetToStatus();
 }
Ejemplo n.º 18
0
        public override void ReadFrom(TarsInputStream _is)
        {
            try
            {
                iVersion     = (short)_is.Read(iVersion, 1, true);
                cPacketType  = (byte)_is.Read(cPacketType, 2, true);
                iMessageType = (int)_is.Read(iMessageType, 3, true);
                iRequestId   = (int)_is.Read(iRequestId, 4, true);
                sServantName = (string)_is.ReadString(5, true);
                sFuncName    = (string)_is.ReadString(6, true);

                if (cache_sBuffer == null)
                {
                    cache_sBuffer = new byte[] { 0 };
                }
                sBuffer  = (byte[])_is.Read <byte[]>(cache_sBuffer, 7, true);
                iTimeout = (int)_is.Read(iTimeout, 8, true);

                Dictionary <string, string> cache_context = null;
                context = (Dictionary <string, string>)_is.Read <Dictionary <string, string> >(cache_context, 9, true);
                status  = (Dictionary <string, string>)_is.Read <Dictionary <string, string> >(cache_context, 10, true);
            }
            catch (Exception ex)
            {
                QTrace.Trace(this + " ReadFrom Exception: " + ex.Message);
                throw ex;
            }
        }
Ejemplo n.º 19
0
 public override void ReadFrom(TarsInputStream _is)
 {
     vDecorationPrefix = (List <DecorationInfo>)_is.Read(vDecorationPrefix, 0, false);
     vDecorationSuffix = (List <DecorationInfo>)_is.Read(vDecorationSuffix, 1, false);
     tFormat           = (ContentFormat)_is.Read(tFormat, 2, false);
     tBulletFormat     = (BulletFormat)_is.Read(tBulletFormat, 3, false);
     vForwardChannels  = (List <ChannelPair>)_is.Read(vForwardChannels, 4, false);
     iModifyMask       = (int)_is.Read(iModifyMask, 5, false);
     vBulletPrefix     = (List <DecorationInfo>)_is.Read(vBulletPrefix, 6, false);
     tUserInfo         = (SenderInfo)_is.Read(tUserInfo, 7, false);
     vBulletSuffix     = (List <DecorationInfo>)_is.Read(vBulletSuffix, 8, false);
 }
Ejemplo n.º 20
0
 public override void ReadFrom(TarsInputStream _is)
 {
     lUid         = (long)_is.Read(lUid, 0, false);
     lPid         = (long)_is.Read(lPid, 1, false);
     lValidDate   = (long)_is.Read(lValidDate, 2, false);
     sNobleName   = (string)_is.Read(sNobleName, 3, false);
     iNobleLevel  = (int)_is.Read(iNobleLevel, 4, false);
     iNoblePet    = (int)_is.Read(iNoblePet, 5, false);
     iNobleStatus = (int)_is.Read(iNobleStatus, 6, false);
     iNobleType   = (int)_is.Read(iNobleType, 7, false);
     iRemainDays  = (int)_is.Read(iRemainDays, 8, false);
 }
Ejemplo n.º 21
0
 public override void ReadFrom(TarsInputStream _is)
 {
     lStarterUid     = (long)_is.Read(lStarterUid, 0, false);
     sStarterNick    = (string)_is.Read(sStarterNick, 1, false);
     iShortChannelId = (long)_is.Read(iShortChannelId, 2, false);
     vAwardUsers     = (List <AwardUser>)_is.Read(vAwardUsers, 3, false);
     lTid            = (long)_is.Read(lTid, 4, false);
     lSid            = (long)_is.Read(lSid, 5, false);
     iTreasureType   = (long)_is.Read(iTreasureType, 6, false);
     sTreasureName   = (string)_is.Read(sTreasureName, 7, false);
     lPid            = (long)_is.Read(lPid, 8, false);
 }
Ejemplo n.º 22
0
        private object DecodeBuffer(byte[] buffer, Type type)
        {
            TarsInputStream tis = new TarsInputStream(buffer);

            tis.SetServerEncoding(EncodeName);
            var result = tis.Read(type, 0, true);

            return(result);
        }
Ejemplo n.º 23
0
 public override void ReadFrom(TarsInputStream _is)
 {
     tUserId       = (UserId)_is.Read(tUserId, 1, false);
     sMd5          = (string)_is.Read(sMd5, 2, false);
     iTemplateType = (int)_is.Read(iTemplateType, 3, false);
     sVersion      = (string)_is.Read(sVersion, 4, false);
     iAppId        = (int)_is.Read(iAppId, 5, false);
     lPresenterUid = (long)_is.Read(lPresenterUid, 6, false);
     lSid          = (long)_is.Read(lSid, 7, false);
     lSubSid       = (long)_is.Read(lSubSid, 8, false);
 }
Ejemplo n.º 24
0
 public override void ReadFrom(TarsInputStream _is)
 {
     lUid       = (long)_is.Read(lUid, 0, false);
     bAonymous  = (bool)_is.Read(bAonymous, 1, false);
     sGuid      = (string)_is.Read(sGuid, 2, false);
     sToken     = (string)_is.Read(sToken, 3, false);
     lTid       = (long)_is.Read(lTid, 4, false);
     lSid       = (long)_is.Read(lSid, 5, false);
     lGroupId   = (long)_is.Read(lGroupId, 6, false);
     lGroupType = (long)_is.Read(lGroupType, 7, false);
 }
Ejemplo n.º 25
0
        public virtual object[] DecodeMethodParameters(byte[] body, RpcMethodMetadata metdata)
        {
            if (metdata.Parameters.Length == 0)
            {
                return(new object[0]);
            }

            var buf    = Unpooled.WrappedBuffer(body);
            var stream = new TarsInputStream(buf);

            return(metdata.Parameters
                   .Select(i => stream.Read(BasicClassTypeUtil.CreateObject(i.ParameterType), i.Position + 1, false))
                   .ToArray());
        }
Ejemplo n.º 26
0
 public override void ReadFrom(TarsInputStream _is)
 {
     tUserInfo         = (SenderInfo)_is.Read(tUserInfo, 0, false);
     lTid              = (long)_is.Read(lTid, 1, false);
     lSid              = (long)_is.Read(lSid, 2, false);
     sContent          = (string)_is.Read(sContent, 3, false);
     iShowMode         = (int)_is.Read(iShowMode, 4, false);
     tFormat           = (ContentFormat)_is.Read(tFormat, 5, false);
     tBulletFormat     = (BulletFormat)_is.Read(tBulletFormat, 6, false);
     iTermType         = (int)_is.Read(iTermType, 7, false);
     vDecorationPrefix = (List <DecorationInfo>)_is.Read(vDecorationPrefix, 8, false);
     vDecorationSuffix = (List <DecorationInfo>)_is.Read(vDecorationSuffix, 9, false);
     vAtSomeone        = (List <UidNickName>)_is.Read(vAtSomeone, 10, false);
     lPid              = (long)_is.Read(lPid, 11, false);
 }
Ejemplo n.º 27
0
 public override void ReadFrom(TarsInputStream _is)
 {
     iItemType         = (int)_is.Read(iItemType, 0, false);
     strPayId          = (string)_is.Read(strPayId, 1, false);
     iItemCount        = (int)_is.Read(iItemCount, 2, false);
     lPresenterUid     = (long)_is.Read(lPresenterUid, 3, false);
     lSenderUid        = (long)_is.Read(lSenderUid, 4, false);
     sPresenterNick    = (string)_is.Read(sPresenterNick, 5, false);
     sSenderNick       = (string)_is.Read(sSenderNick, 6, false);
     sSendContent      = (string)_is.Read(sSendContent, 7, false);
     iItemCountByGroup = (int)_is.Read(iItemCountByGroup, 8, false);
     iItemGroup        = (int)_is.Read(iItemGroup, 9, false);
     iSuperPupleLevel  = (int)_is.Read(iSuperPupleLevel, 10, false);
     iComboScore       = (int)_is.Read(iComboScore, 11, false);
     iDisplayInfo      = (int)_is.Read(iDisplayInfo, 12, false);
     iEffectType       = (int)_is.Read(iEffectType, 13, false);
     sSenderIcon       = (string)_is.Read(sSenderIcon, 14, false);
     sPresenterIcon    = (string)_is.Read(sPresenterIcon, 15, false);
     iTemplateType     = (int)_is.Read(iTemplateType, 16, false);
     sExpand           = (string)_is.Read(sExpand, 17, false);
     bBusi             = (bool)_is.Read(bBusi, 18, false);
     iColorEffectType  = (int)_is.Read(iColorEffectType, 19, false);
 }
Ejemplo n.º 28
0
 public override void ReadFrom(TarsInputStream _is)
 {
     iAttendeeCount = (int)_is.Read(iAttendeeCount, 0, false);
 }
Ejemplo n.º 29
0
 public override void ReadFrom(TarsInputStream _is)
 {
     iItemType           = (int)_is.Read(iItemType, 0, false);
     iItemCount          = (int)_is.Read(iItemCount, 1, false);
     lSenderSid          = (long)_is.Read(lSenderSid, 2, false);
     lSenderUid          = (long)_is.Read(lSenderUid, 3, false);
     sSenderNick         = (string)_is.Read(sSenderNick, 4, false);
     lPresenterUid       = (long)_is.Read(lPresenterUid, 5, false);
     sPresenterNick      = (string)_is.Read(sPresenterNick, 6, false);
     lNoticeChannelCount = (long)_is.Read(lNoticeChannelCount, 7, false);
     iItemCountByGroup   = (int)_is.Read(iItemCountByGroup, 8, false);
     iItemGroup          = (int)_is.Read(iItemGroup, 9, false);
     iDisplayInfo        = (int)_is.Read(iDisplayInfo, 10, false);
     iSuperPupleLevel    = (int)_is.Read(iSuperPupleLevel, 11, false);
     iTemplateType       = (int)_is.Read(iTemplateType, 12, false);
     sExpand             = (string)_is.Read(sExpand, 13, false);
     bBusi        = (bool)_is.Read(bBusi, 14, false);
     iShowTime    = (int)_is.Read(iShowTime, 15, false);
     lPresenterYY = (long)_is.Read(lPresenterYY, 16, false);
     lSid         = (long)_is.Read(lSid, 17, false);
     lSubSid      = (long)_is.Read(lSubSid, 18, false);
     lRoomId      = (long)_is.Read(lRoomId, 19, false);
 }
Ejemplo n.º 30
0
 public override void ReadFrom(TarsInputStream _is)
 {
     sUserNick  = (string)_is.Read(sUserNick, 0, false);
     iPrizeType = (int)_is.Read(iPrizeType, 1, false);
     sPrizeName = (string)_is.Read(sPrizeName, 2, false);
 }