Esempio n. 1
0
        internal static OplogRequest CreateExitChatroomRequestEntity(int cmdid, string chatroom, string self)
        {
            ExitChatroomObject.Builder rb = new ExitChatroomObject.Builder();
            rb.SetChatroom(new SKBuiltinString_t.Builder().SetString(chatroom));
            rb.SetUserName(new SKBuiltinString_t.Builder().SetString(self));
            byte[] byteUp = rb.Build().ToByteArray();

            SKBuiltinBuffer_t.Builder skbb = new SKBuiltinBuffer_t.Builder();
            skbb.SetBuffer(ByteString.CopyFrom(byteUp));
            skbb.SetILen(byteUp.Length);
            SKBuiltinBuffer_t skbObj = skbb.Build();

            CmdItem.Builder cib = new CmdItem.Builder();
            cib.SetCmdBuf(skbObj);
            cib.SetCmdId(cmdid);
            CmdItem ciObj = cib.Build();

            CmdList.Builder clb = new CmdList.Builder();
            clb.SetCount(1);
            clb.AddList(ciObj);

            CmdList clObj = clb.Build();

            OplogRequest.Builder nsrb = new OplogRequest.Builder();
            nsrb.SetOplog(clObj);

            return(nsrb.Build());
        }
Esempio n. 2
0
        internal static OplogRequest CreateExitChatroomRequestEntity(int cmdid, string chatroom, string self)
        {
            ExitChatroomObject.Builder builder = new ExitChatroomObject.Builder();
            builder.SetChatroom(new SKBuiltinString_t.Builder().SetString(chatroom));
            builder.SetUserName(new SKBuiltinString_t.Builder().SetString(self));
            byte[] array = builder.Build().ToByteArray();
            SKBuiltinBuffer_t.Builder builder2 = new SKBuiltinBuffer_t.Builder();
            builder2.SetBuffer(ByteString.CopyFrom(array));
            builder2.SetILen(array.Length);
            SKBuiltinBuffer_t cmdBuf = builder2.Build();

            CmdItem.Builder builder3 = new CmdItem.Builder();
            builder3.SetCmdBuf(cmdBuf);
            builder3.SetCmdId(cmdid);
            CmdItem value = builder3.Build();

            CmdList.Builder builder4 = new CmdList.Builder();
            builder4.SetCount(1);
            builder4.AddList(value);
            CmdList oplog = builder4.Build();

            OplogRequest.Builder builder5 = new OplogRequest.Builder();
            builder5.SetOplog(oplog);
            return(builder5.Build());
        }
Esempio n. 3
0
        internal static OplogRequest CreateOpSetCheckRequestEntity(int cmdid, int key, int value)
        {
            KeyValPair.Builder rb = new KeyValPair.Builder();
            rb.SetKey(key);
            rb.SetVal(value);
            byte[] byteUp = rb.Build().ToByteArray();

            SKBuiltinBuffer_t.Builder skbb = new SKBuiltinBuffer_t.Builder();
            skbb.SetBuffer(ByteString.CopyFrom(byteUp));
            skbb.SetILen(byteUp.Length);
            SKBuiltinBuffer_t skbObj = skbb.Build();

            CmdItem.Builder cib = new CmdItem.Builder();
            cib.SetCmdBuf(skbObj);
            cib.SetCmdId(cmdid);
            CmdItem ciObj = cib.Build();

            CmdList.Builder clb = new CmdList.Builder();
            clb.SetCount(1);
            clb.AddList(ciObj);

            CmdList clObj = clb.Build();

            OplogRequest.Builder nsrb = new OplogRequest.Builder();
            nsrb.SetOplog(clObj);

            return(nsrb.Build());
        }
Esempio n. 4
0
        internal static OplogRequest CreateOpSetCheckRequestEntity(int cmdid, int key, int value)
        {
            KeyValPair.Builder builder = new KeyValPair.Builder();
            builder.SetKey(key);
            builder.SetVal(value);
            byte[] array = builder.Build().ToByteArray();
            SKBuiltinBuffer_t.Builder builder2 = new SKBuiltinBuffer_t.Builder();
            builder2.SetBuffer(ByteString.CopyFrom(array));
            builder2.SetILen(array.Length);
            SKBuiltinBuffer_t cmdBuf = builder2.Build();

            CmdItem.Builder builder3 = new CmdItem.Builder();
            builder3.SetCmdBuf(cmdBuf);
            builder3.SetCmdId(cmdid);
            CmdItem value2 = builder3.Build();

            CmdList.Builder builder4 = new CmdList.Builder();
            builder4.SetCount(1);
            builder4.AddList(value2);
            CmdList oplog = builder4.Build();

            OplogRequest.Builder builder5 = new OplogRequest.Builder();
            builder5.SetOplog(oplog);
            return(builder5.Build());
        }
Esempio n. 5
0
        public static NewSyncRequest ModifyProfile(string nickName, byte[] keyBuffer)
        {
            UserProfile.Builder upb = new UserProfile.Builder();
            upb.SetBitFlag(2);
            upb.SetUserName(new SKBuiltinString_t.Builder().SetString(""));
            upb.SetNickName(new SKBuiltinString_t.Builder().SetString(nickName));
            upb.SetBindUin(0);
            upb.SetBindEmail(new SKBuiltinString_t.Builder().SetString(""));
            upb.SetBindMobile(new SKBuiltinString_t.Builder().SetString(""));
            upb.SetStatus(0);
            upb.SetImgLen(0);
            upb.SetImgBuf(Google.ProtocolBuffers.ByteString.CopyFrom("", Encoding.Default));

            upb.SetSex(0);
            upb.SetProvince("");
            upb.SetCity("");
            upb.SetSignature("");

            upb.SetPersonalCard(1);
            upb.SetPluginFlag(0);
            upb.SetPluginSwitch(0);
            upb.SetAlias("");
            upb.SetWeiboNickname("");
            upb.SetWeiboFlag(0);
            upb.SetCountry("CN");

            UserProfile upObj = upb.Build();

            byte[] byteUp = upObj.ToByteArray();

            SKBuiltinBuffer_t.Builder skbb = new SKBuiltinBuffer_t.Builder();
            skbb.SetBuffer(ByteString.CopyFrom(byteUp));
            skbb.SetILen(byteUp.Length);
            SKBuiltinBuffer_t skbObj = skbb.Build();

            CmdItem.Builder cib = new CmdItem.Builder();
            cib.SetCmdBuf(skbObj);
            cib.SetCmdId(1);
            CmdItem ciObj = cib.Build();

            CmdList.Builder clb = new CmdList.Builder();
            clb.SetCount(1);
            clb.AddList(ciObj);

            CmdList clObj = clb.Build();

            NewSyncRequest.Builder nsrb = new NewSyncRequest.Builder();
            nsrb.SetOplog(clObj);
            nsrb.SetSelector(7);
            nsrb.SetScene(7);
            SKBuiltinBuffer_t.Builder skb = new SKBuiltinBuffer_t.Builder();
            skb.SetBuffer(ByteString.CopyFrom(keyBuffer));
            skb.SetILen(keyBuffer.Length);
            nsrb.SetKeyBuf(skb.Build());

            return(nsrb.Build());
        }
Esempio n. 6
0
        public static NewSyncRequest ModifyProfile(string nickName, byte[] keyBuffer)
        {
            UserProfile.Builder builder = new UserProfile.Builder();
            builder.SetBitFlag(2u);
            builder.SetUserName(new SKBuiltinString_t.Builder().SetString(""));
            builder.SetNickName(new SKBuiltinString_t.Builder().SetString(nickName));
            builder.SetBindUin(0u);
            builder.SetBindEmail(new SKBuiltinString_t.Builder().SetString(""));
            builder.SetBindMobile(new SKBuiltinString_t.Builder().SetString(""));
            builder.SetStatus(0);
            builder.SetImgLen(0);
            builder.SetImgBuf(ByteString.CopyFrom("", Encoding.Default));
            builder.SetSex(0);
            builder.SetProvince("");
            builder.SetCity("");
            builder.SetSignature("");
            builder.SetPersonalCard(1);
            builder.SetPluginFlag(0);
            builder.SetPluginSwitch(0);
            builder.SetAlias("");
            builder.SetWeiboNickname("");
            builder.SetWeiboFlag(0);
            builder.SetCountry("CN");
            UserProfile userProfile = builder.Build();

            byte[] array = userProfile.ToByteArray();
            SKBuiltinBuffer_t.Builder builder2 = new SKBuiltinBuffer_t.Builder();
            builder2.SetBuffer(ByteString.CopyFrom(array));
            builder2.SetILen(array.Length);
            SKBuiltinBuffer_t cmdBuf = builder2.Build();

            CmdItem.Builder builder3 = new CmdItem.Builder();
            builder3.SetCmdBuf(cmdBuf);
            builder3.SetCmdId(1);
            CmdItem value = builder3.Build();

            CmdList.Builder builder4 = new CmdList.Builder();
            builder4.SetCount(1);
            builder4.AddList(value);
            CmdList oplog = builder4.Build();

            NewSyncRequest.Builder builder5 = new NewSyncRequest.Builder();
            builder5.SetOplog(oplog);
            builder5.SetSelector(7);
            builder5.SetScene(7);
            SKBuiltinBuffer_t.Builder builder6 = new SKBuiltinBuffer_t.Builder();
            builder6.SetBuffer(ByteString.CopyFrom(keyBuffer));
            builder6.SetILen(keyBuffer.Length);
            builder5.SetKeyBuf(builder6.Build());
            return(builder5.Build());
        }
Esempio n. 7
0
 public static NewSyncRequest CreateNewSyncRequestEntity(byte[] keyBuffer)
 {
     NewSyncRequest.Builder builder  = new NewSyncRequest.Builder();
     CmdList.Builder        builder2 = new CmdList.Builder();
     builder2.SetCount(0);
     builder.SetOplog(builder2.Build());
     builder.SetSelector(3);
     builder.SetScene(7);
     SKBuiltinBuffer_t.Builder builder3 = new SKBuiltinBuffer_t.Builder();
     builder3.SetBuffer(ByteString.CopyFrom(keyBuffer));
     builder3.SetILen(keyBuffer.Length);
     builder.SetKeyBuf(builder3.Build());
     builder.SetDeviceType("Android设备");
     builder.SetSyncMsgDigest(1u);
     return(builder.Build());
 }
Esempio n. 8
0
        public static NewSyncRequest CreateNewSyncRequestEntity(byte[] keyBuffer)
        {
            NewSyncRequest.Builder nsrb = new NewSyncRequest.Builder();
            CmdList.Builder        clb  = new CmdList.Builder();
            clb.SetCount(0);
            nsrb.SetOplog(clb.Build());
            nsrb.SetSelector(3);
            nsrb.SetScene(7);
            SKBuiltinBuffer_t.Builder skb = new SKBuiltinBuffer_t.Builder();
            skb.SetBuffer(ByteString.CopyFrom(keyBuffer));
            skb.SetILen(keyBuffer.Length);
            nsrb.SetKeyBuf(skb.Build());
            nsrb.SetDeviceType("Android设备");
            nsrb.SetSyncMsgDigest(1);

            NewSyncRequest nsr = nsrb.Build();

            return(nsr);
        }