public int Receive_Favor_Girls_IN_Dorm(int dorm_id, int gun_with_user_id) { string outdatacode = "{\"dorm_id\":" + dorm_id.ToString() + "," + "\"gun_with_user_id\":" + gun_with_user_id.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()); string result = ""; while (string.IsNullOrEmpty(result) == true) { result = DoPost(ProgrameData.GameAdd + RequestUrls.Dorm_Receive_Favor, requeststring); } //var jsonobj = DynamicJson.Parse(AuthCode.Decode(result, ProgrameData.sign)); var jsonobj = DynamicJson.Parse(CommonHelp.DecodeAndMapJson(result)); try { return(Convert.ToInt32(jsonobj.favor_click.ToString())); } catch (Exception e) { MessageBox.Show("少女好感度上升出错"); MessageBox.Show(e.ToString()); return(-1); } }
public string GetMailList() { var obj = new { startid = 0, ignore_time = 1, }; string outdatacode = DynamicJson.Serialize(obj); 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()); string result = ""; while (string.IsNullOrEmpty(result) == true) { result = DoPost(ProgrameData.GameAdd + RequestUrls.GetMailList, requeststring); //result = AuthCode.Decode(result, ProgrameData.sign); result = CommonHelp.DecodeAndMapJson(result); } return(result);//未json化 }
public int Get_Friend_BattaryNum(int f_userid) { System.Threading.Thread.Sleep(5000); string outdatacode = "{\"f_userid\":" + f_userid.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()); string result = ""; while (string.IsNullOrEmpty(result) == true) { result = DoPost(ProgrameData.GameAdd + RequestUrls.Visit_Friend_Build, requeststring); } //var jsonobj = DynamicJson.Parse(AuthCode.Decode(result, ProgrameData.sign)); //result = CommonHelp.DecodeAndMapJson(result); var jsonobj = DynamicJson.Parse(CommonHelp.DecodeAndMapJson(result)); try { return(Convert.ToInt32(jsonobj.build_coin_flag.ToString())); } catch (Exception e) { //MessageBox.Show("查看好友电池出错"); //MessageBox.Show(e.ToString()); return(-1); } }
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); /*特殊处理我还没想好*/; } } }
/// <summary> /// 인형 장비 착용/해제 /// </summary> /// <param name="ifOutfit">착용여부 (true:장착, false:해제)</param> /// <param name="gunWithUserId">인형 고유 ID</param> /// <param name="equipWithUserId">장비 고유 ID</param> /// <param name="equipSlot">장비 슬롯 (1,2,3)</param> /// <returns></returns> public static bool RequestGunEquip(bool ifOutfit, long gunWithUserId, long equipWithUserId, int equipSlot) { // http://gf-game.girlfrontline.co.kr/index.php/1001/Equip/gunEquip // ?uid=343650 // &outdatacode=o6RZPEsSTaO1yaetN2%2f%2bOGJwZ7983k0ZOGGXkfnCDColt8B0pAz7vlORDkPABVMcXDlZD6JShAPfIhdR5hcu7XpDErwY8%2bD0dUxJP2uc%2fVoevJv%2bqkZXGisWb%2f8j5sGl4vPJKKD9PJN7EJDI3xeZj0Tl // &req_id=156268781500033 // {"if_outfit":1,"gun_with_user_id":345595000,"equip_with_user_id":15370720,"equip_slot":1} // {"if_outfit":0,"gun_with_user_id":345595000,"equip_with_user_id":15370720,"equip_slot":1} JObject json = new JObject(); json.Add("if_outfit", ifOutfit == true ? 1 : 0); json.Add("gun_with_user_id", gunWithUserId); json.Add("equip_with_user_id", equipWithUserId); json.Add("equip_slot", equipSlot); string gunName = ""; string equipName = ""; //string gunName = GameData.GetDollData(UserData.Doll.dictionary[gunWithUserId].gunId, "name"); //string equipName = GameData.GetEquipData(UserData.Equip.dictionary[equipWithUserId].equipId, "name"); log.Info("인형 {0} {1} 슬롯 장비 {2} {3}", gunName, equipSlot, equipName, ifOutfit == true ? "장착" : "해제"); string jsonString = json.ToString(Newtonsoft.Json.Formatting.None); string outdatacode = AuthCode.Encode(jsonString, UserData.sign); string requestString = String.Format("uid={0}&outdatacode={1}&req_id={2}", UserData.userId, HttpUtility.UrlEncode(outdatacode), ++UserData.req_id); string responseString = DoPost(UserData.gameHost + "Equip/gunEquip", requestString); return(true); }
public string GetRecoverBP() { string outdatacode = AuthCode.Encode(ProgrameData.sign, ProgrameData.sign);//用自身作为密匙把自身加密 string requeststring = String.Format("uid={0}&signcode={1}&req_id={2}", ProgrameData.uid, System.Web.HttpUtility.UrlEncode(outdatacode), ProgrameData.req_id++.ToString()); string result = DoPost(ProgrameData.GameAdd + RequestUrls.RecoverBp, requeststring); return(result); }
public static string endOtherSideTurn() { string outdatacode = AuthCode.Encode(ProgrameData.sign, ProgrameData.sign); string requeststring = String.Format("uid={0}&signcode={1}&req_id={2}", ProgrameData.uid, System.Web.HttpUtility.UrlEncode(outdatacode), ProgrameData.req_id++.ToString()); string result = DoPost(ProgrameData.GameAdd + RequestUrls.endOtherSideTurn, requeststring); return(result); }
public static string saveHostage(string outdatacode) { 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()); string result = DoPost(ProgrameData.GameAdd + RequestUrls.saveHostage, requeststring); return(result); }
public string Click_Get_Material() { string outdatacode = AuthCode.Encode(ProgrameData.sign, ProgrameData.sign);//用自身作为密匙把自身加密 string requeststring = String.Format("uid={0}&signcode={1}&req_id={2}", ProgrameData.uid, System.Web.HttpUtility.UrlEncode(outdatacode), ProgrameData.req_id++.ToString()); string result = ""; while (string.IsNullOrEmpty(result) == true) { result = DoPost(ProgrameData.GameAdd + RequestUrls.ClickKalina, requeststring); } return(result); }
public string Get_Build_Coin(string v_user_id, string dorm_id) { //{"v_user_id":"54634","dorm_id":1} string outdatacode = "{\"v_user_id\":" + "\"" + v_user_id + "\"" + "," + "\"dorm_id\":" + dorm_id + "}"; 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()); string result = DoPost(ProgrameData.GameAdd + RequestUrls.Get_Friend_Build_Coin, requeststring); return(result); }
public string GetUserInfo()//api = index/index { string outdatacode = AuthCode.Encode("{\"time\":" + CommonHelp.ConvertDateTime_China_Int(DateTime.Now).ToString() + "}", ProgrameData.sign); string requeststring = String.Format("uid={0}&outdatacode={1}&req_id={2}", ProgrameData.uid, System.Web.HttpUtility.UrlEncode(outdatacode), ProgrameData.req_id++.ToString()); string result = ""; while (string.IsNullOrEmpty(result) == true) { result = DoPost(ProgrameData.GameAdd + RequestUrls.GetUserInfo, requeststring); } return(result); }
public string attendance()//api = index/index { string outdatacode = AuthCode.Encode(ProgrameData.sign, ProgrameData.sign); string requeststring = String.Format("uid={0}&signcode={1}&req_id={2}", ProgrameData.uid, System.Web.HttpUtility.UrlEncode(outdatacode), ProgrameData.req_id++.ToString()); string result = ""; while (string.IsNullOrEmpty(result) == true) { result = DoPost(ProgrameData.GameAdd + RequestUrls.GetAttendance, requeststring);//不需要解密 返回的是签到当月信息奖励 //var jsonobj = DynamicJson.Parse(AuthCode.Decode(result, ProgrameData.sign)); } return(result); }
public string StartTrial(string teamids) { string outdatacode = ""; outdatacode = "{\"team_ids\":" + "\"" + teamids.ToString() + "\"" + "," + "\"battle_team\":" + teamids.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()); string result = DoPost(ProgrameData.GameAdd + RequestUrls.StartTrial, requeststring); return(result); }
public string ifNewMail() { string outdatacode = AuthCode.Encode(ProgrameData.sign, ProgrameData.sign);//用自身作为密匙把自身加密 string requeststring = String.Format("uid={0}&signcode={1}&req_id={2}", ProgrameData.uid, System.Web.HttpUtility.UrlEncode(outdatacode), ProgrameData.req_id++.ToString()); string result = ""; while (string.IsNullOrEmpty(result) == true) { result = DoPost(ProgrameData.GameAdd + RequestUrls.CheckNewMail, requeststring); //result = AuthCode.Decode(result, ProgrameData.sign); result = CommonHelp.DecodeAndMapJson(result); } return(result); }
public string GetOneMail_Type2(int mailwith_user_id) { string outdatacode = "{\"mailwith_user_id\":" + mailwith_user_id.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()); string result = ""; result = DoPost(ProgrameData.GameAdd + RequestUrls.GetOneMail, requeststring); //result = AuthCode.Decode(result, ProgrameData.sign); return(result); }
public string RecoverResource() //恢复资源 { string outdatacode = AuthCode.Encode(ProgrameData.sign, ProgrameData.sign); //用自身作为密匙把自身加密 string requeststring = String.Format("uid={0}&signcode={1}&req_id={2}", ProgrameData.uid, System.Web.HttpUtility.UrlEncode(outdatacode), ProgrameData.req_id++.ToString()); string result = ""; while (string.IsNullOrEmpty(result) == true) { result = DoPost(ProgrameData.GameAdd + RequestUrls.RecoverResource, requeststring); //var jsonobj = DynamicJson.Parse(AuthCode.Decode(result, ProgrameData.sign)); var jsonobj = DynamicJson.Parse(CommonHelp.DecodeAndMapJson(result)); } return(result); }
public string GetOneMail_Type1(int mailwith_user_id) { System.Threading.Thread.Sleep(2500); string outdatacode = "{\"mail_with_user_id\":" + mailwith_user_id.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()); string result = ""; while (string.IsNullOrEmpty(result) == true) { result = DoPost(ProgrameData.GameAdd + RequestUrls.GetOneMail, requeststring); } return(result); }
public string GetMailResource_Type2(int mailwith_user_id) { string outdatacode = "{\"mailwith_user_id\":" + mailwith_user_id.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()); string result = ""; while (string.IsNullOrEmpty(result) == true) { result = DoPost(ProgrameData.GameAdd + RequestUrls.GetMailResource, requeststring); } //result = AuthCode.Decode(result, ProgrameData.sign); result = CommonHelp.DecodeAndMapJson(result); return(result); }
//"{\"item_id\":\"\",\"big_success\":0}" public string AbortOperation(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()); string result = ""; while (string.IsNullOrEmpty(result) == true) { result = DoPost(ProgrameData.GameAdd + RequestUrls.AbortOperation, requeststring);//不需要解密 } return(result); //"{\"item_id\":\"\",\"big_success\":0}" }
public bool Get_Friend_Battary(int v_user_id, int dorm_id, int num) { System.Threading.Thread.Sleep(5000); string outdatacode = "{\"v_user_id\":" + v_user_id.ToString() + "," + "\"dorm_id\":" + dorm_id.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()); string result = ""; while (string.IsNullOrEmpty(result) == true) { result = DoPost(ProgrameData.GameAdd + RequestUrls.Get_Friend_Build_Coin, requeststring); } //var jsonobj = DynamicJson.Parse(AuthCode.Decode(result, ProgrameData.sign)); //result = CommonHelp.DecodeAndMapJson(result); var jsonobj = DynamicJson.Parse(CommonHelp.DecodeAndMapJson(result)); try { //如果和预想的num一样则返回true if (Convert.ToInt32(jsonobj.build_coin) == num) { return(true); } else { //一些报错处理 return(false); } } catch (Exception e) { MessageBox.Show("获取好友电池出错"); MessageBox.Show(e.ToString()); return(false); } }
public bool StartOperation(int teamid, int operation_id) { //{\"team_id\":1,\"operation_id\":5} //string outdatacode = String.Format("{\"team_id\":{0},\"operation_id\":{1}}", teamid, operation_id); string outdatacode = ""; outdatacode = "{\"team_id\":" + teamid.ToString() + "," + "\"operation_id\":" + operation_id.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()); string result = ""; int count = 0; while (result != "1") { result = DoPost(ProgrameData.GameAdd + RequestUrls.StartOperation, requeststring); if (count++ == 10) { return(false); } }//result = 1 return(true); }
public static string Encode(string data, string signcode) { return(AuthCode.Encode(data, signcode)); }