dphuang2 / PoGoBag

Analyze and share your Pokémon through a locally run server! Official Site access has been stopped as of 12/23/2016
146 stars 49 forks source link

cannot use since gen 2 appeared #103

Open Muzik4Machines opened 7 years ago

Muzik4Machines commented 7 years ago

` when :pokemon_data

Set poke_id

        poke_id = i[:pokemon_id].capitalize.to_s
        # To deal with Nidoran and Mr. Mime naming
        poke_id = 'Nidoran♀' if poke_id.match('Nidoran_female')
        poke_id = 'Nidoran♂' if poke_id.match('Nidoran_male')

`

i got this when trying to log in after catching a pichu

Muzik4Machines commented 7 years ago

the terminal shows this when it breaks

`Completed 500 Internal Server Error in 8873ms (ActiveRecord: 5259.9ms)

NoMethodError (undefined method `capitalize' for 172:Fixnum):

app/helpers/sessions_helper.rb:74:in block (2 levels) in store_data' app/helpers/sessions_helper.rb:46:ineach' app/helpers/sessions_helper.rb:46:in block in store_data' app/helpers/sessions_helper.rb:45:ineach' app/helpers/sessions_helper.rb:45:in store_data' app/controllers/sessions_controller.rb:14:increate' Rendering /Users/tb/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout Rendering /Users/tb/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0/lib/action_dispatch/middleware/templates/rescues/_source.html.erb Rendered /Users/tb/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0/lib/action_dispatch/middleware/templates/rescues/_source.html.erb (3.1ms) Rendering /Users/tb/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb Rendered /Users/tb/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.9ms) Rendering /Users/tb/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb Rendered /Users/tb/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.0ms) Rendered /Users/tb/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (71.4ms)

`

dphuang2 commented 7 years ago

Since I do not have any account with Gen 2 pokemon's I can't test a new version. When I get the chance to catch one I will work on an update. @lotze or @matenia?

Throwmeaway commented 7 years ago

I mostly created the account for posting here because I love the application and would like to see it move forward.. To me it simply looks like the database is missing the proper entries or other resources for the new Pokémon, but as I am not able to install the application at the moment I can't tell for sure. Couldn't you just release the new version and let people test it?

brynte commented 7 years ago

Will you try to find a solution to this or should we migrate to some other app?

juggalokyle commented 7 years ago

Just hatched some Gen 2 Pokemon today and now I can't check my Pokemon's IV's.

Gladiator10864 commented 7 years ago

FYI, I'm running into the same issues you guys are. I would too like to see this fixed if possible but in the meantime, you are still at least able to view your bag excluding the gen 2 Pokemon. After logging in, you will receive that error. After that, simply reload the home page of the site and click search, select your profile and it will still load your page. It will also display a card for the unknown Pokemon with no data. Odd thing is that I have 1 extra card than I do Pokemon now though, not sure where that comes from. I believe user ThrowMeAway has the right idea though. There is simply not any information for the pokeID number available.

Gladiator10864 commented 7 years ago

Also, second look and there appears to be a new commit to the code on Dec. 15. I have not updated my server in a while as it broke last time I tried and haven't had to time to play around with fixing things again.

Can anyone confirm that this newest change fixed the gen 2 issue?

Also, although people have been civil about it so far, I would like to mention that dphuang has put in their voluntary time towards this project and has zero obligations to continue a project like this. I greatly appreciate the work they put forth so far and will continue to appreciate any further work anyone puts into this project. I only say this after reading some of the comments left by users of FPM when it first went down. So again, I just want to thank you all for your time and effort put forth to making PoGO an enjoyable game.

cjw77 commented 7 years ago

I have the most recent version, but no success with gen 2. Getting on for now after transferring the gen 2 I hatched. Tried hacking code to add a line to models/pokemon.rb and level_calc.coffee for the single new one in case that would fix it. Same error: NoMethodError (undefined method `capitalize' for 174:Fixnum):

I don't know enough ruby to assign an arbitrary poke_id when the method fails - i.e. when the poke_id is in gen 2.

iKristy commented 7 years ago

Same as above, waiting for an update that would fix the Gen 2 additions as PoGoBag unfortunately doesn't work – after logging in I get an empty profile with no Pokémon 😕

G-E-N-E commented 7 years ago

I fixed my local server to work with Magby at least.

app/helpers/sessions_helper.rb Before poke_id = i[:pokemon_id].capitalize.to_s

After if i[:pokemon_id].respond_to?(:capitalize) poke_id = i[:pokemon_id].capitalize.to_s else poke_id = @@pokemon_hash[i[:pokemon_id].to_s].capitalize.to_s end

..added Magby base stats to pokemon model app/models/pokemon.rb

[240, [163, 108, 90, nil]]

If you really want to have the image you can just add the 240.png image of Magby to the assets location I imagine.

Should work for all gen 2's if you add their base stats if they follow the same input pattern as Magby which was the :pokemon_id as a number instead of as a text string.

Ditto's i[:pokemon_id] => "DITTO" Magby's i[:pokemon_id] => 240

So my solution was to check if you could capitalize before assigning.

Gladiator10864 commented 7 years ago

Thank you G-E-N-E!!! I finally found some time to implement this and everything seems to be working again.