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());
        }