Ejemplo n.º 1
0
 def schedule(self, *args, **kwargs):
     success = super().schedule(*args, **kwargs)
     if success:
         lot_id = self.get_travel_lot_id()
         zone_id = services.get_persistence_service().resolve_lot_id_into_zone_id(lot_id, ignore_neighborhood_id=True)
         if zone_id is None:
             zone_id = 0
         icon_info = IconInfoData(icon_resource=self._display_data.instance_display_icon)
         org_event_info = OrgEventInfo(drama_node=self, schedule=self._selected_time, fake_duration=self.fake_duration, icon_info=icon_info, name=self._display_data.instance_display_name(), description=self._display_data.instance_display_description(), location=self.location_name, zone_id=zone_id)
         services.organization_service().add_festival_event_update(self.organization.guid64, org_event_info, self.uid, str(type(self)))
     return success
Ejemplo n.º 2
0
 def clean_up(self):
     organization_service = services.organization_service()
     for org_id in list(self._organization_status.keys()):
         organization_service.remove_organization_member(
             self._sim_info, org_id)
         del self._organization_status[org_id]
     self._completed_tasks.clear()
Ejemplo n.º 3
0
 def submit_replace_request(self, sim, request, job_type):
     self._on_remove_sim_from_situation(sim)
     if not self.is_job_type_org_member(job_type):
         new_request = request.clone_for_replace()
         if new_request is not None:
             self.manager.bouncer.submit_request(new_request)
         return
     organization = self.member_job_and_role_states.org_member_jobs_and_roles.get(
         job_type).organization
     blacklist_sims = [sim.id]
     blacklist_sims.extend(
         sim_info.id for sim_info in services.sim_info_manager().get_all()
         if sim_info.is_player_sim)
     blacklist_sims.extend(sim.id for sim in self._situation_sims)
     additional_filter_terms = self.member_job_and_role_states.org_member_jobs_and_roles.get(
         job_type).additional_filters
     organization_member = services.organization_service(
     ).generate_organization_members(
         organization.guid64,
         amount=1,
         blacklist_sims=blacklist_sims,
         additional_filter_terms=additional_filter_terms)
     guest_info = SituationGuestInfo(organization_member[0], job_type,
                                     RequestSpawningOption.DONT_CARE,
                                     BouncerRequestPriority.BACKGROUND_HIGH)
     new_request = self._create_request_from_guest_info(guest_info)
     if new_request is not None:
         self.manager.bouncer.submit_request(new_request)
 def schedule(self, *args, **kwargs):
     success = super().schedule(*args, **kwargs)
     if success:
         icon_info = IconInfoData(
             icon_resource=self._display_data.instance_display_icon)
         org_event_info = OrgEventInfo(
             drama_node=self,
             schedule=self._selected_time,
             fake_duration=self.fake_duration,
             icon_info=icon_info,
             name=self._display_data.instance_display_name,
             description=self._display_data.instance_display_description,
             location=self.location,
             zone_id=self.zone_id)
         services.organization_service().add_venue_event_update(
             self.organization.guid64, org_event_info, self.uid,
             str(type(self)))
     return success
Ejemplo n.º 5
0
 def get_members_sim_infos(cls, blacklist_sims=None):
     hh_sims = tuple(sim_info.id
                     for sim_info in services.sim_info_manager().get_all()
                     if sim_info.is_player_sim)
     members_sim_ids = services.organization_service(
     ).generate_organization_members(
         cls.organization.guid64,
         amount=cls.number_of_members.upper_bound,
         blacklist_sims=hh_sims,
         additional_filter_terms=cls.additional_filters,
         minimum=cls.number_of_members.lower_bound)
     if not members_sim_ids:
         logger.error(
             'Situation ({}) failed to populate the situation job with members from organization ({}).',
             str(cls), str(cls.organization))
     return members_sim_ids
Ejemplo n.º 6
0
 def on_enter(self):
     super().on_enter()
     services.household_manager().load_households()
     zone = services.current_zone()
     zone_spin_up_service = zone.zone_spin_up_service
     household_id = zone_spin_up_service._client_connect_data.household_id
     household = services.household_manager().get(household_id)
     client = zone_spin_up_service._client_connect_data.client
     account_service = services.account_service()
     account_service.on_load_options(client)
     zone.service_manager.on_zone_load()
     game_services.service_manager.on_zone_load()
     sims4.core_services.service_manager.on_zone_load()
     for sim_info in household.sim_info_gen():
         client.add_selectable_sim_info(sim_info,
                                        send_relationship_update=False)
     zone.on_households_and_sim_infos_loaded()
     zone.service_manager.on_all_households_and_sim_infos_loaded(client)
     game_services.service_manager.on_all_households_and_sim_infos_loaded(
         client)
     sims4.core_services.service_manager.on_all_households_and_sim_infos_loaded(
         client)
     organization_service = services.organization_service()
     if organization_service is not None:
         organization_service.post_game_services_zone_load()
     roommate_service = services.get_roommate_service()
     if roommate_service is not None:
         roommate_service.initialize_roommates()
     services.ui_dialog_service().send_dialog_options_to_client()
     client.clean_and_send_remaining_relationship_info()
     services.current_zone().lot.send_lot_display_info()
     for obj in itertools.chain(services.object_manager().values(),
                                services.inventory_manager().values()):
         if obj.live_drag_component is not None:
             obj.live_drag_component.resolve_live_drag_household_permission(
             )
     return _ZoneSpinUpStateResult.DONE
Ejemplo n.º 7
0
def get_organization_members(org_id, status_enum):
    organization_member_data = []
    organization_service = services.organization_service()
    if organization_service is None:
        return organization_member_data
    sim_info_manager = services.sim_info_manager()
    if sim_info_manager is None:
        return
    snippet_manager = services.snippet_manager()
    if snippet_manager is None:
        return
    progress_stat_type = snippet_manager.get(org_id).progress_statistic
    members_list = organization_service.get_organization_members(org_id)
    for member_id in members_list:
        sim_info = sim_info_manager.get(member_id)
        organization_tracker = sim_info.organization_tracker
        if organization_tracker is None:
            continue
        if organization_tracker.get_organization_status(org_id) != status_enum:
            continue
        tracker = sim_info.get_tracker(progress_stat_type)
        progress_stat = tracker.get_statistic(progress_stat_type)
        organization_member_data.append({'sim': sim_info.full_name, 'progress': progress_stat.get_value(), 'rank': progress_stat.rank_level})
    return organization_member_data
 def should_resume(self):
     return services.organization_service().validate_venue_event(self)
Ejemplo n.º 9
0
 def apply(self, subject, org_id):
     organization_service = services.organization_service()
     if organization_service is None:
         return False
     return organization_service.add_organization_member(subject, org_id)