示例#1
0
    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);
        }
    }
示例#2
0
 private static void doGet(MonoBehaviour context, String url, String pars, OnRsp cb)
 {
     context.StartCoroutine(getHttp(url, pars, cb));
 }
示例#3
0
    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);
    }