-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CP and Level to db, webhook, and frontend #277
base: develop
Are you sure you want to change the base?
Conversation
.gitmodules
Outdated
@@ -1,4 +1,4 @@ | |||
[submodule "monocle-icons"] | |||
path = monocle/static/monocle-icons | |||
url = https://github.com/Noctem/monocle-icons.git | |||
url = https://github.com/Imaginum/monocle-icons.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change back to original repo
monocle/static/monocle-icons
<< remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duh.... good catch.
|
mysql migration, add this 2 column manually to mystery_sightings, sightings @nickmhc
|
I need someone to use the map and make a report bot with showing cp iv and moveset |
monocle/static/js/main.js
Outdated
} else { | ||
content += 'IV: ' + item.atk + ' atk, ' + item.def + ' def, ' + item.sta + ' sta<br>'; | ||
content += 'CP: ' + item.cp + ' | Lvl: ' + item.level + '<br>'; | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please replace the tabs with spaces
monocle/web_utils.py
Outdated
@@ -105,6 +105,9 @@ def sighting_to_marker(pokemon, names=POKEMON, moves=MOVES, damage=DAMAGE): | |||
marker['move2'] = moves[move2] | |||
marker['damage1'] = damage[move1] | |||
marker['damage2'] = damage[move2] | |||
if pokemon.cp: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it you add the cp column it should be filled with null
or 0
, so I'd guess this is not needed as it would only be a "if there still are legacy pokemon" which should disapear after 30-60 mins
web_sanic.py
Outdated
@@ -177,6 +177,9 @@ def sighting_to_marker(pokemon, names=POKEMON, moves=MOVES, damage=DAMAGE, trash | |||
marker['move2'] = moves[move2] | |||
marker['damage1'] = damage[move1] | |||
marker['damage2'] = damage[move2] | |||
if pokemon.cp: | |||
marker['cp'] = pokemon.cp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this should be "pokemon['cp'] and pokemon['cp_multiplier']
Make sure you are importing your calc_pokemon_level func as well
Hello i am looking for a developer to prepare discord coordinate bot. |
Hello i am looking for a developer to prepare discord coordinate bot. |
Can this be approved? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra space at Line 794 of worker.py
@tallypokemap it would be awesome if you could also include height and weight and form for unowns into the db so it could be shown on the map and in the webhook. this is helpful for getting the Fisherman and Youngster badges :-) |
monocle/static/js/main.js
Outdated
} else { | ||
content += 'IV: ' + item.atk + ' atk, ' + item.def + ' def, ' + item.sta + ' sta<br>'; | ||
content += 'CP: ' + item.cp + ' | Lvl: ' + item.level + '<br>'; | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation
monocle/db.py
Outdated
) test | ||
group by spawn_id | ||
''') | ||
return query |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please create a own branch for this PR or not merge other stuff until it is closed?
monocle/db.py
Outdated
@@ -225,6 +225,8 @@ class Sighting(Base): | |||
sta_iv = Column(TINY_TYPE) | |||
move_1 = Column(SmallInteger) | |||
move_2 = Column(SmallInteger) | |||
cp = Column(SmallInteger) | |||
cp_multiplier = Column(FLOAT_TYPE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to save the level here.
That way cp_multiplier
=> level
is computed once, otherwise you are doing it once for every visitor (in web.py
/ web_sanic.py
) besides an extra one for the webhook.
besides that a SmallInteger
should use less space than a FLOAT_TYPE
@Bart274 that shouldn't be done as a column each, as it only needs more resources - I think we need a extra_details column or so besides that it should go in an own PR |
@tallypokemap besides the requested changes it would be nice if you'd merge the commits together |
931a6ab
to
2981baf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just as a little hint git commit --amend
will let you update your last commit
but you will then have to push with git push -f
monocle/web_utils.py
Outdated
@@ -5,7 +5,7 @@ | |||
|
|||
from monocle import sanitized as conf | |||
from monocle.db import get_forts, Pokestop, session_scope, Sighting, Spawnpoint | |||
from monocle.utils import Units, get_address | |||
from monocle.utils import Units, get_address, calc_pokemon_level |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that shouldn't be needed anylonger
For those updating from a previous version:
and replace with
|
298d122
to
a0779ba
Compare
How far is this to be merged ? Just tried it and aint working |
9253892
to
c2e5193
Compare
I just tried this and it doesn't work for level information anymore |
Workers, but dont display the correct cp and level of pokemons @tallypokemap |
@nickmhc You might need to check your logs to see what is going on. I still have level working just fine on my map. |
@tallypokemap yeap i use all accts lv 30+, but still have this issue.i have verifie all accts, all accts detect larvitar and snorlax, they dont are sb or warnings |
59f2524
to
a550a64
Compare
CP and Pokemon Level are as useful as IV in that if you level 30 accounts they are nice to report. Since we are reporting IV, it makes sense to report CP and Level as well. Credit to Asner who's code helped me add CP.