Exemplo n.º 1
0
 public bool doSceneVoiceEx(string toUsername, int mMsgSrvId, int timeLenth, byte[] toSend)
 {
     base.beginBuilder();
     base.mBuilder.BaseRequest  = NetSceneBase.makeBaseRequest(0x13);
     base.mBuilder.FromUserName = AccountMgr.getCurAccount().strUsrName;
     base.mBuilder.ToUserName   = toUsername;
     base.mBuilder.Offset       = (uint)toSend.Length;
     base.mBuilder.Length       = (uint)toSend.Length;
     base.mBuilder.ClientMsgId  = MD5Core.GetHashString(toUsername + Util.getNowMilliseconds());
     base.mBuilder.MsgId        = (uint)mMsgSrvId;
     base.mBuilder.VoiceLength  = (uint)timeLenth;
     base.mBuilder.Data         = Util.toSKBuffer(toSend);
     //uint num = 0;
     //if (this.mVoiceContext.isEncodeAmrEnd() && ((this.mVoiceContext.mNetOffset + toSend.Length) >= this.mVoiceContext.mOutputLength))
     //{
     //    num = 1;
     //}
     base.mBuilder.EndFlag = 1;// num;
     //if (this.mVoiceContext.mIsCancelled)
     //{
     //    base.mBuilder.CancelFlag = 1;
     //    base.mBuilder.Data = Util.toSKBuffer("");
     //    base.mBuilder.Length = 0;
     //}
     base.mSessionPack.mCmdID = 0x13;
     base.endBuilder();
     return(true);
 }
Exemplo n.º 2
0
        //public NetSceneSnsTimeLine(SnsTimeLineCallBack cb)
        //{
        //    this.onTimeLineRsp = cb;
        //}

        public bool doScene(bool isFirstPage, ulong lastID)
        {
            base.beginBuilder();
            base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0);
            if (isFirstPage)
            {
                //SnsPage page = StorageMgr.snsPage.get(AccountMgr.strUsrName);
                //if (page == null)
                //{
                //    base.mBuilder.FirstPageMd5 = "";
                //    base.mBuilder.MaxId = 0L;
                //}
                //else
                //{
                //    base.mBuilder.FirstPageMd5 = page.strFirstPageMd5;
                //    base.mBuilder.MaxId = 0L;
                //}
            }
            else
            {
                base.mBuilder.FirstPageMd5 = "";
                base.mBuilder.MaxId        = lastID;
            }
            base.mBuilder.MinFilterId     = 0L;
            base.mBuilder.LastRequestTime = 0;
            base.mSessionPack.mCmdID      = 0x62;
            base.endBuilder();
            return(true);
        }
Exemplo n.º 3
0
        private bool doSceneEx(byte[] toSend)
        {
            base.beginBuilder();
            base.mBuilder.BaseRequest  = NetSceneBase.makeBaseRequest(0x13);
            base.mBuilder.FromUserName = AccountMgr.getCurAccount().strUsrName;
            base.mBuilder.ToUserName   = this.mVoiceContext.mUserName;
            base.mBuilder.Offset       = (uint)this.mVoiceContext.mNetOffset;
            base.mBuilder.Length       = (uint)toSend.Length;
            base.mBuilder.ClientMsgId  = this.mVoiceContext.mClientMsgId;
            base.mBuilder.MsgId        = (uint)this.mVoiceContext.mMsgSrvId;
            base.mBuilder.VoiceLength  = (uint)this.mVoiceContext.mVoiceTimeLength;
            base.mBuilder.VoiceFormat  = (uint)this.mVoiceContext.EncodeType;
            // base.mBuilder.v
            base.mBuilder.Data = Util.toSKBuffer(toSend);
            uint num = 0;

            if (this.mVoiceContext.isEncodeAmrEnd() && ((this.mVoiceContext.mNetOffset + toSend.Length) >= this.mVoiceContext.mOutputLength))
            {
                num = 1;
            }
            base.mBuilder.EndFlag = num;
            if (this.mVoiceContext.mIsCancelled)
            {
                base.mBuilder.CancelFlag = 1;
                base.mBuilder.Data       = Util.toSKBuffer("");
                base.mBuilder.Length     = 0;
            }
            base.mSessionPack.mCmdID = 0x13;
            base.endBuilder();
            return(true);
        }
Exemplo n.º 4
0
        protected override bool doDownScene()
        {
            DownloadImgContext mContext = base.mContext as DownloadImgContext;

            if (mContext == null)
            {
                return(false);
            }
            base.beginBuilder();
            base.mBuilder.BaseRequest  = NetSceneBase.makeBaseRequest(0, 369431841);
            base.mBuilder.FromUserName = Util.toSKString(mContext.mImgInfo.strFromUserName);
            base.mBuilder.ToUserName   = Util.toSKString(mContext.mImgInfo.strToUserName);
            base.mBuilder.TotalLen     = (uint)mContext.mImgInfo.nTotalDataLen;
            base.mBuilder.StartPos     = (uint)base.mOffsetPos;
            base.mBuilder.DataLen      = (uint)this.ONE_PACK_DOWNLOADSIZE;
            base.mBuilder.MsgId        = (uint)mContext.mImgInfo.nMsgSvrID;
            base.mBuilder.CompressType = (uint)mContext.mCompressType;
            base.mSessionPack.mCmdID   = 10;
            if (base.mUseHttp)
            {
                base.mSessionPack.mConnectMode = 2;
            }
            base.endBuilder();
            mContext.mStatus = 2;
            return(true);
        }
Exemplo n.º 5
0
        //public bool doCancel()
        //{
        //    if (this.mVideoContext != null)
        //    {
        //        CDNComService.Instance.cancelUploadMedia(this.mVideoContext.mVideoTrans.strClientMsgId);
        //        base.cancel();
        //        this.mVideoContext.mStatus = 4;
        //        this.doSceneFinished();
        //    }
        //    return true;
        //}

        //private void doReportInfo(int retCode)
        //{
        //    int num = this.mVideoContext.mVideoTrans.nTotalDataLen + this.mVideoContext.mThumbTotalLength;
        //    string str = string.Concat(new object[] { retCode, ",", 1, ",", (long) this.mVideoContext.startTimestamp, ",", (long) Util.getNowMilliseconds(), ",", ReportService.getReportNetworkType(), ",", CdnMediaType.MediaType_VIDEO, ",", num, ",", this.mCdnComReportInfo });
        //    NetSceneKVReport.addReportItem(0x28b5, str);
        //}

        //public void doScene(UploadVideoContext videoContext)
        //{
        //    if ((videoContext.mStatus != 0) && (videoContext.mStatus != 4))
        //    {
        //        Log.e("NetSceneUploadVideo", "doScene videoContext.mStatus error, status = " + videoContext.mStatus);
        //    }
        //    else
        //    {
        //        videoContext.mStatus = 1;
        //        this.mVideoContext = videoContext;
        //        this.mVideoContext.mSceneHandle = this;
        //        this.doSceneToCDN();
        //    }
        //}

        //public void doSceneFinished()
        //{
        //    if (this.mVideoContext != null)
        //    {
        //        this.mVideoContext.updateProgressInfo(0);
        //        this.mVideoContext.updateContext();
        //        this.mVideoContext.onFinished();
        //        this.mVideoContext.mSceneHandle = null;
        //        this.mVideoContext = null;
        //        Log.d("NetSceneUploadVideo", "scene Finished. ");
        //    }
        //}

        //private int doSceneToCDN()
        //{
        //    RTCDNUploadPara para = new RTCDNUploadPara {
        //        fileFullPath = this.mVideoContext.mVideoTrans.strImagePath,
        //        filetype = 4,
        //        toUser = this.mVideoContext.mVideoTrans.strToUserName,
        //        clientMediaID = this.mVideoContext.mChatMsg.strClientMsgId,
        //        arg = 0,
        //        hasThumb = true,
        //        thumbfileFullPath = this.mVideoContext.mVideoTrans.strThumbnail
        //    };
        //    this.mVideoContext.doCloseFile();
        //    para.needStorage = false;
        //    para.isStreamMedia = false;
        //    para.priority = 2;
        //    if (this.mVideoContext.mChatMsg.nMsgType == 0x3e)
        //    {
        //        para.smallVideoFlag = 1;
        //    }
        //    if (this.mVideoContext.mOrigChatMsg != null)
        //    {
        //        Log.d("NetSceneUploadVideo", "forward video msg , mOrigChatMsg = " + this.mVideoContext.mOrigChatMsg.strMsg);
        //        VideoDetailInfo info = UploadVideoService.parseVideoMsgXML(this.mVideoContext.mOrigChatMsg.strMsg);
        //        if (((info != null) && !string.IsNullOrEmpty(info.mCdnAesKey)) && !string.IsNullOrEmpty(info.mCdnVideoUrl))
        //        {
        //            para.fileid = info.mCdnVideoUrl;
        //            para.aeskey = info.mCdnAesKey;
        //            para.fileLength = (uint) info.nTotalDataLen;
        //        }
        //        else
        //        {
        //            Log.d("NetSceneUploadVideo", "Parse video msg xml failed: " + this.mVideoContext.mOrigChatMsg.strMsg);
        //        }
        //    }
        //    return CDNComService.Instance.startupUploadMedia(para, this);
        //}

        public void doSceneToCGI(string toUsername, MsgTrans videoinfo, DownloadVideoContext contextInfo, int nMsgType)
        {
            base.beginBuilder();
            base.mBuilder.BaseRequest       = NetSceneBase.makeBaseRequest(0);
            base.mBuilder.FromUserName      = videoinfo.strToUserName;
            base.mBuilder.ToUserName        = toUsername;
            base.mBuilder.ClientMsgId       = videoinfo.nMsgSvrID.ToString();
            base.mBuilder.PlayLength        = (uint)videoinfo.nDuration;
            base.mBuilder.NetworkEnv        = 1;
            base.mBuilder.CameraType        = 2;
            base.mSessionPack.mCmdID        = 0x27;
            base.mSessionPack.mNeedCompress = false;
            base.mBuilder.VideoTotalLen     = (uint)videoinfo.nTotalDataLen;
            base.mBuilder.VideoStartPos     = 0;
            base.mBuilder.VideoData         = Util.toSKBuffer(new byte[0]);
            base.mBuilder.ThumbTotalLen     = (uint)contextInfo.mCdnThumbLength;
            base.mBuilder.ThumbStartPos     = 0;
            base.mBuilder.ThumbData         = Util.toSKBuffer(new byte[0]);
            base.mBuilder.CDNVideoUrl       = contextInfo.mCdnVideoUrl;
            base.mBuilder.AESKey            = contextInfo.mCdnAesKey;
            base.mBuilder.EncryVer          = 1;
            base.mBuilder.CDNThumbUrl       = contextInfo.mCdnThumbUrl;
            base.mBuilder.CDNThumbImgSize   = contextInfo.mCdnThumbLength;
            base.mBuilder.CDNThumbImgWidth  = 0x84;
            base.mBuilder.CDNThumbImgHeight = 0x63;
            base.mBuilder.CDNThumbAESKey    = contextInfo.mCdnThumbAesKey;
            if (nMsgType == 0x3e)//小视频
            {
                base.mBuilder.FuncFlag = 3;
                base.mBuilder.VideoMd5 = Util.nullAsNil("");
            }
            base.endBuilder();
        }
Exemplo n.º 6
0
 private bool doSceneEx(string ChatRoomName)
 {
     //if (ct == null)
     //{
     //    return false;
     //}
     //if (!ContactHelper.isChatRoom(ct.strUsrName))
     //{
     //    Log.d("NSGetChatroomMemberDetail", "is not chatroom, strUsrName = " + ct.strUsrName);
     //    return false;
     //}
     //this.mChatRoomContact = ct;
     //uint num = ChatRoomMgr.getLocalVersionFromRoomData(this.mChatRoomContact.strChatRoomData);
     //if ((ChatRoomMgr.getServerVersionFromRoomData(this.mChatRoomContact.strChatRoomData) <= num) && (ChatRoomMgr.getChatRoomMemberContactList(ct.strUsrName) != null))
     //{
     //    Log.d("NSGetChatroomMemberDetail", "no need to get new ChatroomMemberDetail");
     //    return false;
     //}
     base.beginBuilder();
     base.mBuilder.BaseRequest      = NetSceneBase.makeBaseRequest(0, (int)ConstantsProtocol.CLIENT_MAX_VERSION);
     base.mBuilder.ChatroomUserName = ChatRoomName;
     base.mBuilder.ClientVersion    = 0;
     base.mSessionPack.mCmdUri      = "/cgi-bin/micromsg-bin/getchatroommemberdetail";
     base.mSessionPack.mConnectMode = 2;
     base.endBuilder();
     return(true);
 }
Exemplo n.º 7
0
 public bool doScene(ulong objectID)
 {
     this.mObjectID = objectID;
     base.beginBuilder();
     base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0);
     base.mBuilder.Id          = objectID;
     base.mSessionPack.mCmdID  = 0x65;
     base.endBuilder();
     return(true);
 }
Exemplo n.º 8
0
 private bool doSceneEx(SnsActionGroup content, string clientID)
 {
     base.beginBuilder();
     base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0);
     base.mBuilder.Action      = content;
     base.mBuilder.ClientId    = clientID;
     base.mSessionPack.mCmdID  = 100;
     base.endBuilder();
     return(true);
 }
Exemplo n.º 9
0
        private void doSceneEx()
        {
            int count = this.mUpImgContext.imgInfo.nTotalDataLen - this.mUpImgContext.imgInfo.nTransDataLen;

            if (count > this.mUpLoadedSize)
            {
                count = this.mUpLoadedSize;
            }
            if ((string.IsNullOrEmpty(this.mUpImgContext.imgInfo.strFromUserName) || string.IsNullOrEmpty(this.mUpImgContext.imgInfo.strToUserName)) || string.IsNullOrEmpty(this.mUpImgContext.imgInfo.strClientMsgId))
            {
                Log.e("NetSceneUploadImage", "Param error doScene fail");
                this.mUpImgContext.mStatus = 4;
                EventCenter.postEvent(EventConst.ON_NETSCENE_SENDIMG_FAIL, new ParamReturn(-1, this.mUpImgContext.imgInfo.nMsgTransID, this.mUpImgContext.talkerName), null);
                this.doSceneFinished();
            }
            else
            {
                byte[] buffer = new byte[count];
                this.mUpImgContext.mBigImageMemoryStream.Seek((long)this.mUpImgContext.imgInfo.nTransDataLen, SeekOrigin.Begin);
                this.mUpImgContext.mBigImageMemoryStream.Read(buffer, 0, count);
                if (buffer == null)
                {
                    Log.e("NetSceneUploadImage", "read buffer From Stream fail");
                    this.mUpImgContext.mStatus = 4;
                    EventCenter.postEvent(EventConst.ON_NETSCENE_SENDIMG_FAIL, new ParamReturn(-1, this.mUpImgContext.imgInfo.nMsgLocalID, this.mUpImgContext.talkerName), null);
                    this.doSceneFinished();
                }
                else
                {
                    base.beginBuilder();
                    base.mBuilder.BaseRequest  = NetSceneBase.makeBaseRequest(0);
                    base.mBuilder.FromUserName = Util.toSKString(this.mUpImgContext.imgInfo.strFromUserName);
                    base.mBuilder.ToUserName   = Util.toSKString(this.mUpImgContext.imgInfo.strToUserName);
                    base.mBuilder.ClientImgId  = Util.toSKString(this.mUpImgContext.imgInfo.strClientMsgId);
                    base.mBuilder.TotalLen     = (uint)this.mUpImgContext.imgInfo.nTotalDataLen;
                    base.mBuilder.StartPos     = (uint)this.mUpImgContext.imgInfo.nTransDataLen;
                    if (!this.mIsNeedScale)
                    {
                        base.mBuilder.CompressType = 1;
                    }
                    else
                    {
                        base.mBuilder.CompressType = 0;
                    }
                    base.mBuilder.DataLen           = (uint)count;
                    base.mBuilder.Data              = Util.toSKBuffer(buffer);
                    base.mBuilder.MsgType           = (uint)this.mUpImgContext.mMsgType;
                    base.mSessionPack.mCmdID        = 9;
                    base.mSessionPack.mNeedCompress = false;
                    base.mSessionPack.mConnectMode  = 1;
                    base.endBuilder();
                    this.mUpImgContext.mStatus = 2;
                }
            }
        }
Exemplo n.º 10
0
 public bool getNextPage(ulong maxID, ulong minID = 0L, uint LastRequestTime = 0)
 {
     base.beginBuilder();
     base.mBuilder.BaseRequest     = NetSceneBase.makeBaseRequest(0);
     base.mBuilder.MaxId           = maxID;
     base.mBuilder.MinFilterId     = minID;
     base.mBuilder.LastRequestTime = LastRequestTime;
     base.mBuilder.FirstPageMd5    = "";
     base.mSessionPack.mCmdID      = 0x62;
     base.endBuilder();
     return(true);
 }
Exemplo n.º 11
0
 public void doScene(string str)
 {
     base.beginBuilder();
     base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0);
     base.mBuilder.CgiCmd      = 4;
     base.mBuilder.OutPutType  = 1;
     base.mBuilder.ReqText     = Util.toSKBuffer(str);// Util.packQueryQuest(queryDic, true);
     Log.i("NetSceneRedEnvelopes", string.Concat(new object[] { "hongbao request sent,  Encrpt = ", str, ", reqText.Len = ", base.mBuilder.ReqText.ILen }));
     base.mSessionPack.mConnectMode = 1;
     base.mSessionPack.mCmdUri      = "/cgi-bin/mmpay-bin/businesshongbao";
     base.endBuilder();
 }
Exemplo n.º 12
0
 public bool getFirstPage(string strFirstPageMd5 = null)
 {
     base.beginBuilder();
     base.mBuilder.BaseRequest     = NetSceneBase.makeBaseRequest(0);
     base.mBuilder.FirstPageMd5    = (strFirstPageMd5 == null) ? "" : strFirstPageMd5;
     base.mBuilder.MaxId           = 0L;
     base.mBuilder.MinFilterId     = 0L;
     base.mBuilder.LastRequestTime = 0;
     base.mSessionPack.mCmdID      = 0x62;
     base.endBuilder();
     return(true);
 }
Exemplo n.º 13
0
 public void doScene(Dictionary <string, object> queryDic, int cmdID, int outputType)
 {
     base.beginBuilder();
     base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0, 369298705);
     base.mBuilder.CgiCmd      = (uint)cmdID;
     base.mBuilder.OutPutType  = (uint)outputType;
     base.mBuilder.ReqText     = Util.packQueryQuest(queryDic, true);
     //Log.w("NetSceneRedEnvelopes", string.Concat(new object[] { "hongbao request sent,  funid = ", this.mTenpayFunName, ", reqText.Len = ", base.mBuilder.ReqText.ILen }));
     base.mSessionPack.mConnectMode = 2;
     base.mSessionPack.mCmdUri      = "/cgi-bin/mmpay-bin/hongbao";
     base.endBuilder();
 }
Exemplo n.º 14
0
 private void doSceneEx()
 {
     base.beginBuilder();
     base.mBuilder.BaseRequest   = NetSceneBase.makeBaseRequest(0, 369298705);
     base.mBuilder.FromUserName  = this.mVideoContext.mVideoTrans.strFromUserName;
     base.mBuilder.ToUserName    = this.mVideoContext.mVideoTrans.strToUserName;
     base.mBuilder.ClientMsgId   = this.mVideoContext.mVideoTrans.strClientMsgId;
     base.mBuilder.PlayLength    = (uint)this.mVideoContext.mVideoTrans.nDuration;
     base.mBuilder.VideoTotalLen = (uint)this.mVideoContext.mTotalLength;
     base.mBuilder.ThumbTotalLen = (uint)this.mVideoContext.mThumbTotalLength;
     base.mBuilder.NetworkEnv    = 1;
     base.mBuilder.CameraType    = 2;
     base.mSessionPack.mCmdID    = 0x27;
     // base.mSessionPack.mCmdUri = "/cgi-bin/micromsg-bin/sendsight";
     //base.mSessionPack.mConnectMode = 2;
     base.mSessionPack.mNeedCompress = false;
     byte[] inBytes = new byte[0];
     byte[] buffer2 = null;
     buffer2 = this.mVideoContext.getRemainThumbToSend();
     if (buffer2 != null)
     {
         this.mVideoContext.mStatus        = 2;
         this.mVideoContext.mSendingLength = buffer2.Length;
         base.mBuilder.ThumbStartPos       = (uint)this.mVideoContext.mThumbNetOffset;
         base.mBuilder.ThumbData           = Util.toSKBuffer(buffer2);
         base.mBuilder.VideoStartPos       = (uint)this.mVideoContext.mNetOffset;
         base.mBuilder.VideoData           = Util.toSKBuffer(inBytes);
         base.endBuilder();
     }
     else
     {
         buffer2 = this.mVideoContext.getRemainVideoToSend();
         if (buffer2 != null)
         {
             this.mVideoContext.mStatus        = 3;
             this.mVideoContext.mSendingLength = buffer2.Length;
             base.mBuilder.ThumbStartPos       = (uint)this.mVideoContext.mThumbNetOffset;
             base.mBuilder.ThumbData           = Util.toSKBuffer(inBytes);
             base.mBuilder.VideoStartPos       = (uint)this.mVideoContext.mNetOffset;
             base.mBuilder.VideoData           = Util.toSKBuffer(buffer2);
             base.endBuilder();
         }
         else
         {
             this.mVideoContext.mStatus = 5;
             this.doSceneFinished();
         }
     }
 }
Exemplo n.º 15
0
 public bool doScene(List <SnsOpLog> opList)
 {
     base.beginBuilder();
     base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0, 0x64000031);
     foreach (SnsOpLog log in opList)
     {
         SnsObjectOp.Builder builder = SnsObjectOp.CreateBuilder();
         builder.Id     = log.nObjectID;
         builder.OpType = (uint)log.nOpType;
         builder.Ext    = (log.nDelCommentId == 0) ? emptyCommentID : Util.toSKBuffer(SnsObjectOpDeleteComment.CreateBuilder().SetCommentId(log.nDelCommentId).Build().ToByteArray());
         base.mBuilder.OpListList.Add(builder.Build());
     }
     base.mBuilder.OpCount    = (uint)base.mBuilder.OpListList.Count;
     base.mSessionPack.mCmdID = 0x68;
     return(base.endBuilder());
 }
Exemplo n.º 16
0
 public bool getNextPage(string userName, ulong maxID, ulong minID = 0L, uint LastRequestTime = 0)
 {
     base.beginBuilder();
     base.mBuilder.BaseRequest     = NetSceneBase.makeBaseRequest(0);
     base.mBuilder.MaxId           = maxID;
     base.mBuilder.MinFilterId     = minID;
     base.mBuilder.LastRequestTime = LastRequestTime;
     base.mBuilder.FirstPageMd5    = "";
     base.mBuilder.Username        = userName;
     //Contact contact = StorageMgr.contact.get(userName);
     //if (contact != null)
     //{
     //    base.mBuilder.Source = contact.nAddContactScene;
     //}
     base.mSessionPack.mCmdID = 0x63;
     base.endBuilder();
     return(true);
 }
Exemplo n.º 17
0
 private bool continueDoScene()
 {
     base.beginBuilder();
     base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0, 369298705);
     base.mBuilder.Selector    = 0x100;
     base.mBuilder.KeyBuf      = Util.toSKBuffer(NetSceneNewSync.mBytesSyncKeyBuf);
     base.mSessionPack.mCmdID  = 0x66;
     base.endBuilder();
     if (this.mContiuneSyncCount < 10)
     {
         this.mContiuneSyncCount++;
     }
     else
     {
         Log.d("NetSceneSnsSync", "mSyncCount exceed the maximum");
     }
     return(true);
 }
Exemplo n.º 18
0
        public void doScene(Dictionary <string, object> queryDic, Dictionary <string, object> innerDic, int cmdID, int outputType)
        {
            base.beginBuilder();
            base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0, 369298705);
            base.mBuilder.CgiCmd      = (uint)cmdID;
            base.mBuilder.OutPutType  = (uint)outputType;
            base.mBuilder.ReqText     = Util.packQueryQuest(queryDic, false);
            if ((innerDic != null) && (innerDic.Count > 0))
            {
                base.mBuilder.ReqTextWx = this.packQueryQuestWx(innerDic);
            }
            Log.i("NetSceneTenPay", string.Concat(new object[] { "tenpay request sent,  funid = ", this.mTenpayFunName, ", reqText.Len = ", base.mBuilder.ReqText.ILen }));
            base.mSessionPack.mCmdID = 0xb9;
            // base.mSessionPack.mConnectMode = 2;
            //base.mSessionPack.mCmdUri = "/cgi-bin/micromsg-bin/tenpay";

            base.endBuilder();
        }
Exemplo n.º 19
0
        //public bool doScene(SnsPostContext context)
        //{
        //    this.mPostContext = context;
        //    base.beginBuilder();
        //    base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0);
        //    Util.ByteArrayToString(context.localSnsObject.bytesObjectDesc);
        //    base.mBuilder.ObjectDesc = Util.toSKBuffer(context.localSnsObject.bytesObjectDesc);
        //    if (((context.localSnsObject.withList != null) && (context.localSnsObject.withList.list != null)) && (context.localSnsObject.withList.list.Count > 0))
        //    {
        //        base.mBuilder.WithUserListNum = (uint) context.localSnsObject.withList.list.Count;
        //        foreach (SnsComment comment in context.localSnsObject.withList.list)
        //        {
        //            base.mBuilder.WithUserListList.Add(Util.toSKString(comment.strUserName));
        //        }
        //    }
        //    base.mBuilder.Privacy = (uint) context.privacyFlag;
        //    base.mBuilder.SyncFlag = context.sync2WeiboFlag;
        //    if (context.mSnsTrans == null)
        //    {
        //        if (context.objectType != 2)
        //        {
        //            return false;
        //        }
        //        Log.d("NetSceneSnsPost", "context.objectType = " + context.objectType.ToString());
        //        base.mBuilder.ClientId = MD5Core.GetHashString(Util.nullAsNil(context.strContent) + Util.getNowMilliseconds());
        //    }
        //    else
        //    {
        //        base.mBuilder.ClientId = Util.nullAsNil(context.mSnsTrans.strClientID);
        //    }
        //    base.mBuilder.PostBGImgType = (uint) context.bgImgType;
        //    if ((context.localSnsObject.BlackList != null) && (context.localSnsObject.BlackList.list.Count > 0))
        //    {
        //        foreach (string str in context.localSnsObject.BlackList.list)
        //        {
        //            base.mBuilder.BlackListList.Add(Util.toSKString(str));
        //        }
        //        base.mBuilder.BlackListNum = (uint) context.localSnsObject.BlackList.list.Count;
        //    }
        //    if ((context.localSnsObject.GroupUserList != null) && (context.localSnsObject.GroupUserList.list.Count > 0))
        //    {
        //        foreach (string str2 in context.localSnsObject.GroupUserList.list)
        //        {
        //            base.mBuilder.GroupUserList.Add(Util.toSKString(str2));
        //        }
        //        base.mBuilder.GroupUserNum = (uint) context.localSnsObject.GroupUserList.list.Count;
        //    }
        //    base.mSessionPack.mCmdID = 0x61;
        //    base.endBuilder();
        //    context.mSnsObjectStatus = 2;
        //    return true;
        //}

        public bool doScene(SnsInfo snsObj)
        {
            if ((snsObj == null) || (snsObj.bytesObjectDesc == null))
            {
                return(false);
            }
            base.beginBuilder();
            base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0);
            //Util.ByteArrayToString(snsObj.bytesObjectDesc);
            base.mBuilder.ObjectDesc = Util.toSKBuffer(snsObj.bytesObjectDesc);
            if (((snsObj.withList != null) && (snsObj.withList.list != null)) && (snsObj.withList.list.Count > 0))
            {
                base.mBuilder.WithUserListNum = (uint)snsObj.withList.list.Count;
                foreach (SnsComment comment in snsObj.withList.list)
                {
                    base.mBuilder.WithUserListList.Add(Util.toSKString(comment.strUserName));
                }
            }
            base.mBuilder.Privacy       = 0;
            base.mBuilder.SyncFlag      = 0;
            base.mBuilder.ClientId      = MD5Core.GetHashString(Util.getNowMilliseconds() + snsObj.bytesObjectDesc.ToString());
            base.mBuilder.PostBGImgType = 1;
            if ((snsObj.BlackList != null) && (snsObj.BlackList.list.Count > 0))
            {
                foreach (string str in snsObj.BlackList.list)
                {
                    base.mBuilder.BlackListList.Add(Util.toSKString(str));
                }
                base.mBuilder.BlackListNum = (uint)snsObj.BlackList.list.Count;
            }
            if ((snsObj.GroupUserList != null) && (snsObj.GroupUserList.list.Count > 0))
            {
                foreach (string str2 in snsObj.GroupUserList.list)
                {
                    base.mBuilder.GroupUserList.Add(Util.toSKString(str2));
                }
                base.mBuilder.GroupUserNum = (uint)snsObj.GroupUserList.list.Count;
            }
            base.mSessionPack.mCmdID = 0x61;
            base.endBuilder();
            return(true);
        }
Exemplo n.º 20
0
 public bool doScene(string topic, List <string> memberList)
 {
     if (((memberList == null) || (memberList.Count == 0)) || string.IsNullOrEmpty(topic))
     {
         Log.d("NetSceneCreateChatRoom", "doScene,invalid input para");
         return(false);
     }
     Log.i("NetSceneCreateChatRoom", "doscene begin");
     base.beginBuilder();
     base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0x25);
     base.mBuilder.Topic       = Util.toSKString(topic);
     foreach (string str in memberList)
     {
         base.mBuilder.MemberListList.Add(MemberReq.CreateBuilder().SetMemberName(Util.toSKString(str)).Build());
     }
     base.mBuilder.MemberCount = (uint)memberList.Count;
     base.mSessionPack.mCmdID  = 0x25;
     base.endBuilder();
     return(true);
 }
Exemplo n.º 21
0
 public bool doScene(string chatroomName, List <string> usernameList)
 {
     Log.i("NSInviteChatRoomMember", "doscene begin");
     if (string.IsNullOrEmpty(chatroomName) || (usernameList == null))
     {
         return(false);
     }
     base.beginBuilder();
     base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0);
     base.mBuilder.SetChatRoomName(Util.toSKString(chatroomName));
     foreach (string str in usernameList)
     {
         base.mBuilder.MemberListList.Add(MemberReq.CreateBuilder().SetMemberName(Util.toSKString(str)).Build());
     }
     base.mBuilder.SetMemberCount((uint)usernameList.Count);
     base.mSessionPack.mCmdUri      = "/cgi-bin/micromsg-bin/invitechatroommember";
     base.mSessionPack.mConnectMode = 2;
     base.endBuilder();
     return(true);
 }
Exemplo n.º 22
0
        private bool doSceneBlock(MsgTrans voiceinfo)
        {
            Log.i("NetSceneDownloadVoice", string.Concat(new object[] { "NetSceneDownloadVoice do scene,download a msg block, endflag=", voiceinfo.nEndFlag, " svrMsgID=", voiceinfo.nMsgSvrID }));
            this.mVoiceContext.mStatus = 2;
            base.beginBuilder();
            base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(20);
            base.mBuilder.MsgId       = (uint)this.mVoiceContext.mMsgSvrID;
            base.mBuilder.Offset      = (uint)this.mVoiceContext.mOffset;
            voiceinfo.nTransDataLen   = this.mVoiceContext.mOffset;
            uint num = (uint)(voiceinfo.nTotalDataLen - voiceinfo.nTransDataLen);

            base.mBuilder.Length = (num > 0x10000) ? 0x10000 : num;
            if ((voiceinfo.strClientMsgId != null) && (voiceinfo.strClientMsgId.Length > 0))
            {
                base.mBuilder.ClientMsgId = voiceinfo.strClientMsgId;
            }
            base.mSessionPack.mCmdID = 20;
            base.endBuilder();
            return(true);
        }
Exemplo n.º 23
0
 public bool doScene(string userName, bool isFirstPage, ulong lastID, string PageMd5 = "")
 {
     base.beginBuilder();
     base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0);
     if (isFirstPage)
     {
         base.mBuilder.FirstPageMd5 = PageMd5;
         base.mBuilder.MaxId        = 0L;
     }
     else
     {
         base.mBuilder.FirstPageMd5 = PageMd5;
         base.mBuilder.MaxId        = lastID;
     }
     base.mBuilder.Username = userName;
     // base.mSessionPack.mConnectMode = 2;
     base.mSessionPack.mCmdID = 0x63;
     base.endBuilder();
     return(true);
 }
 public bool doScene(string chatRoomName, List <string> memberList)
 {
     if (((memberList == null) || (memberList.Count == 0)) || string.IsNullOrEmpty(chatRoomName))
     {
         Log.d("NetSceneDelChatRoomMember", "doScene,invalid input para");
         return(false);
     }
     Log.i("NetSceneDelChatRoomMember", "doscene begin");
     base.beginBuilder();
     base.mBuilder.BaseRequest  = NetSceneBase.makeBaseRequest(0);
     base.mBuilder.ChatRoomName = chatRoomName;
     foreach (string str in memberList)
     {
         base.mBuilder.MemberListList.Add(DelMemberReq.CreateBuilder().SetMemberName(Util.toSKString(str)).Build());
     }
     base.mBuilder.MemberCount      = (uint)memberList.Count;
     base.mSessionPack.mCmdUri      = "/cgi-bin/micromsg-bin/delchatroommember";
     base.mSessionPack.mConnectMode = 2;
     base.endBuilder();
     return(true);
 }
Exemplo n.º 25
0
 public bool doScene(string groupNickName, string groupUserName, List <Contact> contactList)
 {
     if (((contactList == null) || (contactList.Count == 0)) || (string.IsNullOrEmpty(groupNickName) || string.IsNullOrEmpty(groupUserName)))
     {
         Log.d("NetSceneGroupCard", "doScene,invalid input para");
         return(false);
     }
     base.beginBuilder();
     base.mBuilder.BaseRequest   = NetSceneBase.makeBaseRequest(0);
     base.mBuilder.OpCode        = 1;
     base.mBuilder.GroupNickName = groupNickName;
     base.mBuilder.GroupUserName = groupUserName;
     foreach (Contact contact in contactList)
     {
         base.mBuilder.MemberListList.Add(RoomInfo.CreateBuilder().SetUserName(Util.toSKString(contact.strUsrName)).SetNickName(Util.toSKString(contact.strNickName)).Build());
     }
     base.mBuilder.MemberCount      = (uint)contactList.Count;
     base.mSessionPack.mConnectMode = 2;
     base.mSessionPack.mCmdUri      = "/cgi-bin/micromsg-bin/addgroupcard";
     base.endBuilder();
     return(true);
 }
Exemplo n.º 26
0
        public void doSceneToCGI(string msgid, CImgMsgContext imgContext, string toUsername)
        {
            base.beginBuilder();
            base.mBuilder.BaseRequest    = NetSceneBase.makeBaseRequest(0);
            base.mBuilder.FromUserName   = Util.toSKString(AccountMgr.curUserName);
            base.mBuilder.ToUserName     = Util.toSKString(toUsername);
            base.mBuilder.ClientImgId    = Util.toSKString(msgid);
            base.mBuilder.MsgType        = 3;
            base.mBuilder.TotalLen       = (uint)imgContext.length;
            base.mBuilder.StartPos       = 0;
            base.mBuilder.DataLen        = (uint)imgContext.length;
            base.mBuilder.Data           = Util.toSKBuffer(new byte[0]);
            base.mBuilder.EncryVer       = 1;
            base.mBuilder.AESKey         = imgContext.aesKey;
            base.mBuilder.CDNThumbAESKey = imgContext.aesKey;

            base.mBuilder.CompressType  = 0;
            base.mBuilder.CDNBigImgSize = 0;
            base.mBuilder.CDNBigImgUrl  = "";

            if (imgContext.hdlength != 0)
            {
                base.mBuilder.CDNMidImgSize = imgContext.hdlength;
            }
            else
            {
                base.mBuilder.CDNMidImgSize = imgContext.length;
            }

            base.mBuilder.CDNMidImgUrl    = imgContext.midUrlKey;
            base.mBuilder.CDNThumbImgSize = imgContext.thumblength;
            base.mBuilder.CDNThumbImgUrl  = imgContext.thumbUrlKey;

            base.mBuilder.CDNThumbImgWidth  = imgContext.CDNThumbImgWidth;
            base.mBuilder.CDNThumbImgHeight = imgContext.CDNThumbImgHeight;
            base.mSessionPack.mCmdID        = 9;
            base.mSessionPack.mNeedCompress = false;
            base.endBuilder();
        }
Exemplo n.º 27
0
        protected override bool doDownScene()
        {
            DownloadVideoContext mContext = base.mContext as DownloadVideoContext;

            if (mContext == null)
            {
                return(false);
            }
            base.beginBuilder();
            base.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0);
            base.mBuilder.TotalLen    = (uint)mContext.mVideoInfo.nTotalDataLen;
            base.mBuilder.StartPos    = (uint)base.mOffsetPos;
            base.mBuilder.NetworkEnv  = 1;
            base.mBuilder.MsgId       = (uint)mContext.mVideoInfo.nMsgSvrID;
            base.mSessionPack.mCmdID  = 40;
            if (base.mUseHttp)
            {
                base.mSessionPack.mConnectMode = 2;
            }
            base.endBuilder();
            return(true);
        }
Exemplo n.º 28
0
 public bool getFirstPage(string userName, uint source, string strFirstPageMd5 = null)
 {
     base.beginBuilder();
     base.mBuilder.BaseRequest  = NetSceneBase.makeBaseRequest(0);
     base.mBuilder.MaxId        = 0L;
     base.mBuilder.FirstPageMd5 = (strFirstPageMd5 == null) ? "" : strFirstPageMd5;
     base.mBuilder.Username     = userName;
     if (source == 0x12)
     {
         base.mBuilder.Source = 0x12;
     }
     else if (this.isShakeSource(source))
     {
         base.mBuilder.Source = 0x16;
     }
     else
     {
         base.mBuilder.Source = 0;
     }
     base.mSessionPack.mCmdID = 0x63;
     base.endBuilder();
     return(true);
 }