//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¶m={" + string.Format("\"paramlist\":{0}", paramstr) + "}"; string aaa = SSTest.Comm.Query.querygateway(si.ip, si.port.ToString(), sessionid, "op_rewardmatch", tl); richTextBox1.Text = aaa; }
/// <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¶m={" + string.Format("\"paramlist\":{0}", paramstr) + "}"; string aaa = SSTest.Comm.Query.querygateway(si.ip, si.port.ToString(), sessionid, "op_bag", tl); richTextBox1.Text = aaa; }
//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¶m={" + string.Format("\"paramlist\":{0}", paramstr) + "}"; string aaa = SSTest.Comm.Query.querygateway(si.ip, si.port.ToString(), sessionid, "op_rewardmatch", tl); richTextBox1.Text = aaa; }
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) { } }
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¶m={" + 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; }