Skip to content

Commit

Permalink
Revert "Pokestops / Evolves / Transfers Logged to DB" (#4239)
Browse files Browse the repository at this point in the history
  • Loading branch information
solderzzc authored Aug 19, 2016
1 parent 580460a commit 3dfe476
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 33 deletions.
10 changes: 3 additions & 7 deletions pokemongo_bot/cell_workers/evolve_pokemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
from pokemongo_bot.inventory import Pokemon
from pokemongo_bot.item_list import Item
from pokemongo_bot.base_task import BaseTask
from pokemongo_bot.datastore import Datastore

class EvolvePokemon(Datastore, BaseTask):

class EvolvePokemon(BaseTask):
SUPPORTED_TASK_API_VERSION = 1
def __init__(self, bot, config):
super(EvolvePokemon, self).__init__(bot, config)


def initialize(self):
self.api = self.bot.api
self.evolve_all = self.config.get('evolve_all', [])
Expand Down Expand Up @@ -115,8 +113,6 @@ def _execute_pokemon_evolve(self, pokemon, cache):
'xp': '?'
}
)
with self.bot.database as conn:
conn.execute('''INSERT INTO evolve_log (pokemon, iv, cp) VALUES (?, ?, ?)''', (pokemon.name, pokemon.iv, pokemon.cp))
awarded_candies = response_dict.get('responses', {}).get('EVOLVE_POKEMON', {}).get('candy_awarded', 0)
inventory.candies().get(pokemon.pokemon_id).consume(pokemon.evolution_cost - awarded_candies)
inventory.pokemons().remove(pokemon.unique_id)
Expand Down
5 changes: 0 additions & 5 deletions pokemongo_bot/cell_workers/migrations/evolve_log.py

This file was deleted.

5 changes: 0 additions & 5 deletions pokemongo_bot/cell_workers/migrations/pokestop_log.py

This file was deleted.

5 changes: 0 additions & 5 deletions pokemongo_bot/cell_workers/migrations/transfer_log.py

This file was deleted.

4 changes: 0 additions & 4 deletions pokemongo_bot/cell_workers/spin_fort.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,12 @@ def work(self):
'items': items_awarded
}
)
with self.bot.database as conn:
conn.execute('''INSERT INTO pokestop_log (pokestop, exp, items) VALUES (?, ?, ?)''', (fort_name, str(experience_awarded), str(items_awarded)))
else:
self.emit_event(
'pokestop_empty',
formatted='Found nothing in pokestop {pokestop}.',
data={'pokestop': fort_name}
)
with self.bot.database as conn:
conn.execute('''INSERT INTO pokestop_log (pokestop) VALUES (?)''', (fort_name))
pokestop_cooldown = spin_details.get(
'cooldown_complete_timestamp_ms')
self.bot.fort_timeouts.update({fort["id"]: pokestop_cooldown})
Expand Down
9 changes: 2 additions & 7 deletions pokemongo_bot/cell_workers/transfer_pokemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@
from pokemongo_bot.human_behaviour import action_delay
from pokemongo_bot.base_task import BaseTask
from pokemongo_bot.inventory import Pokemons, Pokemon, Attack
from pokemongo_bot.datastore import Datastore

class TransferPokemon(Datastore, BaseTask):
class TransferPokemon(BaseTask):
SUPPORTED_TASK_API_VERSION = 1

def __init__(self, bot, config):
super(TransferPokemon, self).__init__(bot, config)

def initialize(self):
self.transfer_wait_min = self.config.get('transfer_wait_min', 1)
self.transfer_wait_max = self.config.get('transfer_wait_max', 4)
Expand Down Expand Up @@ -178,8 +175,6 @@ def release_pokemon(self, pokemon):
'dps': pokemon.moveset.dps
}
)
with self.bot.database as conn:
conn.execute('''INSERT INTO transfer_log (pokemon, iv, cp) VALUES (?, ?, ?)''', (pokemon.name, pokemon.iv, pokemon.cp))
action_delay(self.transfer_wait_min, self.transfer_wait_max)

def _get_release_config_for(self, pokemon):
Expand Down

0 comments on commit 3dfe476

Please sign in to comment.