Example #1
0
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         this._Failed();
     }
     else
     {
         DebugMenu.Log("API", "homeapi:{" + www.text + "}");
         WebAPI.JSON_BodyResponse <FlowNode_HomeApi.JSON_HomeApiResponse> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_HomeApi.JSON_HomeApiResponse> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         Network.RemoveAPI();
         if (jsonObject.body != null && jsonObject.body.player != null)
         {
             MonoSingleton <GameManager> .Instance.Player.ValidGpsGift       = jsonObject.body.player.areamail_enabled != 0;
             MonoSingleton <GameManager> .Instance.Player.ValidFriendPresent = jsonObject.body.player.present_granted != 0;
             MultiInvitationReceiveWindow.SetBadge(jsonObject.body.player.multi_inv != 0);
             MonoSingleton <GameManager> .Instance.Player.FirstChargeStatus = jsonObject.body.player.charge_bonus;
         }
         else
         {
             MonoSingleton <GameManager> .Instance.Player.ValidGpsGift       = false;
             MonoSingleton <GameManager> .Instance.Player.ValidFriendPresent = false;
             MultiInvitationReceiveWindow.SetBadge(false);
             MonoSingleton <GameManager> .Instance.Player.FirstChargeStatus = 0;
         }
         if (jsonObject.body != null && jsonObject.body.pubinfo != null)
         {
             LoginNewsInfo.SetPubInfo(jsonObject.body.pubinfo);
         }
         this._Success();
     }
 }
 public override void Complete(WWWResult www)
 {
     if (Network.IsError)
     {
         MultiInvitationBadge.isValid = false;
         this.Failed();
     }
     else
     {
         DebugMenu.Log("API", this.url + ":" + www.text);
         WebAPI.JSON_BodyResponse <FlowNode_ReqMultiInvitation.Api_NotifyInvitation.Json> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqMultiInvitation.Api_NotifyInvitation.Json> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         if (jsonObject.body != null)
         {
             MultiInvitationReceiveWindow.SetBadge(jsonObject.body.player != null && jsonObject.body.player.multi_inv != 0);
         }
         else
         {
             MultiInvitationReceiveWindow.SetBadge(false);
         }
         Network.RemoveAPI();
         this.Success();
     }
 }
 public override void OnSuccess(WWWResult www)
 {
     if (Object.op_Equality((Object)this, (Object)null))
     {
         Network.RemoveAPI();
         Network.IsIndicator = true;
     }
     else if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         Network.RemoveAPI();
         Network.IsIndicator = true;
         ((Behaviour)this).set_enabled(false);
         this.mSetup = false;
         this.ActivateOutputLinks(100);
     }
     else
     {
         DebugMenu.Log("API", "chat:message:{" + www.text + "}");
         WebAPI.JSON_BodyResponse <JSON_ChatLog> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <JSON_ChatLog> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         Network.RemoveAPI();
         Network.IsIndicator = true;
         ChatLog log = new ChatLog();
         if (jsonObject.body != null)
         {
             log.Deserialize(jsonObject.body);
             MultiInvitationReceiveWindow.SetBadge(jsonObject.body.player != null && jsonObject.body.player.multi_inv != 0);
         }
         else
         {
             MultiInvitationReceiveWindow.SetBadge(false);
         }
         this.Success(log);
     }
 }