Exemple #1
0
 def serialize(self, stream):
     """
     Serializes the packet
     """
     stream.write(c_int64(self.objid))
     stream.write(c_uint32(self.unknown1))
     stream.write(self.character_name, allocated_length=33)
     stream.write(self.character_unapproved_name, allocated_length=33)
     stream.write(c_bool(self.is_name_rejected))
     stream.write(c_bool(self.free_to_play))
     stream.write(self.unknown2)
     stream.write(c_uint32(self.shirt_color))
     stream.write(c_uint32(self.shirt_style))
     stream.write(c_uint32(self.pants_color))
     stream.write(c_uint32(self.hair_style))
     stream.write(c_uint32(self.hair_color))
     stream.write(c_uint32(self.lh))
     stream.write(c_uint32(self.rh))
     stream.write(c_uint32(self.eyebrows))
     stream.write(c_uint32(self.eyes))
     stream.write(c_uint32(self.mouth))
     stream.write(c_uint32(self.unknown3))
     stream.write(c_uint16(self.last_zone))
     stream.write(c_uint16(self.last_instance))
     stream.write(c_uint32(self.last_clone))
     stream.write(c_uint64(self.last_login))
     stream.write(c_uint16(len(self.equipped_items)))
     for item in self.equipped_items:
         stream.write(c_uint32(item))
Exemple #2
0
 def serialize(self, stream: WriteStream):
     """
     Serializes the game version
     """
     stream.write(c_uint16(self.major))
     stream.write(c_uint16(self.current))
     stream.write(c_uint16(self.minor))
Exemple #3
0
    def serialize(self, stream):
        """
        Serializes the packet
        """
        super().serialize(stream)

        stream.write(c_uint16(self.zone_id))
        stream.write(c_uint16(self.map_instance))
        stream.write(c_uint32(self.map_clone))
        stream.write(c_uint32(self.map_checksum))
        stream.write(c_uint16(self.unknown1))
        stream.write(c_float(self.pos.x))
        stream.write(c_float(self.pos.y))
        stream.write(c_float(self.pos.z))
        stream.write(c_uint32(self.is_activity))
Exemple #4
0
    def serialize(self, stream):
        """
        Serializes the game message
        """
        super().serialize(stream)

        stream.write(c_int64(self.objid))
        stream.write(c_uint16(self.message_id))

        if self.extra_data:
            if isinstance(self.extra_data, bytes):
                stream.write(self.extra_data)
            else:
                stream.write(bytes(self.extra_data))
Exemple #5
0
 def serialize(self, stream: WriteStream):
     """
     Serializes the packet
     """
     super().serialize(stream)
     stream.write(c_uint8(self.auth_status_code))
     stream.write(CString(self.unknown, allocated_length=33))
     stream.write(CString(self.unknown1, allocated_length=33*7))
     stream.write(self.client_version)
     stream.write(self.auth_token, allocated_length=33)
     stream.write(CString(self.char_ip, allocated_length=33))
     stream.write(CString(self.chat_ip, allocated_length=33))
     stream.write(c_uint16(self.char_port))
     stream.write(c_uint16(self.chat_port))
     stream.write(CString(self.unknown2, allocated_length=33))
     stream.write(CString(self.unknown3, allocated_length=37))
     stream.write(c_uint32(self.unknown4))
     stream.write(CString(self.localization, allocated_length=3))
     stream.write(c_bool(self.new_subscriber))
     stream.write(c_bool(self.is_ftp))
     stream.write(c_uint64(self.unknown5))
     stream.write(self.permission_error, length_type=c_uint16)
     # TODO: Implement stamps
     stream.write(c_uint32(4))
Exemple #6
0
    def __init__(self, *args):
        super().__init__(*args)
        self.luz = LUZReader(ZONE_LUZ[ZONE_IDS[self.server.type]], self.server.type)
        for scene in self.luz.scenes:
            for obj in scene.objects:
                if obj.spawner is not None:
                    trigger = obj.config.get('renderDisabled')
                    components = obj.components

                    if trigger:
                        trigger_comp = Trigger()

                        components.append(trigger_comp)

                    replica = BaseData(obj.objid, obj.lot, obj.name, trigger=trigger, spawner=obj.spawner, scale=obj.scale, components=components)

                    wstr = WriteStream()
                    wstr.write(c_uint8(0x24))
                    wstr.write(c_bit(True))
                    wstr.write(c_uint16(0))
                    replica.write_construction(wstr)

                    self.server.repman.construct(replica, True)
Exemple #7
0
 def serialize(self, stream):
     stream.write(c_uint8(0x53))
     stream.write(c_uint16(self.remote_conn_id))
     stream.write(c_uint32(self.packet_id))
     stream.write(c_uint8(0x00))
Exemple #8
0
 def serialize(self, stream: WriteStream):
     super().serialize(stream)
     stream.write(CString(self.ip, allocated_length=33))
     stream.write(c_uint16(self.port))
     stream.write(c_bool(self.mythran_notification))
Exemple #9
0
    def write_construction(self, stream):
        self.pre_creation(stream)

        stream.write(c_bit(False))  # NOTE: unknown flag(?)
        stream.write(c_bit(False))  # NOTE: unknown flag
        stream.write(c_bit(False))  # NOTE: same as above
        stream.write(c_bit(False))  # NOTE: same here

        stream.write(c_uint32(self.hair_color))
        stream.write(c_uint32(self.hair_style))
        stream.write(c_uint32(0))  # NOTE: unknown(?)
        stream.write(c_uint32(self.shirt_color))
        stream.write(c_uint32(self.pants_color))
        stream.write(c_uint32(0))  # NOTE: unknown(?)
        stream.write(c_uint32(0))  # NOTE: unknown(?)
        stream.write(c_uint32(self.eyebrows))
        stream.write(c_uint32(self.eyes))
        stream.write(c_uint32(self.mouth))

        stream.write(c_uint64(self.account_id))
        stream.write(c_uint64(self.llog))
        stream.write(c_uint64(0))  # NOTE: unknown
        stream.write(c_uint64(self.lego_score))

        stream.write(c_bit(self.free_to_play))

        stream.write(c_uint64(self.currency_collected))
        stream.write(c_uint64(self.bricks_collected))
        stream.write(c_uint64(self.smashables_smashed))
        stream.write(c_uint64(self.quick_builds))
        stream.write(c_uint64(self.enemies_smashed))
        stream.write(c_uint64(self.rockets_used))
        stream.write(c_uint64(self.missions_completed))
        stream.write(c_uint64(self.pets_tamed))
        stream.write(c_uint64(self.imagination_powerups))
        stream.write(c_uint64(self.life_powerups))
        stream.write(c_uint64(self.armor_powerups))
        stream.write(c_uint64(self.distance_traveled))
        stream.write(c_uint64(self.times_smashed))
        stream.write(c_uint64(self.damage_taken))
        stream.write(c_uint64(self.damage_healed))
        stream.write(c_uint64(self.armor_repaired))
        stream.write(c_uint64(self.imagination_restored))
        stream.write(c_uint64(self.imagination_used))
        stream.write(c_uint64(self.distance_driven))
        stream.write(c_uint64(self.airborne_time_race_car))
        stream.write(c_uint64(self.racing_imagination_powerups))
        stream.write(c_uint64(self.racing_imagination_crates_smashed))
        stream.write(c_uint64(self.race_car_boosts))
        stream.write(c_uint64(self.race_car_wrecks))
        stream.write(c_uint64(self.racing_smashables_smashed))
        stream.write(c_uint64(self.races_finished))
        stream.write(c_uint64(self.first_place_finishes))

        stream.write(c_bit(False))  # NOTE: unknown(?)

        stream.write(c_bit(self.rocket))

        if self.rocket:
            stream.write(c_uint16(self.rocket_characters))
            # TODO: LDF rocket info

        self.post_creation(stream)