Beispiel #1
0
    def on_entity_packet(self, packet):
        if self.entity_data is None:
            self.entity_data = create_entity_data()
        mask = packet.update_entity(self.entity_data)
        self.entity_data.mask |= mask
        if self.connection_state==2 and getattr(self.entity_data, 'name', None):
            self.on_join()
            return

        self.scripts.call('on_entity_update', mask=mask)
        # XXX clean this up
        if entity.is_pos_set(mask):
            self.on_pos_update()
        if entity.is_mode_set(mask):
            self.scripts.call('on_mode_update')
        if entity.is_class_set(mask):
            self.scripts.call('on_class_update')
        if entity.is_name_set(mask):
            self.scripts.call('on_name_update')
        if entity.is_multiplier_set(mask):
            self.scripts.call('on_multiplier_update')
        if entity.is_level_set(mask):
            self.scripts.call('on_level_update')
        if entity.is_equipment_set(mask):
            self.scripts.call('on_equipment_update')
        if entity.is_skill_set(mask):
            self.scripts.call('on_skill_update')
        if entity.is_appearance_set(mask):
            self.scripts.call('on_appearance_update')
        if entity.is_charged_mp_set(mask):
            self.scripts.call('on_charged_mp_update')
        if entity.is_flags_set(mask):
            self.scripts.call('on_flags_update')
        if entity.is_consumable_set(mask):
            self.scripts.call('on_consumable_update')
Beispiel #2
0
    def on_entity_packet(self, packet):
        if self.entity_id is None:
            return True

        if self.entity_data is None:
            self.entity_data = create_entity_data()
            self.server.entities[self.entity_id] = self.entity_data

        mask = packet.update_entity(self.entity_data)
        self.entity_data.mask |= mask
        if not self.has_joined and getattr(self.entity_data, 'name', None):
            self.on_join()
            return True

        result = True
        self.scripts.call('on_entity_update', mask=mask)
        # XXX clean this up
        if entity.is_pos_set(mask):
            if self.on_pos_update() is False:
                result = False
        if entity.is_mode_set(mask):
            self.scripts.call('on_mode_update')
        if entity.is_class_set(mask):
            self.scripts.call('on_class_update')
        if entity.is_name_set(mask):
            self.scripts.call('on_name_update')
        if entity.is_multiplier_set(mask):
            self.scripts.call('on_multiplier_update')
        if entity.is_level_set(mask):
            self.scripts.call('on_level_update')
        if entity.is_equipment_set(mask):
            self.scripts.call('on_equipment_update')
        if entity.is_skill_set(mask):
            self.scripts.call('on_skill_update')
        if entity.is_appearance_set(mask):
            self.scripts.call('on_appearance_update')
        if entity.is_charged_mp_set(mask):
            self.scripts.call('on_charged_mp_update')
        if entity.is_flags_set(mask):
            self.scripts.call('on_flags_update')
        if entity.is_consumable_set(mask):
            self.scripts.call('on_consumable_update')
        return result
Beispiel #3
0
    def on_entity_packet(self, packet):
        if self.entity is None:
            self.entity = self.world.create_entity(self.entity_id)
            self.entity.connection = self

        mask = packet.update_entity(self.entity)
        self.entity.mask |= mask
        if not self.has_joined and getattr(self.entity, 'name', None):
            self.on_join()
            return

        self.scripts.call('on_entity_update', mask=mask)
        # XXX clean this up
        if entitydata.is_pos_set(mask):
            self.on_pos_update()
        if entitydata.is_vel_set(mask):
            if self.mounted_entity:
                self.mount(None)
        if entitydata.is_mode_set(mask):
            self.scripts.call('on_mode_update')
        if entitydata.is_class_set(mask):
            self.scripts.call('on_class_update')
        if entitydata.is_name_set(mask):
            self.scripts.call('on_name_update')
        if entitydata.is_multiplier_set(mask):
            self.scripts.call('on_multiplier_update')
        if entitydata.is_level_set(mask):
            self.scripts.call('on_level_update')
        if entitydata.is_equipment_set(mask):
            self.scripts.call('on_equipment_update')
        if entitydata.is_skill_set(mask):
            self.scripts.call('on_skill_update')
        if entitydata.is_appearance_set(mask):
            self.scripts.call('on_appearance_update')
        if entitydata.is_charged_mp_set(mask):
            self.scripts.call('on_charged_mp_update')
        if entitydata.is_flags_set(mask):
            self.scripts.call('on_flags_update')
        if entitydata.is_consumable_set(mask):
            self.scripts.call('on_consumable_update')
Beispiel #4
0
    def on_entity_packet(self, packet):
        if self.entity is None:
            self.entity = self.world.create_entity(self.entity_id)
            self.entity.connection = self

        mask = packet.update_entity(self.entity)
        self.entity.mask |= mask
        if not self.has_joined and getattr(self.entity, 'name', None):
            self.on_join()
            return

        self.scripts.call('on_entity_update', mask=mask)
        # XXX clean this up
        if entitydata.is_pos_set(mask):
            self.on_pos_update()
        if entitydata.is_vel_set(mask):
            if self.mounted_entity:
                self.mount(None)
        if entitydata.is_mode_set(mask):
            self.scripts.call('on_mode_update')
        if entitydata.is_class_set(mask):
            self.scripts.call('on_class_update')
        if entitydata.is_name_set(mask):
            self.scripts.call('on_name_update')
        if entitydata.is_multiplier_set(mask):
            self.scripts.call('on_multiplier_update')
        if entitydata.is_level_set(mask):
            self.scripts.call('on_level_update')
        if entitydata.is_equipment_set(mask):
            self.scripts.call('on_equipment_update')
        if entitydata.is_skill_set(mask):
            self.scripts.call('on_skill_update')
        if entitydata.is_appearance_set(mask):
            self.scripts.call('on_appearance_update')
        if entitydata.is_charged_mp_set(mask):
            self.scripts.call('on_charged_mp_update')
        if entitydata.is_flags_set(mask):
            self.scripts.call('on_flags_update')
        if entitydata.is_consumable_set(mask):
            self.scripts.call('on_consumable_update')
Beispiel #5
0
    def on_entity_packet(self, packet):
        if self.entity_data is None:
            self.entity_data = create_entity_data()
            self.server.entities[self.entity_id] = self.entity_data

        mask = packet.update_entity(self.entity_data)
        self.entity_data.mask |= mask
        if not self.has_joined and getattr(self.entity_data, 'name', None):
            self.on_join()
            return

        self.scripts.call('on_entity_update', mask=mask)
        # XXX clean this up
        if entity.is_pos_set(mask):
            self.scripts.call('on_pos_update')
        if entity.is_mode_set(mask):
            self.scripts.call('on_mode_update')
        if entity.is_class_set(mask):
            self.scripts.call('on_class_update')
        if entity.is_name_set(mask):
            self.scripts.call('on_name_update')
        if entity.is_multiplier_set(mask):
            self.scripts.call('on_multiplier_update')
        if entity.is_level_set(mask):
            self.scripts.call('on_level_update')
        if entity.is_equipment_set(mask):
            self.scripts.call('on_equipment_update')
        if entity.is_skill_set(mask):
            self.scripts.call('on_skill_update')
        if entity.is_appearance_set(mask):
            self.scripts.call('on_appearance_update')
        if entity.is_charged_mp_set(mask):
            self.scripts.call('on_charged_mp_update')
        if entity.is_flags_set(mask):
            self.scripts.call('on_flags_update')
        if entity.is_consumable_set(mask):
            self.scripts.call('on_consumable_update')