Exemple #1
0
 /**
  * 请求上一局牌局数据
  */
 public void GetLastGame(string tableId, Action <Error, LastGameResult> action)
 {
     HttpUtil.Http.Get(URLManager.lastGameUrl(tableId)).OnSuccess((result) =>
     {
         if (result != null)
         {
             LastGameResult resultObj = JsonMapper.ToObject <LastGameResult>(result);
             if (resultObj != null && resultObj.ret == 1)
             {
                 action(null, resultObj);
             }
             else
             {
                 action(new Error(resultObj.ret, resultObj.msg), resultObj);
             }
         }
     }).OnFail((result) =>
     {
         action(new Error(500, result.Message), null);
     }).GoSync();
 }