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_ReqSupport.Api_Support.Json> jsonBodyResponse = (WebAPI.JSON_BodyResponse <FlowNode_ReqSupport.Api_Support.Json>)JsonUtility.FromJson <WebAPI.JSON_BodyResponse <FlowNode_ReqSupport.Api_Support.Json> >(www.text);
         DebugUtility.Assert(jsonBodyResponse != null, "res == null");
         if (jsonBodyResponse.body != null && jsonBodyResponse.body.unit != null)
         {
             long[] iids = new long[Enum.GetValues(typeof(EElement)).Length];
             if (jsonBodyResponse.body.units != null)
             {
                 for (int index = 0; index < jsonBodyResponse.body.units.Length; ++index)
                 {
                     if (jsonBodyResponse.body.units[index] != null)
                     {
                         int elem = jsonBodyResponse.body.units[index].elem;
                         iids[elem] = jsonBodyResponse.body.units[index].iid;
                     }
                 }
             }
             iids[0] = jsonBodyResponse.body.unit.iid;
             this.m_Node.m_TargetWindow.SetSupportUnitData(iids);
         }
         Network.RemoveAPI();
         this.Success();
     }
 }
 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_ReqUnitFavorite.Api_SetUnitFavorite.Json> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqUnitFavorite.Api_SetUnitFavorite.Json> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         if (jsonObject.body != null && jsonObject.body.units != null)
         {
             PlayerData player = MonoSingleton <GameManager> .Instance.Player;
             if (player != null)
             {
                 for (int index = 0; index < jsonObject.body.units.Length; ++index)
                 {
                     UnitData unitData = player.GetUnitData(jsonObject.body.units[index].iid);
                     if (unitData != null)
                     {
                         unitData.IsFavorite = jsonObject.body.units[index].fav == 1;
                     }
                 }
             }
         }
         Network.RemoveAPI();
         this.Success();
     }
 }
 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();
     }
 }
Exemple #4
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                switch (Network.ErrCode)
                {
                case Network.EErrCode.FindNoFriend:
                    Network.RemoveAPI();
                    Network.ResetError();
                    this.Failure();
                    break;

                case Network.EErrCode.FindIsMine:
                    ((Behaviour)this).set_enabled(false);
                    this.OnBack();
                    break;

                case Network.EErrCode.StringTooShort:
                    ((Behaviour)this).set_enabled(false);
                    this.OnBack();
                    break;

                default:
                    this.OnRetry();
                    break;
                }
            }
            else
            {
                DebugMenu.Log("API", "find/friend:" + www.text);
                WebAPI.JSON_BodyResponse <Json_PlayerDataAll> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_PlayerDataAll> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                if (jsonObject.body == null)
                {
                    this.OnRetry();
                }
                else
                {
                    Network.RemoveAPI();
                    try
                    {
                        if (jsonObject.body.friends == null || jsonObject.body.friends.Length < 1)
                        {
                            throw new InvalidJSONException();
                        }
                        FriendData friendData = new FriendData();
                        friendData.Deserialize(jsonObject.body.friends[0]);
                        GlobalVars.FoundFriend = friendData;
                        this.Success();
                    }
                    catch (Exception ex)
                    {
                        DebugUtility.LogException(ex);
                        this.Failure();
                    }
                }
            }
        }
 public override void Complete(WWWResult www)
 {
     if (Network.IsError)
     {
         this.m_Node.OnBack();
     }
     else
     {
         DebugMenu.Log("API", this.url + ":" + www.text);
         WebAPI.JSON_BodyResponse <FlowNode_ReqFriendSupport.Api_FriendSupport.Json> jsonBodyResponse = (WebAPI.JSON_BodyResponse <FlowNode_ReqFriendSupport.Api_FriendSupport.Json>)JsonUtility.FromJson <WebAPI.JSON_BodyResponse <FlowNode_ReqFriendSupport.Api_FriendSupport.Json> >(www.text);
         DebugUtility.Assert(jsonBodyResponse != null, "res == null");
         if (jsonBodyResponse.body != null && jsonBodyResponse.body.unit != null)
         {
             UnitData[] unitDataArray = new UnitData[Enum.GetValues(typeof(EElement)).Length];
             if (jsonBodyResponse.body.units != null)
             {
                 for (int index = 0; index < jsonBodyResponse.body.units.Length; ++index)
                 {
                     Json_Unit unit = jsonBodyResponse.body.units[index];
                     int       elem = unit.elem;
                     if (elem >= unitDataArray.Length || elem < 0)
                     {
                         DebugUtility.LogError(string.Format("不正なインデックスが属性値として指定されています。 elem = {0}", (object)elem));
                     }
                     else
                     {
                         unitDataArray[elem] = new UnitData();
                         unitDataArray[elem].Deserialize(unit);
                     }
                 }
             }
             if (jsonBodyResponse.body.unit != null)
             {
                 UnitData unitData = new UnitData();
                 unitData.Deserialize(jsonBodyResponse.body.unit);
                 unitDataArray[0] = unitData;
             }
             this.m_ValueList.SetObject("data_units", (object)unitDataArray);
         }
         Network.RemoveAPI();
         this.Success();
     }
 }
 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_ReqPresentList.Api_PresentListSend.Json> jsonBodyResponse = (WebAPI.JSON_BodyResponse <FlowNode_ReqPresentList.Api_PresentListSend.Json>)JsonUtility.FromJson <WebAPI.JSON_BodyResponse <FlowNode_ReqPresentList.Api_PresentListSend.Json> >(www.text);
         DebugUtility.Assert(jsonBodyResponse != null, "res == null");
         if (jsonBodyResponse.body != null && jsonBodyResponse.body.result && FriendPresentRootWindow.instance != null)
         {
             FriendPresentRootWindow.SetSendStatus(FriendPresentRootWindow.SendStatus.SENDING);
         }
         Network.RemoveAPI();
         this.Success();
     }
 }
Exemple #7
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_ReqWishList.Api_WishListSet.Json> jsonBodyResponse = (WebAPI.JSON_BodyResponse <FlowNode_ReqWishList.Api_WishListSet.Json>)JsonUtility.FromJson <WebAPI.JSON_BodyResponse <FlowNode_ReqWishList.Api_WishListSet.Json> >(www.text);
         DebugUtility.Assert(jsonBodyResponse != null, "res == null");
         if (jsonBodyResponse.body != null && jsonBodyResponse.body.result)
         {
             MonoSingleton <GameManager> .Instance.Player.SetWishList(this.m_Id, this.m_Priority);
         }
         Network.RemoveAPI();
         this.Success();
     }
 }
 public override void Complete(WWWResult www)
 {
     if (Network.IsError)
     {
         this.Failed();
     }
     else
     {
         DebugMenu.Log("API", this.url + ":" + www.text);
         WebAPI.JSON_BodyResponse <FlowNode_ReqOption.Api_OptionSet.Json> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqOption.Api_OptionSet.Json> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         if (jsonObject.body != null)
         {
             MonoSingleton <GameManager> .Instance.Player.Deserialize(jsonObject.body.player);
         }
         Network.RemoveAPI();
         this.Success();
     }
 }
Exemple #9
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 <FriendPresentWishList.Json[]> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FriendPresentWishList.Json[]> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         if (jsonObject.body != null)
         {
             MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body);
         }
         Network.RemoveAPI();
         this.Success();
     }
 }
 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_ReqPresentStatus.Api_PresentListStatus.Json> jsonBodyResponse = (WebAPI.JSON_BodyResponse <FlowNode_ReqPresentStatus.Api_PresentListStatus.Json>)JsonUtility.FromJson <WebAPI.JSON_BodyResponse <FlowNode_ReqPresentStatus.Api_PresentListStatus.Json> >(www.text);
         DebugUtility.Assert(jsonBodyResponse != null, "res == null");
         if (jsonBodyResponse.body != null)
         {
             if (string.IsNullOrEmpty(jsonBodyResponse.body.result))
             {
                 FriendPresentRootWindow.SetSendStatus(FriendPresentRootWindow.SendStatus.UNSENT);
             }
             else if (jsonBodyResponse.body.result == "0")
             {
                 FriendPresentRootWindow.SetSendStatus(FriendPresentRootWindow.SendStatus.SENDING);
             }
             else if (jsonBodyResponse.body.result == "1")
             {
                 FriendPresentRootWindow.SetSendStatus(FriendPresentRootWindow.SendStatus.SENDED);
             }
             else if (jsonBodyResponse.body.result == "9")
             {
                 FriendPresentRootWindow.SetSendStatus(FriendPresentRootWindow.SendStatus.SENTFAILED);
             }
             else
             {
                 FriendPresentRootWindow.SetSendStatus(FriendPresentRootWindow.SendStatus.NONE);
             }
         }
         else
         {
             FriendPresentRootWindow.SetSendStatus(FriendPresentRootWindow.SendStatus.NONE);
         }
         Network.RemoveAPI();
         this.Success();
     }
 }
 public override void Complete(WWWResult www)
 {
     if (Network.IsError)
     {
         this.m_Node.OnFailed();
     }
     else
     {
         DebugMenu.Log("API", this.url + ":" + www.text);
         DebugUtility.Assert((WebAPI.JSON_BodyResponse <FlowNode_ReqMultiInvitation.Api_RoomInvitationSend.Json>)JsonUtility.FromJson <WebAPI.JSON_BodyResponse <FlowNode_ReqMultiInvitation.Api_RoomInvitationSend.Json> >(www.text) != null, "res == null");
         if (this.m_Sends != null)
         {
             for (int index = 0; index < this.m_Sends.Length; ++index)
             {
                 MultiInvitationSendWindow.AddInvited(this.m_Sends[index]);
             }
         }
         Network.RemoveAPI();
         this.Success();
     }
 }
Exemple #12
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)
     {
         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();
     }
 }
Exemple #14
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_ReqSupportList.Api_SupportList.Json> jsonBodyResponse = (WebAPI.JSON_BodyResponse <FlowNode_ReqSupportList.Api_SupportList.Json>)JsonUtility.FromJson <WebAPI.JSON_BodyResponse <FlowNode_ReqSupportList.Api_SupportList.Json> >(www.text);
         DebugUtility.Assert(jsonBodyResponse != null, "res == null");
         if (jsonBodyResponse.body != null)
         {
             FlowNode_ReqSupportList.SupportList supportList = new FlowNode_ReqSupportList.SupportList(this.m_Element);
             supportList.Deserialize(jsonBodyResponse.body.supports);
             if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_Node.m_Window, (UnityEngine.Object)null) && this.m_Node.m_Window.rootWindow != null)
             {
                 this.m_Node.m_Window.rootWindow.AddData("data_supportres", (object)supportList);
             }
         }
         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);
     }
 }
Exemple #17
0
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         this.OnFailed();
     }
     else
     {
         DebugMenu.Log("API", "friend:" + www.text);
         WebAPI.JSON_BodyResponse <Json_FriendList> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_FriendList> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         Network.RemoveAPI();
         GameManager instance = MonoSingleton <GameManager> .Instance;
         try
         {
             instance.Deserialize(jsonObject.body.friends, FriendStates.Friend);
             if (this.IsFollower)
             {
                 instance.Player.FollowerNum = jsonObject.body.follower_count;
                 InnWindow componentInChildren = (InnWindow)((Component)this).get_gameObject().GetComponentInChildren <InnWindow>();
                 if (UnityEngine.Object.op_Inequality((UnityEngine.Object)componentInChildren, (UnityEngine.Object)null))
                 {
                     componentInChildren.Refresh();
                 }
             }
             instance.Player.FirstFriendCount = jsonObject.body.first_count;
             this.Success();
         }
         catch (Exception ex)
         {
             DebugUtility.LogException(ex);
             return;
         }
         ((Behaviour)this).set_enabled(false);
     }
 }
Exemple #18
0
        public ReqBtlComReq(string iname, string fuid, SupportData support, Network.ResponseCallback response, bool multi, int partyIndex, bool isHost = false, int plid = 0, int seat = 0, [Optional] Vector2 location, RankingQuestParam rankingQuestParam = null)
        {
            StringBuilder stringBuilder = WebAPI.GetStringBuilder();

            this.name = !multi ? "btl/com/req" : "btl/multi/req";
            stringBuilder.Append("\"iname\":\"");
            stringBuilder.Append(iname);
            stringBuilder.Append("\",");
            if (partyIndex >= 0)
            {
                stringBuilder.Append("\"partyid\":");
                stringBuilder.Append(partyIndex);
                stringBuilder.Append(",");
            }
            if (multi)
            {
                stringBuilder.Append("\"token\":\"");
                stringBuilder.Append(JsonEscape.Escape(GlobalVars.SelectedMultiPlayRoomName));
                stringBuilder.Append("\",");
                stringBuilder.Append("\"host\":\"");
                stringBuilder.Append(!isHost ? "0" : "1");
                stringBuilder.Append("\",");
                stringBuilder.Append("\"plid\":\"");
                stringBuilder.Append(plid);
                stringBuilder.Append("\",");
                stringBuilder.Append("\"seat\":\"");
                stringBuilder.Append(seat);
                stringBuilder.Append("\",");
            }
            else
            {
                stringBuilder.Append("\"req_at\":");
                stringBuilder.Append(Network.GetServerTime());
                stringBuilder.Append(",");
            }
            stringBuilder.Append("\"btlparam\":{\"help\":{\"fuid\":");
            stringBuilder.Append("\"" + fuid + "\"");
            if (support != null && support.Unit != null)
            {
                stringBuilder.Append(",\"elem\":" + (object)support.Unit.SupportElement);
                stringBuilder.Append(",\"iname\":\"" + support.Unit.UnitID + "\"");
            }
            stringBuilder.Append("}");
            if (!multi && rankingQuestParam != null)
            {
                stringBuilder.Append(",\"quest_ranking\":{");
                stringBuilder.Append("\"schedule_id\":");
                stringBuilder.Append(rankingQuestParam.schedule_id);
                stringBuilder.Append(",");
                stringBuilder.Append("\"type\":");
                stringBuilder.Append((int)rankingQuestParam.type);
                stringBuilder.Append("}");
            }
            stringBuilder.Append("},");
            stringBuilder.Append("\"location\":{");
            stringBuilder.Append("\"lat\":" + (object)(float)location.x + ",");
            stringBuilder.Append("\"lng\":" + (object)(float)location.y);
            stringBuilder.Append("}");
            DebugMenu.Log("APIReq", stringBuilder.ToString());
            this.body     = WebAPI.GetRequestString(stringBuilder.ToString());
            this.callback = response;
        }
 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_ReqPresentList.Api_PresentListExec.Json> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqPresentList.Api_PresentListExec.Json> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         bool flag = false;
         if (jsonObject.body != null)
         {
             if (jsonObject.body.player != null)
             {
                 MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.player);
             }
             if (jsonObject.body.items != null)
             {
                 MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.items);
             }
             if (jsonObject.body.presents != null)
             {
                 RewardData rewardData = new RewardData();
                 for (int index = 0; index < jsonObject.body.presents.Length; ++index)
                 {
                     FlowNode_ReqPresentList.Api_PresentListExec.JsonItem present = jsonObject.body.presents[index];
                     if (present != null)
                     {
                         RewardData dataToRewardData = this.ReceiveDataToRewardData(present);
                         if (dataToRewardData != null)
                         {
                             rewardData.Exp        += dataToRewardData.Exp;
                             rewardData.Stamina    += dataToRewardData.Stamina;
                             rewardData.Coin       += dataToRewardData.Coin;
                             rewardData.Gold       += dataToRewardData.Gold;
                             rewardData.ArenaMedal += dataToRewardData.ArenaMedal;
                             rewardData.MultiCoin  += dataToRewardData.MultiCoin;
                             rewardData.KakeraCoin += dataToRewardData.KakeraCoin;
                             using (Dictionary <string, GiftRecieveItemData> .ValueCollection.Enumerator enumerator = dataToRewardData.GiftRecieveItemDataDic.Values.GetEnumerator())
                             {
                                 while (enumerator.MoveNext())
                                 {
                                     GiftRecieveItemData current = enumerator.Current;
                                     rewardData.AddReward(current);
                                 }
                             }
                             flag = true;
                         }
                     }
                 }
                 GlobalVars.LastReward.Set(rewardData);
                 if (rewardData != null)
                 {
                     MonoSingleton <GameManager> .Instance.Player.OnGoldChange(rewardData.Gold);
                 }
                 MonoSingleton <GameManager> .Instance.Player.ValidFriendPresent = false;
             }
         }
         Network.RemoveAPI();
         if (flag)
         {
             this.Success();
         }
         else
         {
             this.Failed();
         }
     }
 }
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                Network.EErrCode errCode = Network.ErrCode;
                switch (errCode)
                {
                case Network.EErrCode.VS_NotSelfBattle:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_NotPlayer:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_NotQuestInfo:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_NotQuestData:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_BattleNotEnd:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_ComBattleEnd:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_TowerNotPlay:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_NotContinuousEnemy:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_RowerNotMatching:
                    this.OnFailed();
                    break;

                default:
                    switch (errCode - 3800)
                    {
                    case Network.EErrCode.Success:
                        this.OnBack();
                        return;

                    case Network.EErrCode.Unknown:
                        this.OnBack();
                        return;

                    case Network.EErrCode.Version:
                        this.OnFailed();
                        return;

                    case Network.EErrCode.AssetVersion:
                        this.OnBack();
                        return;

                    case Network.EErrCode.NoVersionDbg:
                        this.OnFailed();
                        return;

                    case Network.EErrCode.Unknown | Network.EErrCode.NoVersionDbg:
                        this.OnBack();
                        return;

                    default:
                        switch (errCode - 202)
                        {
                        case Network.EErrCode.Success:
                        case Network.EErrCode.Unknown:
                        case Network.EErrCode.AssetVersion:
                        case Network.EErrCode.NoVersionDbg:
                            this.OnMultiMaintenance();
                            return;

                        default:
                            switch (errCode - 3300)
                            {
                            case Network.EErrCode.Success:
                                this.OnBack();
                                return;

                            case Network.EErrCode.Unknown:
                                this.OnBack();
                                return;

                            case Network.EErrCode.AssetVersion:
                                this.OnBack();
                                return;

                            default:
                                switch (errCode - 12001)
                                {
                                case Network.EErrCode.Success:
                                    this.OnFailed();
                                    return;

                                case Network.EErrCode.Version:
                                    CriticalSection.Leave(CriticalSections.SceneChange);
                                    Network.RemoveAPI();
                                    ((Behaviour)this).set_enabled(false);
                                    this.ActivateOutputLinks(600);
                                    return;

                                default:
                                    if (errCode != Network.EErrCode.NotLocation)
                                    {
                                        if (errCode != Network.EErrCode.NotGpsQuest)
                                        {
                                            if (errCode != Network.EErrCode.QuestEnd)
                                            {
                                                if (errCode != Network.EErrCode.NoBtlInfo)
                                                {
                                                    if (errCode == Network.EErrCode.MultiVersionMismatch)
                                                    {
                                                        this.OnMismatchVersion();
                                                        return;
                                                    }
                                                    this.OnRetry();
                                                    return;
                                                }
                                                this.OnFailed();
                                                return;
                                            }
                                            this.OnFailed();
                                            return;
                                        }
                                        CriticalSection.Leave(CriticalSections.SceneChange);
                                        Network.RemoveAPI();
                                        Network.ResetError();
                                        this.ActivateOutputLinks(400);
                                        ((Behaviour)this).set_enabled(false);
                                        return;
                                    }
                                    this.OnBack();
                                    return;
                                }
                            }
                        }
                    }
                }
            }
            else if (this.mReqID == 30)
            {
                Network.RemoveAPI();
                this.ActivateOutputLinks(5);
            }
            else
            {
                string text = www.text;
                DebugMenu.Log("API", "StartQuest:" + www.text);
                WebAPI.JSON_BodyResponse <BattleCore.Json_Battle> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <BattleCore.Json_Battle> >(www.text);
                if (jsonObject.body == null)
                {
                    this.OnRetry();
                }
                else
                {
                    Network.RemoveAPI();
                    if (jsonObject.body.is_rehash != 0)
                    {
                        GlobalVars.BtlID.Set(jsonObject.body.btlid);
                        UIUtility.SystemMessage(string.Empty, LocalizedText.Get("sys.FAILED_RESUMEQUEST"), (UIUtility.DialogResultEvent)(go =>
                        {
                            CriticalSection.Leave(CriticalSections.SceneChange);
                            this.ActivateOutputLinks(800);
                        }), (GameObject)null, false, -1);
                    }
                    else
                    {
                        this.ActivateOutputLinks(5);
                        this.SetVersusAudienceParam(text);
                        this.StartCoroutine(this.StartScene(jsonObject.body));
                    }
                }
            }
        }
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                Network.EErrCode errCode = Network.ErrCode;
                switch (errCode)
                {
                case Network.EErrCode.VS_NotSelfBattle:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_NotPlayer:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_NotQuestInfo:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_NotQuestData:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_BattleNotEnd:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_ComBattleEnd:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_TowerNotPlay:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_NotContinuousEnemy:
                    this.OnFailed();
                    break;

                case Network.EErrCode.VS_RowerNotMatching:
                    this.OnFailed();
                    break;

                default:
                    switch (errCode - 3800)
                    {
                    case Network.EErrCode.Success:
                        this.OnBack();
                        return;

                    case Network.EErrCode.Unknown:
                        this.OnBack();
                        return;

                    case Network.EErrCode.Version:
                        this.OnFailed();
                        return;

                    case Network.EErrCode.AssetVersion:
                        this.OnBack();
                        return;

                    case Network.EErrCode.NoVersionDbg:
                        this.OnFailed();
                        return;

                    case Network.EErrCode.Unknown | Network.EErrCode.NoVersionDbg:
                        this.OnBack();
                        return;

                    default:
                        switch (errCode - 202)
                        {
                        case Network.EErrCode.Success:
                        case Network.EErrCode.Unknown:
                        case Network.EErrCode.AssetVersion:
                        case Network.EErrCode.NoVersionDbg:
                            this.OnMultiMaintenance();
                            return;

                        default:
                            switch (errCode - 3300)
                            {
                            case Network.EErrCode.Success:
                                this.OnBack();
                                return;

                            case Network.EErrCode.Unknown:
                                this.OnBack();
                                return;

                            case Network.EErrCode.AssetVersion:
                                this.OnBack();
                                return;

                            default:
                                switch (errCode - 12001)
                                {
                                case Network.EErrCode.Success:
                                    this.OnFailed();
                                    return;

                                case Network.EErrCode.Version:
                                    CriticalSection.Leave(CriticalSections.SceneChange);
                                    Network.RemoveAPI();
                                    ((Behaviour)this).set_enabled(false);
                                    this.ActivateOutputLinks(600);
                                    return;

                                default:
                                    if (errCode != Network.EErrCode.NotLocation)
                                    {
                                        if (errCode != Network.EErrCode.NotGpsQuest)
                                        {
                                            if (errCode != Network.EErrCode.QuestEnd)
                                            {
                                                if (errCode != Network.EErrCode.NoBtlInfo)
                                                {
                                                    if (errCode == Network.EErrCode.MultiVersionMismatch)
                                                    {
                                                        this.OnMismatchVersion();
                                                        return;
                                                    }
                                                    this.OnRetry();
                                                    return;
                                                }
                                                this.OnFailed();
                                                return;
                                            }
                                            this.OnFailed();
                                            return;
                                        }
                                        CriticalSection.Leave(CriticalSections.SceneChange);
                                        Network.RemoveAPI();
                                        Network.ResetError();
                                        this.ActivateOutputLinks(400);
                                        ((Behaviour)this).set_enabled(false);
                                        return;
                                    }
                                    this.OnBack();
                                    return;
                                }
                            }
                        }
                    }
                }
            }
            else if (this.mReqID == 30)
            {
                Network.RemoveAPI();
                this.ActivateOutputLinks(5);
            }
            else
            {
                string text = www.text;
                DebugMenu.Log("API", "StartQuest:" + www.text);
                WebAPI.JSON_BodyResponse <BattleCore.Json_Battle> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <BattleCore.Json_Battle> >(www.text);
                if (jsonObject.body == null)
                {
                    this.OnRetry();
                }
                else
                {
                    Network.RemoveAPI();
                    this.ActivateOutputLinks(5);
                    this.SetVersusAudienceParam(text);
                    if (this.mResume && (MonoSingleton <GameManager> .Instance.Player.TutorialFlags & 1L) == 0L && jsonObject.body.btlinfo.qid == "QE_OP_0002")
                    {
                        MonoSingleton <GameManager> .Instance.CompleteTutorialStep();
                    }
                    this.StartCoroutine(this.StartScene(jsonObject.body));
                }
            }
        }