public PromotionEventInstance getNewestEventInstance() { PromotionEventInstance instance = null; long startTimestamp = -9223372036854775808L; foreach (KeyValuePair <string, PromotionEventInstance> pair in this.Instances) { if (pair.Value.StartTimestamp > startTimestamp) { instance = pair.Value; startTimestamp = pair.Value.StartTimestamp; } } return(instance); }
protected void FixedUpdate() { Player player = GameLogic.Binder.GameState.Player; if (((player != null) && player.HasUnlockedMissions) && (Service.Binder.ContentService.MasterRemoteContent != null)) { for (int i = 0; i < player.Missions.Instances.Count; i++) { MissionInstance mission = player.Missions.Instances[i]; if (string.IsNullOrEmpty(mission.MissionId)) { CmdStartMission.ExecuteStatic(player, mission); } } for (int j = 0; j < player.Missions.Instances.Count; j++) { MissionInstance instance2 = player.Missions.Instances[j]; if (instance2.OnCooldown && (instance2.getRemainingCooldownSeconds() <= 0L)) { CmdStartMission.ExecuteStatic(player, instance2); } } foreach (KeyValuePair <string, PromotionEventInstance> pair in player.PromotionEvents.Instances) { PromotionEventInstance instance3 = pair.Value; for (int k = 0; k < instance3.Missions.Instances.Count; k++) { MissionInstance instance4 = instance3.Missions.Instances[k]; if (instance4.OnCooldown && (instance4.getRemainingCooldownSeconds() <= 0L)) { CmdStartMission.ExecuteStatic(player, instance4); } } } } }