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 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 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 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 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); }
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); } }