public virtual void Awake()
 {
     eventChannel = new EventChannel(Service.Get <EventDispatcher>());
     eventChannel.AddListener <PlayerSpawnedEvents.LocalPlayerSpawned>(onLocalPlayerSpawned);
     dateDefinitions         = Service.Get <IGameData>().Get <Dictionary <int, ScheduledEventDateDefinition> >();
     contentSchedulerService = Service.Get <ContentSchedulerService>();
 }
 public new void Start()
 {
     base.Start();
     claimableRewardDefinition = Service.Get <GameData>().Get <Dictionary <int, ClaimableRewardDefinition> >();
     dataEntityCollection      = Service.Get <CPDataEntityCollection>();
     contentSchedulerService   = Service.Get <ContentSchedulerService>();
     Service.Get <EventDispatcher>().AddListener <RewardServiceEvents.ClaimedReward>(onClaimedReward);
     Service.Get <EventDispatcher>().AddListener <RewardServiceEvents.ClaimableRewardFail>(onClaimableRewardFail);
 }
 private void Awake()
 {
     dispatcher              = playgroundController.EventDispatcher;
     eventChannel            = new EventChannel(dispatcher);
     contentSchedulerService = Service.Get <ContentSchedulerService>();
     localizer            = Service.Get <Localizer>();
     dataEntityCollection = Service.Get <CPDataEntityCollection>();
     evergreenMusicTarget = GameObject.Find(EvergreenMusicTargetPath);
     EventManager.Instance.PostEvent(MusicEventName, EventAction.PlaySound, evergreenMusicTarget);
     createCoMusicTarget = GameObject.Find(CrateCoMusicTargetPath);
     Service.Get <EventDispatcher>().AddListener <ZoneTransitionEvents.ZoneTransition>(onZoneTransition);
     Service.Get <EventDispatcher>().AddListener <RewardServiceEvents.RewardsEarned>(onRewardsEarned);
     Service.Get <EventDispatcher>().AddListener <IslandTargetsEvents.ClockTowerStateChanged>(onClockTowerStateChange);
     if (DisableWhenNoGameServer.IsGameServerAvailable())
     {
         gameTimer = new Timer(1f, repeat: true, delegate
         {
             onGameTimerTick();
         });
         animatorFloatingClock = ClockTimer.GetComponentInChildren <Animator>();
         CoroutineRunner.Start(setScarecrowVisible(isVisible: true), this, "setScarecrowVisible");
         CoroutineRunner.Start(setClockTimerVisible(isVisible: false), this, "setClockTimerVisible");
         eventChannel.AddListener <IslandTargetsEvents.TargetsRemainingUpdated>(onTargetsRemainingUpdated);
         eventChannel.AddListener <IslandTargetsEvents.GameRoundStarted>(onRoundStarted);
         eventChannel.AddListener <IslandTargetsEvents.GameRoundEnded>(onRoundEnded);
         eventChannel.AddListener <IslandTargetsEvents.TargetGameTimeOut>(onGameTimeOut);
         eventChannel.AddListener <IslandTargetsEvents.StatsUpdated>(onStatsUpdated);
         if (TimeUtils.isMultipleOfXMinutesAfterTheHour(contentSchedulerService.PresentTime(), islandTargetsPlayground.EveryXMinutesAfterTheHour))
         {
             gotoFiveSecsGameStartMarkState();
         }
         else
         {
             InvokeRepeating("displayGameStartCountdown", 0f, 1f);
         }
     }
     else
     {
         ClockTimer.SetActive(value: false);
         WinStreakText.SetText(BestEverStreak.ToString());
         DailyRecordText.transform.parent.gameObject.SetActive(value: false);
     }
     if (string.IsNullOrEmpty(BI_Tier1Name))
     {
         BI_Tier1Name = "crate_co_game";
         Log.LogError(this, $"Error: Tier1 name for BI is not set on '{base.gameObject.GetPath()}'");
     }
 }
示例#4
0
    public override IEnumerator PerformFirstPass()
    {
        string dailyChallengesScheduleManifestPath           = DailyChallengeService.GetDateManifestMapPath();
        AssetRequest <DatedManifestMap> scheduleAssetRequest = Content.LoadAsync <DatedManifestMap>(dailyChallengesScheduleManifestPath);

        yield return(scheduleAssetRequest);

        Dictionary <int, ScheduledEventDateDefinition> events = Service.Get <IGameData>().Get <Dictionary <int, ScheduledEventDateDefinition> >();
        ScheduledEventDateDefinition def = null;

        events.TryGetValue(SupportWindow.Id, out def);
        ContentSchedulerService service = new ContentSchedulerService(scheduleAssetRequest.Asset.Map.Keys, PenguinStandardTimeOffsetHours, def);

        Service.Set(service);
        bool   offlineMode  = service.HasSupportEndded();
        string offline_mode = CommandLineArgs.GetValueForKey("offline_mode");

        if (!string.IsNullOrEmpty(offline_mode))
        {
            offlineMode = (offline_mode.ToLower().Trim() == "true");
        }
        Service.Get <GameSettings>().SetOfflineMode(offlineMode);
    }
示例#5
0
 public new void Start()
 {
     base.Start();
     contentSchedulerService = Service.Get <ContentSchedulerService>();
     gameStateController     = Service.Get <GameStateController>();
 }