Example #1
0
 private void OnSquadDetailsUpdated(Squad squad, bool success)
 {
     ProcessingScreen.Hide();
     if (this.IsClosedOrClosing())
     {
         return;
     }
     if (success)
     {
         if (squad != null)
         {
             string detailsString;
             bool   showRequestButton = SquadUtils.CanCurrentPlayerJoinSquad(Service.CurrentPlayer, Service.SquadController.StateManager.GetCurrentSquad(), squad, Service.Lang, out detailsString);
             this.DisplaySquadInfoView(squad, showRequestButton, detailsString);
         }
         else
         {
             success = false;
         }
     }
     else
     {
         string message = this.lang.Get("GENERIC_SQUAD_INFO_ISSUE", new object[0]);
         AlertScreen.ShowModal(false, null, message, null, null);
     }
 }
Example #2
0
 private void OnSetupChatDisplayTimer(uint timerId, object cookie)
 {
     if (this.chatDisplay != null)
     {
         List <SquadMsg> existingMessages = Service.SquadController.MsgManager.GetExistingMessages();
         int             count            = existingMessages.Count;
         int             num = count - this.numExistingMsgsProcessed;
         if (num > 10)
         {
             num = 10;
         }
         if (num > 0)
         {
             int i    = this.numExistingMsgsProcessed;
             int num2 = this.numExistingMsgsProcessed + num;
             while (i < num2)
             {
                 SquadMsg item = existingMessages[i];
                 if (!this.existingMsgsProcessed.Contains(item))
                 {
                     this.numExistingMsgsProcessed++;
                     this.chatDisplay.ProcessMessage(existingMessages[i], false);
                     this.existingMsgsProcessed.Add(existingMessages[i]);
                 }
                 i++;
             }
         }
         else
         {
             this.KillExistingTimers();
             this.chatDisplay.OnExistingMessagesSetup();
             ProcessingScreen.Hide();
         }
     }
 }
Example #3
0
 protected void CancelLoaderAndResetGrid()
 {
     ProcessingScreen.Hide();
     this.ResetGrid();
     this.RepositionGridItems();
     this.scrollView.ResetPosition();
 }
Example #4
0
 public void VideoAdFailToPlay(string adUnit)
 {
     this.BILogEvent("video_ad", "closed", adUnit);
     this.HandleForegrounding();
     ProcessingScreen.Hide();
     Service.Logger.Error("VideoAd Fail to Play: " + adUnit);
 }
Example #5
0
        private void OnSquadsSearched(bool success)
        {
            if (!this.Visible)
            {
                return;
            }
            this.searchBtnOverlay.Enabled = true;
            ProcessingScreen.Hide();
            List <Squad> list = Service.LeaderboardController.SearchedSquads.List;

            if (success && list.Count == 0)
            {
                this.SearchResultsEmpty();
            }
            if (this.curTab == SocialTabs.Search)
            {
                base.ResetGrid();
                this.AddEmptySpacingItem();
                if (success)
                {
                    base.AddItemsToGrid <Squad>(list, true, false);
                }
                else
                {
                    AlertScreen.ShowModal(false, null, this.lang.Get("GENERIC_SEARCH_ISSUE", new object[0]), null, null);
                }
            }
        }
Example #6
0
 private void OnMemberChangeComplete(bool success, object cookie)
 {
     ProcessingScreen.Hide();
     if (success)
     {
         this.UpdateMembers();
     }
 }
Example #7
0
 private void OnSquadDataUpdated(Squad squad, bool success)
 {
     this.squadIdsRequiringDetails.Remove(squad.SquadID);
     if (this.squadIdsRequiringDetails.Count == 0 && this.curTab == SocialTabs.Invites)
     {
         ProcessingScreen.Hide();
         this.LoadSquadInvites();
     }
 }
Example #8
0
 private void OnFriendsListLoaded()
 {
     if (!this.Visible)
     {
         ProcessingScreen.Hide();
         return;
     }
     this.OnPlayersListLoaded(Service.LeaderboardController.Friends.List, new Action(this.PopulateFriendsOnGrid));
 }
Example #9
0
 private void OnFacebookLoginFailed(bool showDialog)
 {
     ProcessingScreen.Hide();
     this.allDataFetchedCallbacks.Clear();
     if (showDialog)
     {
         Lang lang = Service.Lang;
         AlertScreen.ShowModal(false, lang.Get("FACEBOOK_PERMISSION_ERROR_TITLE", new object[0]), lang.Get("FACEBOOK_PERMISSION_ERROR_MESSAGE", new object[0]), null, null);
     }
 }
Example #10
0
 private void OnAcceptSquadInviteComplete(bool success, object cookie)
 {
     ProcessingScreen.Hide();
     if (success)
     {
         this.joinModule.OnSquadJoined();
         Service.UXController.HUD.UpdateSquadJewelCount();
         this.screen.RemoveAndDestroyRow(this);
     }
 }
Example #11
0
 private void PopulateFriendsOnGrid()
 {
     ProcessingScreen.Hide();
     if (this.curTab == SocialTabs.Friends)
     {
         this.ResetGrid();
         this.AddFBConnectItem(SocialTabs.Friends);
         this.AddItemsToGrid <PlayerLBEntity>(Service.LeaderboardController.Friends.List, true, false);
     }
 }
Example #12
0
 private void DoTabClickedReset(GridLoadHelper switchingGridLoadHelper)
 {
     ProcessingScreen.Hide();
     this.EnableGridLoadHelper(this.gridLoadHelper, false);
     this.gridLoadHelper = switchingGridLoadHelper;
     this.EnableGridLoadHelper(this.gridLoadHelper, true);
     Service.EventManager.SendEvent(EventId.SquadSelect, null);
     this.ResetGrid();
     this.RepositionGridItems();
     this.scrollView.ResetPosition();
 }
Example #13
0
 public EatResponse OnEvent(EventId id, object cookie)
 {
     if (id == EventId.SquadUpdateCompleted)
     {
         EventManager eventManager = Service.EventManager;
         eventManager.UnregisterObserver(this, EventId.SquadUpdateCompleted);
         ProcessingScreen.Hide();
         this.RefreshView();
     }
     return(EatResponse.NotEaten);
 }
Example #14
0
 public void VideoAdDisappeared(string adUnit)
 {
     this.HandleForegrounding();
     ProcessingScreen.Hide();
     Service.Logger.Debug("VideoAd Disappeared: " + adUnit);
     this.BILogEvent("video_ad", "closed", adUnit);
     if (this.isPendingReward)
     {
         this.RequestReward();
     }
 }
Example #15
0
 private void DoCallbacksIfHaveAllData()
 {
     if (this.HaveAllData)
     {
         ProcessingScreen.Hide();
         for (int i = 0; i < this.allDataFetchedCallbacks.Count; i++)
         {
             this.allDataFetchedCallbacks[i]();
         }
         this.allDataFetchedCallbacks.Clear();
     }
 }
 private void OnInviteToSquadComplete(bool success, object cookie)
 {
     ProcessingScreen.Hide();
     if (success)
     {
         string message = Service.Get <Lang>().Get("SQUAD_INVITE_SUCCESS", new object[0]);
         AlertScreen.ShowModal(false, null, message, null, null);
         this.secondaryButtonLabel.Text = Service.Get <Lang>().Get("SQUAD_INVITE_SENT", new object[0]);
         Service.Get <SquadController>().StateManager.PlayersInvitedToSquad.Add(this.player.PlayerID);
         return;
     }
     this.secondaryButton.Enabled = true;
 }
Example #17
0
 public void OnReplayLoadFailed(uint status, object cookie)
 {
     ProcessingScreen.Hide();
     if (!(Service.GameStateMachine.CurrentState is HomeState))
     {
         HomeState.GoToHomeState(null, false);
     }
     if (status == 2110u)
     {
         string message = Service.Lang.Get("REPLAY_DATA_NOT_FOUND", new object[0]);
         AlertScreen.ShowModal(false, null, message, null, null);
     }
 }
Example #18
0
        public void SkipTaskTimeGate()
        {
            if (!this.IsCurrentTaskTimeGated() || !this.IsTaskTimeGateActive())
            {
                ProcessingScreen.Hide();
                return;
            }
            PlayerIdChecksumRequest        request = new PlayerIdChecksumRequest();
            EpisodeTaskTimeGateSkipCommand episodeTaskTimeGateSkipCommand = new EpisodeTaskTimeGateSkipCommand(request);

            episodeTaskTimeGateSkipCommand.AddSuccessCallback(new AbstractCommand <PlayerIdChecksumRequest, EpisodeTaskTimeGateSkipResponse> .OnSuccessCallback(this.OnSkipTimeGateSuccess));
            Service.ServerAPI.Sync(episodeTaskTimeGateSkipCommand);
        }
Example #19
0
 private void OnRejectSquadInviteComplete(bool success, object cookie)
 {
     ProcessingScreen.Hide();
     if (success)
     {
         Service.UXController.HUD.UpdateSquadJewelCount();
         this.screen.RemoveAndDestroyRow(this);
         List <SquadInvite> squadInvites = Service.SquadController.StateManager.SquadInvites;
         if (squadInvites.Count == 0 && this.tab == SocialTabs.Invites)
         {
             this.screen.ForceSwitchTab(SocialTabs.Featured);
         }
     }
 }
 private void OnJoinComplete(bool success, object cookie)
 {
     ProcessingScreen.Hide();
     if (!this.screen.Visible)
     {
         return;
     }
     if (success)
     {
         this.OnSquadJoined();
         return;
     }
     this.button.Enabled = true;
 }
Example #21
0
        public void SkipTaskProgress()
        {
            if (!this.IsEpisodeActive())
            {
                ProcessingScreen.Hide();
                return;
            }
            PlayerIdChecksumRequest        request = new PlayerIdChecksumRequest();
            EpisodeTaskProgressSkipCommand episodeTaskProgressSkipCommand = new EpisodeTaskProgressSkipCommand(request);

            episodeTaskProgressSkipCommand.AddSuccessCallback(new AbstractCommand <PlayerIdChecksumRequest, EpisodeTaskProgressSkipResponse> .OnSuccessCallback(this.OnSkipTaskProgressSuccess));
            episodeTaskProgressSkipCommand.AddFailureCallback(new AbstractCommand <PlayerIdChecksumRequest, EpisodeTaskProgressSkipResponse> .OnFailureCallback(this.OnSkipTaskProgressFailure));
            Service.ServerAPI.Sync(episodeTaskProgressSkipCommand);
        }
        public void OnReplayLoaded(GetReplayResponse response, object cookie)
        {
            ProcessingScreen.Hide();
            this.replayResponseData = response;
            BattlePlaybackState.GoToBattlePlaybackState(this);
            BattleRecord replayData = response.ReplayData;
            BattleEntry  entryData  = response.EntryData;

            replayData.RecordId      = entryData.RecordID;
            entryData.SharerPlayerId = this.replayOwnerPlayerId;
            bool flag = Service.Get <CurrentPlayer>().PlayerId == entryData.AttackerID || this.replayOwnerPlayerId == entryData.AttackerID;

            entryData.Won = (flag ? (entryData.EarnedStars > 0) : (entryData.EarnedStars == 0));
            Service.Get <EventManager>().SendEvent(EventId.BattleRecordRetrieved, this.replayResponseData);
        }
Example #23
0
        public void StartTaskTimeGate()
        {
            if (!this.IsCurrentTaskTimeGated())
            {
                ProcessingScreen.Hide();
                return;
            }
            EpisodeTaskTimeGateStartCommand episodeTaskTimeGateStartCommand = new EpisodeTaskTimeGateStartCommand(new PlayerIdRequest
            {
                PlayerId = Service.CurrentPlayer.PlayerId
            });

            episodeTaskTimeGateStartCommand.AddSuccessCallback(new AbstractCommand <PlayerIdRequest, EpisodeDefaultResponse> .OnSuccessCallback(this.OnStartTaskTimeGateSuccess));
            Service.ServerAPI.Sync(episodeTaskTimeGateStartCommand);
        }
 private void OnGetLBTournament(bool success)
 {
     if (!success)
     {
         this.OnDataUpdateFailure();
         return;
     }
     ProcessingScreen.Hide();
     if (!this.Visible)
     {
         return;
     }
     if (this.curTab == SocialTabs.Tournament)
     {
         this.AddItemsToLeaderboardGrid();
     }
 }
 private void OnGetLBPlayers(bool success)
 {
     if (!success)
     {
         this.OnDataUpdateFailure();
         return;
     }
     if (!this.Visible)
     {
         ProcessingScreen.Hide();
         return;
     }
     if (this.curTab == SocialTabs.Leaders)
     {
         LeaderboardList <PlayerLBEntity> leaderboardList = this.GetLeaderboardList();
         base.OnPlayersListLoaded((leaderboardList != null) ? leaderboardList.List : null, new Action(this.PopulatePlayersOnGrid));
     }
 }
Example #26
0
 private void OnGetLBSquads(bool success)
 {
     if (success)
     {
         ProcessingScreen.Hide();
         if (!this.Visible)
         {
             return;
         }
         if (this.curTab == SocialTabs.Squads)
         {
             this.AddItemsToLeaderboardGrid();
         }
     }
     else
     {
         this.OnDataUpdateFailure();
     }
 }
Example #27
0
        private void FacebookLoginLogicAfterGetSelfDataResponse()
        {
            string            @string           = PlayerPrefs.GetString("FB_ID", null);
            SharedPlayerPrefs sharedPlayerPrefs = Service.Get <SharedPlayerPrefs>();
            string            text = null;

            if (sharedPlayerPrefs != null)
            {
                text = sharedPlayerPrefs.GetPref <string>("FB_ID");
            }
            if ((!string.IsNullOrEmpty(text) && text.CompareTo(FacebookManager.Instance.getUserId()) != 0) || (!string.IsNullOrEmpty(@string) && @string.CompareTo(FacebookManager.Instance.getUserId()) != 0))
            {
                ProcessingScreen.Hide();
                Lang   lang    = Service.Get <Lang>();
                string title   = lang.Get("IAP_DISABLED_ANDROID_TITLE", new object[0]);
                string message = lang.Get("FACEBOOK_YOU_ARE_USING_ANOTHER_ACCOUNT", new object[0]);
                AlertScreen.ShowModal(false, title, message, new OnScreenModalResult(this.OnFacebookOverrideWarningClosed), null);
                return;
            }
            this.FinishFacebookLogin();
        }
Example #28
0
        private void OnVisitNeighborSuccess(VisitNeighborResponse response, object cookie)
        {
            ProcessingScreen.Hide();
            if (response == null)
            {
                this.processing = false;
                return;
            }
            this.NeighborPlayer                = new GamePlayer();
            this.NeighborPlayer.PlayerName     = response.Name;
            this.NeighborPlayer.Faction        = response.Faction;
            this.NeighborPlayer.Map            = response.MapData;
            this.NeighborPlayer.Inventory      = response.InventoryData;
            this.NeighborPlayer.AttackRating   = response.AttackRating;
            this.NeighborPlayer.DefenseRating  = response.DefenseRating;
            this.NeighborPlayer.AttacksWon     = response.AttacksWon;
            this.NeighborPlayer.DefensesWon    = response.DefensesWon;
            this.NeighborPlayer.Squad          = response.Squad;
            this.NeighborPlayer.UnlockedLevels = response.UpgradesData;
            this.NeighborSquadTroops           = response.SquadTroops;
            NeighborMapDataLoader mapDataLoader = new NeighborMapDataLoader(response);
            IState             currentState     = Service.Get <GameStateMachine>().CurrentState;
            AbstractTransition transition;

            if (currentState is GalaxyState)
            {
                transition = new GalaxyMapToBaseTransition(new NeighborVisitState(), mapDataLoader, new TransitionCompleteDelegate(this.OnTransitionComplete), false, false);
            }
            else if (currentState is WarBoardState)
            {
                transition = new WarboardToWarbaseTransition(new NeighborVisitState(), mapDataLoader, new TransitionCompleteDelegate(this.OnTransitionComplete), false, false);
            }
            else
            {
                transition = new WorldToWorldTransition(new NeighborVisitState(), mapDataLoader, new TransitionCompleteDelegate(this.OnTransitionComplete), false, true);
            }
            Service.Get <WorldTransitioner>().StartTransition(transition);
        }
 private void OnDataUpdateFailure()
 {
     ProcessingScreen.Hide();
     this.top50Button.Enabled  = false;
     this.findMeButton.Enabled = false;
 }
Example #30
0
 private void OnVisitNeighborFailure(uint id, object cookie)
 {
     ProcessingScreen.Hide();
 }