コード例 #1
0
        //leave
        private void button11_Click(object sender, EventArgs e)
        {
            List <object> param    = new List <object>();
            string        paramstr = CommMeth.JsonSerialize <List <object> >(param);
            string        tl       = "&op=leave&param={" + string.Format("\"paramlist\":{0}", paramstr) + "}";
            string        aaa      = SSTest.Comm.Query.querygateway(si.ip, si.port.ToString(), sessionid, "op_rewardmatch", tl);

            richTextBox1.Text = aaa;
        }
コード例 #2
0
        /// <summary>
        /// 测试param
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button8_Click(object sender, EventArgs e)
        {
            //server_info si = SSTest.Comm.Query.SelectServer(loginresult, 0);

            List <object> param = new List <object>();

            param.Add(20000);
            param.Add(1);
            string paramstr = CommMeth.JsonSerialize <List <object> >(param);
            string tl       = "&op=test&param={" + string.Format("\"paramlist\":{0}", paramstr) + "}";

            string aaa = SSTest.Comm.Query.querygateway(si.ip, si.port.ToString(), sessionid, "op_bag", tl);

            richTextBox1.Text = aaa;
        }
コード例 #3
0
        //select
        private void button12_Click(object sender, EventArgs e)
        {
            List <object> param = new List <object>();
            int           level = 0;

            if (!string.IsNullOrWhiteSpace(textBox2.Text))
            {
                level = Convert.ToInt32(textBox2.Text);
            }
            param.Add(level);
            string paramstr = CommMeth.JsonSerialize <List <object> >(param);
            string tl       = "&op=select&param={" + string.Format("\"paramlist\":{0}", paramstr) + "}";
            string aaa      = SSTest.Comm.Query.querygateway(si.ip, si.port.ToString(), sessionid, "op_rewardmatch", tl);

            richTextBox1.Text = aaa;
        }
コード例 #4
0
        private void button4_Click(object sender, EventArgs e)
        {
            try
            {
                //server_info si = SSTest.Comm.Query.SelectServer(loginresult, 0);
                List <string> ls = new List <string>();
                ls.Add("backpack");

                //Typelist tl = new Typelist();
                //tl.type = new List<string>();
                //tl.type.Add("backpack");

                string tlist = CommMeth.JsonSerialize <List <string> >(ls);
                string tll   = "{" + string.Format("\"type\":{0}", tlist) + "}";
                string aaa   = SSTest.Comm.Query.getuserinfo(si.ip, si.port.ToString(), sessionid, tll);
                //string aaa = SSTest.Comm.Query.getuserinfo(si.ip, si.port.ToString(), sessionid, "{\"type\": [\"backpack\"]}");
                richTextBox1.Text = aaa;
                MUserInfo resultmodel = CommMeth.JsonDeserialize <MUserInfo>(aaa);
            }
            catch (Exception ex)
            {
            }
        }
コード例 #5
0
        private void button17_Click(object sender, EventArgs e)
        {
            List <object> param = new List <object>();
            //param.Add(0);//1.win,0.lose
            string paramstr = CommMeth.JsonSerialize <List <object> >(param);
            string tl       = "&op=get_info&param={" + string.Format("\"paramlist\":{0}", paramstr) + "}";
            string aaa      = SSTest.Comm.Query.querygateway(si.ip, si.port.ToString(), sessionid, "op_ladder", tl);

            aaa = CommMeth.FormatJsonStr(aaa);
            MBaseProtobuf resultmodel = CommMeth.JsonDeserialize <MBaseProtobuf>(aaa);

            MemoryStream stream = new MemoryStream();
            StreamWriter writer = new StreamWriter(stream);

            writer.Write(resultmodel.data);
            writer.Flush();

            var model = TypeModel.Create();

            stream.Position = 0;
            F_T_CurTime fct = (F_T_CurTime)model.Deserialize(stream, null, typeof(F_T_CurTime));

            richTextBox1.Text = aaa + " time:" + fct.time;
        }