Beispiel #1
0
 def _notify_client(self, deltas=None, headline_icon_modifier=None):
     if self.suppress_client_updates:
         return
     sim_info_a = self.find_sim_info_a()
     sim_info_b = self.find_sim_info_b()
     if sim_info_a is not None and (
             sim_info_b is not None
             and sim_info_a.is_npc) and sim_info_b.is_npc:
         return
     if sim_info_a is not None:
         send_relationship_op(
             sim_info_a,
             self._build_relationship_update_proto(sim_info_a,
                                                   self._sim_id_b,
                                                   deltas=deltas))
         if deltas is not None:
             self._send_headlines_for_sim(
                 sim_info_a,
                 deltas,
                 headline_icon_modifier=headline_icon_modifier)
     if sim_info_b is not None:
         send_relationship_op(
             sim_info_b,
             self._build_relationship_update_proto(sim_info_b,
                                                   self._sim_id_a,
                                                   deltas=deltas))
         if deltas is not None:
             self._send_headlines_for_sim(
                 sim_info_b,
                 deltas,
                 headline_icon_modifier=headline_icon_modifier)
 def _send_relationship_data(self, sim_id):
     if self.relationship_track_visual is None:
         return
     relationship_to_send = self._get_relationship(sim_id)
     if not relationship_to_send:
         return
     sim_info = services.sim_info_manager().get(sim_id)
     if sim_info is None:
         return
     msg = commodity_protocol.RelationshipUpdate()
     msg.actor_sim_id = sim_id
     (msg.target_id.object_id,
      msg.target_id.manager_id) = self.owner.icon_info
     msg.target_instance_id = self.owner.id
     if self.icon_override is not None:
         build_icon_info_msg(IconInfoData(icon_resource=self.icon_override),
                             None, msg.target_icon_override)
     with ProtocolBufferRollback(msg.tracks) as relationship_track_update:
         relationship_value = relationship_to_send.get_value()
         relationship_track_update.track_score = relationship_value
         relationship_track_update.track_bit_id = self.relationship_track_visual.relationship_track.get_bit_at_relationship_value(
             relationship_value).guid64
         relationship_track_update.track_id = self.relationship_track_visual.relationship_track.guid64
         relationship_track_update.track_popup_priority = self.relationship_track_visual.relationship_track.display_popup_priority
         relationship_track_update.visible_in_relationship_panel = self.relationship_track_visual.visible_in_relationship_panel
     send_relationship_op(sim_info, msg)
     if self._object_social_mixin is not None:
         self._object_social_mixin.send_social_update_message()
Beispiel #3
0
 def _notify_client(self, deltas=None):
     if self.suppress_client_updates:
         return
     sim_info = self.find_sim_info()
     if sim_info is not None:
         send_relationship_op(
             sim_info, self._build_relationship_update_proto(deltas=deltas))
Beispiel #4
0
 def _notify_client_object_rel(self,
                               deltas=None,
                               headline_icon_modifier=None):
     if self.suppress_client_updates:
         return
     sim_info_a = self.find_sim_info_a()
     if sim_info_a is not None and sim_info_a.is_npc:
         return
     if sim_info_a is not None:
         op = self._build_object_relationship_update_proto(
             sim_info_a,
             self._sim_id_b,
             deltas=deltas,
             name_override=self.get_object_rel_name())
         if op is not None:
             send_relationship_op(sim_info_a, op)
 def _send_relationship_data(self, sim_id):
     if self._relationship_track_visual is None:
         return
     relationship_to_send = self._get_relationship(sim_id)
     if not relationship_to_send:
         return
     sim_info = services.sim_info_manager().get(sim_id)
     if sim_info is None:
         return
     msg = commodity_protocol.RelationshipUpdate()
     msg.actor_sim_id = sim_id
     (msg.target_id.object_id, msg.target_id.manager_id) = self.owner.icon_info
     msg.target_instance_id = self.owner.id
     with ProtocolBufferRollback(msg.tracks) as relationship_track_update:
         relationship_value = relationship_to_send.get_value()
         relationship_track_update.track_score = relationship_value
         relationship_track_update.track_bit_id = self._relationship_track_visual.get_bit_at_relationship_value(relationship_value).guid64
         relationship_track_update.track_id = self._relationship_track_visual.guid64
         relationship_track_update.track_popup_priority = self._relationship_track_visual.display_popup_priority
     send_relationship_op(sim_info, msg)
 def _notify_client(self, deltas=None):
     if self.suppress_client_updates:
         return
     sim_info = self.find_sim_info()
     if sim_info is not None:
         send_relationship_op(sim_info, self._build_relationship_update_proto(deltas=deltas))