Exemplo n.º 1
0
def _read_demolish(bitstream):
    result = {}
    atk_present = _read_bool(bitstream)
    result['atk'] = _read_int(bitstream)
    vic_present = _read_bool(bitstream)
    result['vic'] = _read_int(bitstream)
    result['atk_vec'] = read_serialized_vector(bitstream)
    result['atk_vec'] = read_serialized_vector(bitstream)
    return result
def _read_demolish(bitstream):
    result = {}
    atk_present = _read_bool(bitstream)
    result['atk'] = _read_int(bitstream)
    vic_present = _read_bool(bitstream)
    result['vic'] = _read_int(bitstream)
    result['atk_vec'] = read_serialized_vector(bitstream)
    result['atk_vec'] = read_serialized_vector(bitstream)
    return result
Exemplo n.º 3
0
def _read_rigid_body_state(bitstream):
    flag = bitstream.read(BOOL)
    position = read_serialized_vector(bitstream)
    rotation = read_float_vector(bitstream)
    result = {'flag': flag, 'pos': position, 'rot': rotation}
    if not flag:  # Totally not sure about this
        result['vec1'] = read_serialized_vector(bitstream)
        result['vec2'] = read_serialized_vector(bitstream)
    return result
def _read_rigid_body_state(bitstream):
    flag = bitstream.read(BOOL)
    position = read_serialized_vector(bitstream)
    rotation = read_float_vector(bitstream)
    result = {'flag': flag,
              'pos': position,
              'rot': rotation}
    if not flag:  # Totally not sure about this
        result['vec1'] = read_serialized_vector(bitstream)
        result['vec2'] = read_serialized_vector(bitstream)
    return result
Exemplo n.º 5
0
 def _parse_new_actor(self, netstream, objects):
     actor = {}
     actor['flag'] = netstream.read(BOOL)
     type_id = reverse_bytewise(netstream.read('bits:32')).uintle
     type_name = objects[type_id]
     if 'TheWorld' in type_name:  # World types are Vector Less
         return type_name, actor
     actor['vector'] = read_serialized_vector(netstream)
     if 'Ball_Default' in type_name or 'Car_Default' in type_name:
         actor['rotation'] = read_byte_vector(netstream)
     return type_name, actor
Exemplo n.º 6
0
 def _parse_new_actor(self, netstream, objects):
     actor = {}
     actor['flag'] = netstream.read(BOOL)
     type_id = reverse_bytewise(netstream.read('bits:32')).uintle
     type_name = objects[type_id]
     if 'TheWorld' in type_name:  # World types are Vector Less
         return type_name, actor
     actor['vector'] = read_serialized_vector(netstream)
     if 'Archetypes.Ball' in type_name or 'Car_Default' in type_name:
         actor['rotation'] = read_byte_vector(netstream)
     return type_name, actor
Exemplo n.º 7
0
    def _parse_new_actor(self, actor, netstream, objects, propertymapper):
        actor['state'] = 'new'
        actor['flag'] = netstream.read(BOOL)
        actor['type_id'] = _read_int(netstream)
        actor['type_name'] = objects[actor['type_id']]
        actor['class_name'] = propertymapper._arch_to_class(actor['type_name'])

        if actor['class_name'].startswith('.'):
            actor['class_name'] = 'TAGame{}'.format(actor['class_name'])

        if actor['class_name'] in ['TAGame.CrowdActor_TA', 'TAGame.CrowdManager_TA', 'TAGame.VehiclePickup_Boost_TA', 'Core.Object']:
            return actor

        actor['position'] = read_serialized_vector(netstream)

        if actor['class_name'] in ['TAGame.Ball_TA', 'TAGame.Car_TA', 'TAGame.Car_Season_TA']:
            actor['rotation'] = read_byte_vector(netstream)

        return actor
Exemplo n.º 8
0
    def _parse_new_actor(self, actor, netstream, objects, propertymapper):
        actor['state'] = 'new'
        actor['flag'] = netstream.read(BOOL)
        actor['type_id'] = _read_int(netstream)
        actor['type_name'] = objects[actor['type_id']]
        actor['class_name'] = propertymapper._arch_to_class(actor['type_name'])

        if actor['class_name'].startswith('.'):
            actor['class_name'] = 'TAGame{}'.format(actor['class_name'])

        if actor['class_name'] in [
                'TAGame.CrowdActor_TA', 'TAGame.CrowdManager_TA',
                'TAGame.VehiclePickup_Boost_TA', 'Core.Object'
        ]:
            return actor

        actor['position'] = read_serialized_vector(netstream)

        if actor['class_name'] in [
                'TAGame.Ball_TA', 'TAGame.Car_TA', 'TAGame.Car_Season_TA'
        ]:
            actor['rotation'] = read_byte_vector(netstream)

        return actor
def _read_location(bitstream):
    return read_serialized_vector(bitstream)
def _read_explosion(bitstream):
    nogoal = _read_bool(bitstream)
    if nogoal:
        return nogoal, read_serialized_vector(bitstream)
    return nogoal, _read_int(bitstream), read_serialized_vector(bitstream)
Exemplo n.º 11
0
def _read_location(bitstream):
    return read_serialized_vector(bitstream)
Exemplo n.º 12
0
def _read_explosion(bitstream):
    nogoal = _read_bool(bitstream)
    if nogoal:
        return nogoal, read_serialized_vector(bitstream)
    return nogoal, _read_int(bitstream), read_serialized_vector(bitstream)