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();
     }
 }
Beispiel #2
0
 public override void OnActivate(int pinID)
 {
     if (this.m_Api != null)
     {
         DebugUtility.LogError("同時に複数の通信が入ると駄目!");
     }
     else
     {
         if (pinID == 100)
         {
             MultiInvitationReceiveWindow instance = MultiInvitationReceiveWindow.instance;
             if (instance != null)
             {
                 int page = 1;
                 if (instance.GetLogPage() != page)
                 {
                     this.m_Api = (FlowNode_ReqMultiInvitationHistory.ApiBase) new FlowNode_ReqMultiInvitationHistory.Api_MultiInvitationHistory(this, page);
                 }
                 else
                 {
                     this.m_Api = (FlowNode_ReqMultiInvitationHistory.ApiBase) new FlowNode_ReqMultiInvitationHistory.Api_MultiInvitationHistory(this, page);
                     this.m_Api.Success();
                     this.m_Api = (FlowNode_ReqMultiInvitationHistory.ApiBase)null;
                 }
             }
         }
         if (this.m_Api == null)
         {
             return;
         }
         this.m_Api.Start();
         ((Behaviour)this).set_enabled(true);
     }
 }
Beispiel #3
0
 public override void Release()
 {
     this.ReleaseActiveList();
     this.ReleaseLogList();
     base.Release();
     MultiInvitationReceiveWindow.m_Instance = (MultiInvitationReceiveWindow)null;
 }
Beispiel #4
0
 public override void Initialize(FlowWindowBase.SerializeParamBase param)
 {
     MultiInvitationReceiveWindow.m_Instance = this;
     base.Initialize(param);
     this.m_Param = param as MultiInvitationReceiveWindow.SerializeParam;
     if (this.m_Param == null)
     {
         throw new Exception(this.ToString() + " > Failed serializeParam null.");
     }
     this.m_ValueList = (SerializeValueBehaviour)this.m_Param.window.GetComponent <SerializeValueBehaviour>();
     if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_ValueList, (UnityEngine.Object)null))
     {
         this.m_ActiveToggle = this.m_ValueList.list.GetUIToggle("tgl_receive");
         if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_ActiveToggle, (UnityEngine.Object)null))
         {
             ((Selectable)this.m_ActiveToggle).set_interactable(false);
         }
         this.m_LogToggle = this.m_ValueList.list.GetUIToggle("tgl_send");
         if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_LogToggle, (UnityEngine.Object)null))
         {
             ((Selectable)this.m_LogToggle).set_interactable(false);
         }
     }
     if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_Param.activeList, (UnityEngine.Object)null))
     {
         this.m_ActiveController = (ContentController)this.m_Param.activeList.GetComponentInChildren <ContentController>();
         if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_ActiveController, (UnityEngine.Object)null))
         {
             this.m_ActiveController.SetWork((object)this);
         }
     }
     if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_Param.logList, (UnityEngine.Object)null))
     {
         this.m_LogController = (ContentController)this.m_Param.logList.GetComponentInChildren <ContentController>();
         if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_LogController, (UnityEngine.Object)null))
         {
             this.m_LogController.SetWork((object)this);
         }
     }
     this.Close(true);
 }
 public override void Complete(WWWResult www)
 {
     if (Network.IsError)
     {
         this.m_Node.OnFailed();
     }
     else
     {
         DebugMenu.Log("API", this.url + ":" + www.text);
         WebAPI.JSON_BodyResponse <FlowNode_ReqMultiInvitation.Api_RoomInvitation.Json> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqMultiInvitation.Api_RoomInvitation.Json> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         if (jsonObject.body != null)
         {
             MultiInvitationReceiveWindow instance = MultiInvitationReceiveWindow.instance;
             if (instance != null)
             {
                 instance.DeserializeActiveList(jsonObject.body);
             }
         }
         Network.RemoveAPI();
         this.Success();
     }
 }
Beispiel #6
0
 public override void Complete(WWWResult www)
 {
     if (Network.IsError)
     {
         this.m_Node.OnFailed();
     }
     else
     {
         DebugMenu.Log("API", this.url + ":" + www.text);
         WebAPI.JSON_BodyResponse <FlowNode_ReqMultiInvitationHistory.Api_MultiInvitationHistory.Json> jsonBodyResponse = (WebAPI.JSON_BodyResponse <FlowNode_ReqMultiInvitationHistory.Api_MultiInvitationHistory.Json>)JsonUtility.FromJson <WebAPI.JSON_BodyResponse <FlowNode_ReqMultiInvitationHistory.Api_MultiInvitationHistory.Json> >(www.text);
         DebugUtility.Assert(jsonBodyResponse != null, "res == null");
         if (jsonBodyResponse.body != null)
         {
             MultiInvitationReceiveWindow instance = MultiInvitationReceiveWindow.instance;
             if (instance != null)
             {
                 instance.DeserializeLogList(this.m_Page, jsonBodyResponse.body);
             }
         }
         Network.RemoveAPI();
         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);
     }
 }