Exemple #1
0
        public static ThrowBottleRequest CreateThrowBottleRequestEntity(string sessionKey, uint uin, string deviceID, string OSType, string text)
        {
            BaseRequest @base = CreateBaseRequestEntity(deviceID, sessionKey, uin, OSType);

            ThrowBottleRequest.Builder builder = new ThrowBottleRequest.Builder();
            builder.SetBase(@base);
            builder.SetMsgType(1);
            builder.SetBottleType(0);
            SKBuiltinBuffer_t.Builder builder2 = new SKBuiltinBuffer_t.Builder();
            byte[] bytes = Encoding.GetEncoding("utf-8").GetBytes(text);
            builder2.SetILen(bytes.Length);
            builder2.SetBuffer(ByteString.CopyFrom(bytes));
            builder.SetContent(builder2.Build());
            builder.SetStartPos(0);
            builder.SetTotalLen(bytes.Length);
            builder.SetClientID(string.Format("127c322ff65c763{0}", new Random().Next(10000, 99999)));
            builder.SetVoiceLength(0);
            return(builder.Build());
        }
Exemple #2
0
        public static ThrowBottleRequest CreateThrowBottleRequestEntity(string sessionKey, uint uin, string deviceID, string OSType, string text)
        {
            BaseRequest br = CreateBaseRequestEntity(deviceID, sessionKey, uin, OSType);

            ThrowBottleRequest.Builder lrb = new ThrowBottleRequest.Builder();
            lrb.SetBase(br);
            lrb.SetMsgType(1);
            lrb.SetBottleType(0);

            SKBuiltinBuffer_t.Builder skb = new SKBuiltinBuffer_t.Builder();
            byte[] data = System.Text.Encoding.GetEncoding("utf-8").GetBytes(text);
            skb.SetILen(data.Length);
            skb.SetBuffer(ByteString.CopyFrom(data));
            lrb.SetContent(skb.Build());
            lrb.SetStartPos(0);
            lrb.SetTotalLen(data.Length);
            lrb.SetClientID(string.Format("127c322ff65c763{0}", new Random().Next(10000, 99999)));
            lrb.SetVoiceLength(0);

            return(lrb.Build());
        }