Exemplo n.º 1
0
        private IEnumerator score(int value, Action<ScoreResponse> callback)
        {
            Request r = new Request("game/score");
            r.AddString("score", value.ToString());

            WWW w = runRequest(r);
            yield return w; // wait for response

            ScoreResponse res = new ScoreResponse(processWWWResult(w));
            if (!res.Ready)
            {
                res.ErrorId = ErrorId;
                res.ErrorText = ErrorText;
            }
            else CurrentCheckin = null;

            callback(res);
        }
Exemplo n.º 2
0
        private IEnumerator checkout(Action<CheckoutResponse> callback)
        {
            Request r = new Request("game/checkout");

            WWW w = runRequest(r);
            yield return w; // wait for response

            CheckoutResponse res = new CheckoutResponse(processWWWResult(w));
            if (!res.Ready)
            {
                res.ErrorId = ErrorId;
                res.ErrorText = ErrorText;
            }
            else CurrentCheckin = null;

            callback(res);
        }
Exemplo n.º 3
0
        private IEnumerator checkin(string markerKey, string markerValue, Action<CheckinResponse> callback)
        {
            Request r = new Request("game/checkin");
            r.AddString("marker", markerKey);
            r.AddString("value", markerValue);

            WWW w = runRequest(r);
            yield return w; // wait for response

            CheckinResponse res = new CheckinResponse(processWWWResult(w));
            if (!res.Ready)
            {
                res.ErrorId = ErrorId;
                res.ErrorText = ErrorText;
            }
            else CurrentCheckin = res;

            callback(res);
        }
Exemplo n.º 4
0
 private void checkinResponse(CheckinResponse res)
 {
     if (res.Ready)
     {
         Debug.Log("CHECKIN: ok");
         //note = string.Format("Game: {0}\nTries: {1}\nAssets URL: {2}", res.GameName, res.Tries, res.AssetsUrl);
     }
     else
     {
         Debug.Log("CHECKIN: " + res.ErrorText + "(" + res.ErrorId + ")");
     }
 }