private static IEnumerator getHttp(String url, String pars, OnRsp cb) { var www = new WWW(url + pars); yield return(www); log("www on request ->" + url); if (!IsEmpty(www.error)) { cb("", www.error); loge("www on response->" + " err:" + www.error); } if (www.isDone) { cb(www.text, ""); log("www on response->" + www.text); } }
private static void doGet(MonoBehaviour context, String url, String pars, OnRsp cb) { context.StartCoroutine(getHttp(url, pars, cb)); }
public static void HashGet(MonoBehaviour context, string channel, string platform, int gameid, int userid, string key, String appkey, String token, OnRsp callback) { var signString = String.Format("{0}&gameID={1:d}&key={2}&userID={3}&{4}", appkey, gameid, key, userid, token); var toMd5 = Md5(signString); var strUrl = GetUrl(channel, platform); strUrl += UrlHashGet; strUrl = String.Format(strUrl, gameid, userid, key, toMd5); doGet(context, strUrl, "", callback); }