Exemplo n.º 1
0
        public bool FinishOperation(int operationid)
        {
            //{\"operation_id\":5}
            string outdatacode = "";

            outdatacode = "{\"operation_id\":" + operationid.ToString() + "}";
            outdatacode = AuthCode.Encode(outdatacode, ProgrameData.sign);
            string requeststring = String.Format("uid={0}&outdatacode={1}&req_id={2}", ProgrameData.uid, System.Web.HttpUtility.UrlEncode(outdatacode), ProgrameData.req_id++.ToString());
            int    count         = 0;

            while (true)
            {
                string result = DoPost(ProgrameData.GameAdd + RequestUrls.FinishOperation, requeststring);//不需要解密
                if (ResultPro.Result_Pro(ref result, "Finish_Operation_Pro", true) == 1)
                {
                    return(true);
                }
                if (ResultPro.Result_Pro(ref result, "Finish_Operation_Pro", true) == 0)
                {
                    ACTION.result_error_PRO(result, count++); continue;
                }
                if (ResultPro.Result_Pro(ref result, "Finish_Operation_Pro", true) == -1)
                {
                    return(false); /*特殊处理我还没想好*/;
                }
            }
        }
Exemplo n.º 2
0
        public string Index_version()//这个API发的是当前时间戳?
        {
            IDictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("", "");
            try
            {
                ProgrameData.req_id = CommonHelp.ConvertDateTime_China_Int(DateTime.Now);
                parameters.Add("req_id", ProgrameData.req_id.ToString());
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
            }


            string data   = StringBuilder_(parameters);
            string result = "";

            while (true)
            {
                result = DoPost(ProgrameData.GameAdd + RequestUrls.Index_version, data.ToString());//明码不需要解密
                if (ResultPro.Result_Pro(ref result, "Index_version", false) == 1)
                {
                    var jsonobj = DynamicJson.Parse(result); //讲道理,我真不想写了
                    GameData.loginTime            = Convert.ToInt32(jsonobj.now);
                    ProgrameData.CatchDataVersion = jsonobj.data_version.ToString();
                    ProgrameData.tomorrow_zero    = Convert.ToInt32(jsonobj.tomorrow_zero);
                    ProgrameData.weekday          = Convert.ToInt32(jsonobj.weekday);
                    return(ProgrameData.CatchDataVersion);
                }
                if (ResultPro.Result_Pro(ref result, "Index_version", false) == 0)
                {
                    continue;
                }
                if (ResultPro.Result_Pro(ref result, "Index_version", false) == -1)
                {
                    continue; /*特殊处理我还没想好*/;
                }
            }
        }
Exemplo n.º 3
0
        public static void Gun_IN_post(int team_id, int gun_with_user_id, int location)
        {
            dynamic newjson = new DynamicJson();

            newjson.team_id /*这是节点*/          = team_id;          /* 这是值*/
            newjson.gun_with_user_id /*这是节点*/ = gun_with_user_id; /* 这是值*/
            newjson.location /*这是节点*/         = location;         /* 这是值*/

            int count = 0;

            while (true)
            {
                string result = POST.GUN_OUTandIN_Team(newjson.ToString());

                switch (ResultPro.Result_Pro(ref result, "GUN_OUTandIN_Team_PRO", false))
                {
                case 1:
                {
                    return;
                }

                case 0:
                {
                    continue;
                }

                case -1:
                {
                    count++;
                    if (count == 2)
                    {
                        return;
                    }
                    break;
                }

                default:
                    break;
                }
            }
        }
Exemplo n.º 4
0
        public bool LoginFirstUrl()
        {
            ////---------LoginFirstUrl = LoginFirstUrl = "http://gf.ppgame.com/interfaces"; (获取access_token 和 openid) start------------------
            //IDictionary<string, string> parameters = new Dictionary<string, string>();
            //parameters.Add("method", "findByEn");
            //parameters.Add("ifs_en", "account_login");
            //parameters.Add("login_identify", ProgrameData.accountid);
            //parameters.Add("login_pwd", ProgrameData.password);
            //parameters.Add("app_id", "00020000100021001");
            //parameters.Add("encrypt_mode", "md5");
            //parameters.Add("sign", "");
            //parameters.Add("client_ip", ProgrameData.client_ip);

            //string data = StringBuilder_(parameters);

            string result = "";

            while (true)
            {
                result = Login.Login.normalLogin(ProgrameData.accountid, Login.md5.EncryptWithMD5(ProgrameData.password));

                if (ResultPro.Result_Pro(ref result, "LoginFirstUrl", false) == 1)
                {
                    var jsonobj = DynamicJson.Parse(result); //讲道理,我真不想写了
                    ProgrameData.access_token = jsonobj.access_token.ToString();
                    ProgrameData.openid       = jsonobj.openid.ToString();
                    return(true);
                }
                if (ResultPro.Result_Pro(ref result, "LoginFirstUrl", false) == 0)
                {
                    MessageBox.Show(result.ToString()); continue;
                }
                if (ResultPro.Result_Pro(ref result, "LoginFirstUrl", false) == -1)
                {
                    continue; /*特殊处理我还没想好*/;
                }
            }
        }
Exemplo n.º 5
0
        public bool Auto_Start_Trial()
        {
            if (im.action.CheckTeamIsEmpty(ProgrameData.AutoDefenseTrialBattleT))
            {
                return(false);
            }
            if (ProgrameData.AutoSimulationBattleF == false)
            {
                return(true);
            }
            im.uihelp.setStatusBarText_InThread(String.Format(" BP点数 高于5 开始无限防御模式"));

            int count = 0;

            while (true)
            {
                string result = im.post.StartTrial(ProgrameData.AutoDefenseTrialBattleT.ToString());


                switch (ResultPro.Result_Pro(ref result, "StartTrial_Pro", true))
                {
                case 1:
                {
                    goto a;
                }

                case 0:
                {
                    ACTION.result_error_PRO(result, count++); continue;
                }

                case -1:
                {
                    if (count >= ProgrameData.BL_Error_num)
                    {
                        return(false);
                    }
                    ACTION.result_error_PRO(result, count++); continue;
                }

                default:
                    break;
                }
            }

            a : im.uihelp.setStatusBarText_InThread(String.Format(" 结束防御模式"));
            Thread.Sleep(5000);

            //序列化
            Random random = new Random();



            TrialExercise_Battle_Sent tbs = new TrialExercise_Battle_Sent(UserData.UserDataSummery.team_info[ProgrameData.AutoDefenseTrialBattleT]);

            string outdatacode = tbs.BattleResult;



            count = 0;
            while (true)
            {
                string result = im.post.EndTrial(outdatacode);

                switch (ResultPro.Result_Pro(ref result, "EndTrial_Pro", true))
                {
                case 1:
                {
                    return(true);
                }

                case 0:
                {
                    ACTION.result_error_PRO(result, count++); continue;
                }

                case -1:
                {
                    if (count >= ProgrameData.BL_Error_num)
                    {
                        return(false);
                    }
                    ACTION.result_error_PRO(result, count++); continue;
                }

                default:
                    break;
                }
            }
        }
Exemplo n.º 6
0
        public void Friend_Praise()
        {
            int f_userid;

            for (int i = 0; i < 50; i++)
            {
                while (true)
                {
                    int           count      = 0;
                    StringBuilder sb         = new StringBuilder();
                    JsonWriter    jsonWriter = new JsonWriter(sb);
                    jsonWriter.WriteObjectStart();
                    jsonWriter.WritePropertyName("f_userid");
                    jsonWriter.Write(0);
                    jsonWriter.WriteObjectEnd();
                    Thread.Sleep(1500);

                    string result = im.post.Friend_visit(sb.ToString());
                    if (ResultPro.Result_Pro(ref result, "Friend_visit", true) == 1)
                    {
                        var jsonobj = DynamicJson.Parse(result);
                        f_userid = Convert.ToInt32(jsonobj.info.f_userid);
                        im.uihelp.setStatusBarText_InThread(String.Format(" 访问 f_userid = {0} 当前次数 {1}", f_userid, i + 1));
                        break;
                    }
                    if (ResultPro.Result_Pro(ref result, "Friend_visit", true) == 0)
                    {
                        ACTION.result_error_PRO(result, count++); continue;
                    }
                    if (ResultPro.Result_Pro(ref result, "Friend_visit", true) == -1)
                    {
                        ACTION.result_error_PRO(result, count++); continue; /*特殊处理我还没想好*/;
                    }
                }

                while (true)
                {
                    int           count      = 0;
                    StringBuilder sb         = new StringBuilder();
                    JsonWriter    jsonWriter = new JsonWriter(sb);
                    jsonWriter.WriteObjectStart();
                    jsonWriter.WritePropertyName("f_userid");
                    jsonWriter.Write(f_userid);
                    jsonWriter.WriteObjectEnd();
                    Thread.Sleep(1500);
                    im.uihelp.setStatusBarText_InThread(String.Format(" 点赞 f_userid = {0},当前次数 {1}", f_userid, i + 1));
                    string result = im.post.Friend_praise(sb.ToString());
                    if (ResultPro.Result_Pro(ref result, "Friend_praise", true) == 1)
                    {
                        break;
                    }
                    if (ResultPro.Result_Pro(ref result, "Friend_praise", true) == 0)
                    {
                        ACTION.result_error_PRO(result, count++); continue;
                    }
                    if (ResultPro.Result_Pro(ref result, "Friend_praise", true) == -1)
                    {
                        ACTION.result_error_PRO(result, count++); break; /*特殊处理我还没想好*/;
                    }
                }
            }
        }