Beispiel #1
0
        public static bool HasCommonError(WWWResult www)
        {
            if (!Network.IsError)
            {
                return(false);
            }
            if (Network.ErrCode != Network.EErrCode.Failed && Network.ErrCode != Network.EErrCode.TimeOut)
            {
                DebugUtility.LogError("NetworkError: " + www.text);
            }
            else
            {
                DebugUtility.LogError("NetworkError: " + (object)Network.ErrCode + " : " + Network.ErrMsg);
            }
            SRPG_InputField.ResetInput();
            Network.EErrCode errCode = Network.ErrCode;
            switch (errCode + 2)
            {
            case Network.EErrCode.Success:
                FlowNode_Network.Retry();
                break;

            case Network.EErrCode.Unknown:
                FlowNode_Network.Retry();
                break;

            case Network.EErrCode.AssetVersion:
                FlowNode_Network.Failed();
                break;

            case Network.EErrCode.NoVersionDbg:
                FlowNode_Network.Version();
                break;

            case Network.EErrCode.Unknown | Network.EErrCode.NoVersionDbg:
                FlowNode_Network.Failed();
                break;

            case Network.EErrCode.Version | Network.EErrCode.NoVersionDbg:
label_16:
                Network.IsNoVersion = true;
                FlowNode_Network.Version();
                break;

            default:
                switch (errCode)
                {
                case Network.EErrCode.NoSID:
                case Network.EErrCode.GauthNoSid:
                    FlowNode_Network.SessionID();
                    break;

                case Network.EErrCode.Maintenance:
                    FlowNode_Network.Maintenance();
                    break;

                case Network.EErrCode.IllegalParam:
                    FlowNode_Network.Retry();
                    break;

                case Network.EErrCode.NoVersion:
                    goto label_16;

                case Network.EErrCode.ReturnForceTitle:
                    FlowNode_Network.Relogin();
                    break;

                default:
                    return(false);
                }
            }
            return(true);
        }
Beispiel #2
0
 public virtual void OnErrorAppQuit()
 {
     FlowNode_Network.SessionID();
     ((Behaviour)this).set_enabled(false);
     this.ActivateOutputLinks(this.OnSessionIDPinIndex);
 }
Beispiel #3
0
        public static bool HasCommonError(WWWResult www)
        {
            if (!Network.IsError)
            {
                return(false);
            }
            if (Network.ErrCode != Network.EErrCode.Failed && Network.ErrCode != Network.EErrCode.TimeOut)
            {
                DebugUtility.LogError("NetworkError: " + www.text);
            }
            else
            {
                DebugUtility.LogError("NetworkError: " + (object)Network.ErrCode + " : " + Network.ErrMsg);
            }
            if (!string.IsNullOrEmpty(Network.ErrMsg) && Network.ErrMsg.Contains("500"))
            {
                FlowNode_Network.Failed();
                return(true);
            }
            Network.EErrCode errCode = Network.ErrCode;
            switch (errCode + 2)
            {
            case Network.EErrCode.Success:
                FlowNode_Network.Retry();
                break;

            case Network.EErrCode.Unknown:
                FlowNode_Network.Retry();
                break;

            case Network.EErrCode.AssetVersion:
                FlowNode_Network.Failed();
                break;

            case (Network.EErrCode) 4:
                FlowNode_Network.Version();
                break;

            case (Network.EErrCode) 5:
                FlowNode_Network.Failed();
                break;

            default:
                switch (errCode)
                {
                case Network.EErrCode.NoSID:
                case Network.EErrCode.GauthNoSid:
                case Network.EErrCode.ReturnForceTitle:
                    FlowNode_Network.SessionID();
                    break;

                case Network.EErrCode.Maintenance:
                    FlowNode_Network.Maintenance();
                    break;

                case Network.EErrCode.IllegalParam:
                    FlowNode_Network.Retry();
                    break;

                default:
                    return(false);
                }
            }
            return(true);
        }
Beispiel #4
0
 public virtual void OnBack()
 {
     FlowNode_Network.Back();
     ((Behaviour)this).set_enabled(false);
     this.ActivateOutputLinks(this.OnBackPinIndex);
 }
        private void ResponseCallback(WWWResult www)
        {
            if (FlowNode_Network.HasCommonError(www))
            {
                return;
            }
            if (Network.IsError)
            {
                Network.EErrCode errCode = Network.ErrCode;
                switch (errCode)
                {
                case Network.EErrCode.MultiMaintenance:
                case Network.EErrCode.VsMaintenance:
                case Network.EErrCode.MultiVersionMaintenance:
                case Network.EErrCode.MultiTowerMaintenance:
                    Network.RemoveAPI();
                    ((Behaviour)this).set_enabled(false);
                    break;

                default:
                    if (errCode != Network.EErrCode.OutOfDateQuest)
                    {
                        if (errCode == Network.EErrCode.MultiVersionMismatch || errCode == Network.EErrCode.VS_Version)
                        {
                            Network.RemoveAPI();
                            Network.ResetError();
                            ((Behaviour)this).set_enabled(false);
                            break;
                        }
                        FlowNode_Network.Retry();
                        break;
                    }
                    Network.RemoveAPI();
                    Network.ResetError();
                    ((Behaviour)this).set_enabled(false);
                    break;
                }
            }
            else
            {
                WebAPI.JSON_BodyResponse <ReqRankMatchHistory.Response> jsonBodyResponse = (WebAPI.JSON_BodyResponse <ReqRankMatchHistory.Response>)JsonUtility.FromJson <WebAPI.JSON_BodyResponse <ReqRankMatchHistory.Response> >(www.text);
                DebugUtility.Assert(jsonBodyResponse != null, "res == null");
                if (jsonBodyResponse.body == null)
                {
                    Network.RemoveAPI();
                }
                else
                {
                    if (jsonBodyResponse.body.histories == null || jsonBodyResponse.body.histories.list == null)
                    {
                        return;
                    }
                    long unixtime = 0;
                    for (int index = 0; index < jsonBodyResponse.body.histories.list.Length; ++index)
                    {
                        ReqRankMatchHistory.ResponceHistoryList data1 = jsonBodyResponse.body.histories.list[index];
                        ListItemEvents listItemEvents = (ListItemEvents)Object.Instantiate <ListItemEvents>((M0)this.ListItem);
                        DataSource.Bind <ReqRankMatchHistory.ResponceHistoryList>(((Component)listItemEvents).get_gameObject(), data1);
                        FriendData data2 = new FriendData();
                        data2.Deserialize(data1.enemy);
                        DataSource.Bind <FriendData>(((Component)listItemEvents).get_gameObject(), data2);
                        DataSource.Bind <UnitData>(((Component)listItemEvents).get_gameObject(), data2.Unit);
                        this.AddItem(listItemEvents);
                        ((Component)listItemEvents).get_transform().SetParent(((Component)this).get_transform(), false);
                        ((Component)listItemEvents).get_gameObject().SetActive(true);
                        if (unixtime < data1.time_end)
                        {
                            unixtime = data1.time_end;
                        }
                    }
                    if (Object.op_Inequality((Object)this.LastBattleDate, (Object)null) && unixtime > 0L)
                    {
                        this.LastBattleDate.set_text(TimeManager.FromUnixTime(unixtime).ToString("MM/dd HH:mm"));
                    }
                    Network.RemoveAPI();
                }
            }
        }