Ejemplo n.º 1
0
def generate_device_info(account):
    ios8 = ('8.0', '8.0.1', '8.0.2', '8.1', '8.1.1', '8.1.2', '8.1.3', '8.2',
            '8.3', '8.4', '8.4.1')
    ios9 = ('9.0', '9.0.1', '9.0.2', '9.1', '9.2', '9.2.1', '9.3', '9.3.1',
            '9.3.2', '9.3.3', '9.3.4', '9.3.5')
    # 10.0 was only for iPhone 7 and 7 Plus, and is rare
    ios10 = ('10.0.1', '10.0.2', '10.0.3', '10.1', '10.1.1', '10.2', '10.2.1',
             '10.3', '10.3.1', '10.3.2', '10.3.3')

    devices = tuple(IPHONES.keys())
    account['model'] = choice(devices)

    account['id'] = uuid4().hex

    if account['model'] in ('iPhone9,1', 'iPhone9,2', 'iPhone9,3',
                            'iPhone9,4'):
        account['iOS'] = choice(ios10)
    elif account['model'] in ('iPhone8,1', 'iPhone8,2'):
        account['iOS'] = choice(ios9 + ios10)
    elif account['model'] == 'iPhone8,4':
        # iPhone SE started on 9.3
        account['iOS'] = choice(('9.3', '9.3.1', '9.3.2', '9.3.3', '9.3.4',
                                 '9.3.5') + ios10)
    else:
        account['iOS'] = choice(ios8 + ios9 + ios10)

    return account
Ejemplo n.º 2
0
def generate_device_info(account):
    ios9 = ('9.0', '9.0.1', '9.0.2', '9.1', '9.2', '9.2.1', '9.3', '9.3.1',
            '9.3.2', '9.3.3', '9.3.4', '9.3.5')
    ios10 = ('10.0.1', '10.0.2', '10.1', '10.1.1', '10.2', '10.2.1', '10.3',
             '10.3.1', '10.3.2', '10.3.3')
    ios11 = ('11.0', '11.0.1', '11.0.2', '11.0.3', '11.1', '11.1.1', '11.1.2',
             '11.2', '11.2.1', '11.2.2', '11.2.5', '11.2.6')

    devices = tuple(IPHONES.keys())
    account['model'] = choice(devices)

    account['id'] = uuid4().hex

    # 5 & 5C : iOS 9 & 10
    if account['model'] in ('iPhone5,1', 'iPhone5,2', 'iPhone5,3',
                            'iPhone5,4'):
        account['iOS'] = choice(ios9 + ios10)
    # 5S, 6, 6+, 6S, 6S+, SE, 7, 7+ : iOS 10 & 11
    if account['model'] in ('iPhone6,1', 'iPhone6,2', 'iPhone7,1', 'iPhone7,2',
                            'iPhone8,1', 'iPhone8,2', 'iPhone8,4', 'iPhone9,1',
                            'iPhone9,2', 'iPhone9,3', 'iPhone9,4'):
        account['iOS'] = choice(ios10 + ios11)
    # others : iOS 11
    else:
        account['iOS'] = choice(ios11)

    return account
Ejemplo n.º 3
0
async def test_raid(notifier, options):
    """Generate a notification for a fake pokemon spawn.
    """
    now_ms = int(time.time() * 1000)

    rawfort = FortData(
        id="ABCXYZ",
        latitude=options.latitude,
        longitude=options.longitude,
        owned_by_team=randint(0, 3),
        type=GYM,
    )
    rawfort.gym_display.slots_available = randint(0, 5)

    rawfort.raid_info.raid_spawn_ms = now_ms
    rawfort.raid_info.raid_battle_ms = now_ms + options.remaining * 500
    rawfort.raid_info.raid_end_ms = now_ms + options.remaining * 1000
    rawfort.raid_info.raid_level = randint(1, 5)

    if options.event == 'raid':
        rawfort.raid_info.raid_pokemon.pokemon_id = options.dexno
        rawfort.raid_info.raid_pokemon.cp = randint(10, 2844)
        rawfort.raid_info.raid_pokemon.move_1 = choice(MOVE_NUMBERS)
        rawfort.raid_info.raid_pokemon.move_2 = choice(MOVE_NUMBERS)

    normalfort = dict(
        name="Some Random Gym",
        desc="A gym that does not actually exist.",
        url="https://upload.wikimedia.org/wikipedia/commons/a/a9/Example.jpg",
    )

    return await notifier.raid_notify(normalfort, rawfort)
Ejemplo n.º 4
0
def generate_device_info(account):
    #ios9 = ('9.0', '9.0.1', '9.0.2', '9.1', '9.2', '9.2.1', '9.3', '9.3.1', '9.3.2', '9.3.3', '9.3.4', '9.3.5')
    # 10.0 was only for iPhone 7 and 7 Plus, and is rare
    #ios10 = ('10.0.1', '10.0.2', '10.0.3', '10.1', '10.1.1', '10.2', '10.2.1', '10.3', '10.3.1', '10.3.2', '10.3.3')
    ios11 = ('11.0.1', '11.0.2', '11.0.3', '11.1', '11.1.1')

    devices = tuple(IPHONES.keys())
    account['model'] = choice(devices)

    account['id'] = uuid4().hex

    account['iOS'] = choice(ios11)

    return account
Ejemplo n.º 5
0
def generate_device_info(account):
    ios8 = ('8.0', '8.0.1', '8.0.2', '8.1', '8.1.1', '8.1.2', '8.1.3', '8.2', '8.3', '8.4', '8.4.1')
    ios9 = ('9.0', '9.0.1', '9.0.2', '9.1', '9.2', '9.2.1', '9.3', '9.3.1', '9.3.2', '9.3.3', '9.3.4', '9.3.5')
    ios10 = ('10.0', '10.0.1', '10.0.2', '10.0.3', '10.1', '10.1.1', '10.2', '10.2.1')

    devices = tuple(IPHONES.keys())
    account['model'] = choice(devices)

    account['id'] = uuid4().hex

    if account['model'] in ('iPhone9,1', 'iPhone9,2',
                            'iPhone9,3', 'iPhone9,4'):
        account['iOS'] = choice(ios10)
    elif account['model'] in ('iPhone8,1', 'iPhone8,2', 'iPhone8,4'):
        account['iOS'] = choice(ios9 + ios10)
    else:
        account['iOS'] = choice(ios8 + ios9 + ios10)

    return account
Ejemplo n.º 6
0
async def test_spawn(notifier, options):
    """Generate a notification for a fake pokemon spawn.
    """
    remain_ms = options.remaining * 1000
    now_ms = int(time.time() * 1000)

    rawwild = WildPokemon(
        encounter_id=93253523,
        last_modified_timestamp_ms=now_ms,
        latitude=options.latitude,
        longitude=options.longitude,
        spawn_point_id='58eef93',
        time_till_hidden_ms=remain_ms,
    )

    if conf.SPAWN_ID_INT:
        spawnpt_id = int(rawwild.spawn_point_id, 16)
    else:
        spawnpt_id = rawwild.spawn_point_id,

    normalmon = {
        'encounter_id': rawwild.encounter_id,
        'spawn_id': spawnpt_id,
        'pokemon_id': options.dexno,
        'time_till_hidden': remain_ms // 1000,
        'lat': options.latitude,
        'lon': options.longitude,
        'individual_attack': randint(0, 15),
        'individual_defense': randint(0, 15),
        'individual_stamina': randint(0, 15),
        'seen': now_ms // 1000,
        'move_1': choice(MOVE_NUMBERS),
        'move_2': choice(MOVE_NUMBERS),
        'gender': randint(1, 3),
        'height': uniform(0.3, 4.0),
        'weight': uniform(1, 600),
        'valid': True,
        'expire_timestamp': (now_ms + remain_ms) // 1000
    }

    return await notifier.spawn_notify(normalmon, rawwild, randint(1, 2))
Ejemplo n.º 7
0
def generate_device_info(account):
    ios8 = ('8.0', '8.0.1', '8.0.2', '8.1', '8.1.1', '8.1.2', '8.1.3', '8.2',
            '8.3', '8.4', '8.4.1')
    ios9 = ('9.0', '9.0.1', '9.0.2', '9.1', '9.2', '9.2.1', '9.3', '9.3.1',
            '9.3.2', '9.3.3', '9.3.4', '9.3.5')
    ios10 = ('10.0', '10.0.1', '10.0.2', '10.0.3', '10.1', '10.1.1', '10.2',
             '10.2.1', '10.3', '10.3.1', '10.3.2')

    devices = tuple(IPHONES.keys())
    account['model'] = choice(devices)

    account['id'] = uuid4().hex

    if account['model'] in ('iPhone9,1', 'iPhone9,2', 'iPhone9,3',
                            'iPhone9,4'):
        account['iOS'] = choice(ios10)
    elif account['model'] in ('iPhone8,1', 'iPhone8,2', 'iPhone8,4'):
        account['iOS'] = choice(ios9 + ios10)
    else:
        account['iOS'] = choice(ios8 + ios9 + ios10)

    return account
Ejemplo n.º 8
0
 def __init__(self):
     self.avatar = 1
     self.avatar_hair = 'AVATAR_f_hair_default_{}'.format(randint(0, 5))
     self.avatar_eyes = 'AVATAR_f_eyes_{}'.format(randint(0, 4))
     self.skin = randint(0, 3)
     self.avatar_hat = choice(self.hats)
     self.avatar_necklace = choice(self.necklaces)
     self.avatar_shirt = 'AVATAR_f_shirt_default_{}'.format(randint(0,8))
     self.avatar_backpack = choice(self.bags)
     self.avatar_gloves = choice(self.gloves)
     self.avatar_belt = choice(self.belts)
     self.avatar_pants = choice(self.bottoms)
     self.avatar_socks = choice(self.socks)
     self.avatar_shoes = choice(self.footwear)
     self.avatar_glasses = "AVATAR_f_glasses_empty"
Ejemplo n.º 9
0
 def __init__(self):
     self.avatar = 0
     self.avatar_hair = 'AVATAR_m_hair_default_{}'.format(randint(0, 5))
     self.avatar_eyes = 'AVATAR_m_eyes_{}'.format(randint(0, 4))
     self.skin = randint(0, 3)
     self.avatar_hat = choice(self.hats)
     self.avatar_shirt = choice(self.shirts)
     self.avatar_backpack = choice(self.bags)
     self.avatar_gloves = choice(self.gloves)
     self.avatar_pants = "AVATAR_m_pants_default_0"
     self.avatar_socks = choice(self.socks)
     self.avatar_shoes = choice(self.footwear)
     self.avatar_glasses = "AVATAR_m_glasses_empty"
Ejemplo n.º 10
0
now = time.time()

pokemon = {
    'encounter_id': 93253523,
    'spawn_id': 3502935,
    'pokemon_id': pokemon_id,
    'form': args.form,
    'time_till_hidden': tth,
    'lat': lat,
    'lon': lon,
    'individual_attack': randint(0, 15),
    'individual_defense': randint(0, 15),
    'individual_stamina': randint(0, 15),
    'seen': now,
    'move_1': choice(MOVES),
    'move_2': choice(MOVES),
    'valid': True,
    'expire_timestamp': now + tth
}

notifier = Notifier()

loop = get_event_loop()

if loop.run_until_complete(notifier.notify(pokemon, randint(1, 2))):
    print('Success')
else:
    print('Failure')

SessionManager.close()
Ejemplo n.º 11
0
    tth = uniform(89, 3599)

now = time.time()

pokemon = {
    'encounter_id': 93253523,
    'spawn_id': 3502935,
    'pokemon_id': pokemon_id,
    'time_till_hidden': tth,
    'lat': lat,
    'lon': lon,
    'individual_attack': randint(0, 15),
    'individual_defense': randint(0, 15),
    'individual_stamina': randint(0, 15),
    'seen': now,
    'move_1': choice(MOVES),
    'move_2': choice(MOVES),
    'valid': True,
    'expire_timestamp': now + tth
}

notifier = Notifier()

loop = get_event_loop()

if loop.run_until_complete(notifier.notify(pokemon, randint(1, 2))):
    print('Success')
else:
    print('Failure')

SessionManager.close()
Ejemplo n.º 12
0
def new():
    NewAvatar = choice((FemaleAvatar, MaleAvatar))
    return vars(NewAvatar())