Parse trainer data from save file#76
Conversation
|
Looks good, I might ditch the web page in favor of an in-app GUI and display the information there. |
There was a problem hiding this comment.
Realistically it probably won't ever cause problems, but you might want to release buffer when you're done with it:
entralinked/src/main/java/entralinked/model/pkmn/PkmnInfoReader.java
Lines 75 to 77 in abe1b80
There was a problem hiding this comment.
Totally forgot, will change.
This won't cause issues for "personal" setups, but if the plan is to have multiple users (which it is) it could add up.
| public long skipTo(long n) throws IOException { | ||
| return skip(n - pointer); | ||
| } |
There was a problem hiding this comment.
Just curious -- what happens if n - pointer is less than zero? I don't think you can go backwards in an input stream.
There was a problem hiding this comment.
DIdn't bother to check but I imagine it throws the IOException. Will check.
There was a problem hiding this comment.
Actually nevermind, it just won't move according to the implementation of skip in InputStream:
public long skip(long n) throws IOException {
long remaining = n;
int nr;
if (n <= 0) {
return 0;
}
|
I have the changes made locally, pending testing. |
|
Sorry, I've been meaning to take a look at this but have been a little busy lately. |
There was a problem hiding this comment.
I don't think pointer should be static here :P
There was a problem hiding this comment.
Yeah this is 100% wrong. Pretty funny oversight not gonna lie lol.
There was a problem hiding this comment.
Just saw I still haven't changed this lol.
There was a problem hiding this comment.
I tested it on B2W2 and it seems that money & badges are stored at a different location.
Everything else seems to check out, though!
There was a problem hiding this comment.
Awesome! I'll look into making the change for B2W2, do you have a savefile I can test this with?
There was a problem hiding this comment.
Project Pokémon has save files that are useful for testing :)
|
I recently overhauled the UI & figured it might be cool to expand the summary page and display interesting info about the player there :) |
|
Hey! Pushed a rebase to address the conflicts, but still haven't tested anything in BW2. Thanks for the pointer to Project Pokemon, let's see if I have some time tomorrow. I wanna take a look at that new UI, but I think adding these should be a part of a new PR just so it doesn't get too big. Thoughts? |
|
Tested with a Black 2 save, these changes parse the data correctly. Fortunately a very minor change, and the offset was already documented here. |
|
Realized I rebased PkmnInfoReader back to savefile, this fixes it and squashes the commits. |
The PGL profile displayed values like badges and the played time which are currently not parsed by entralinked.
This PR adds those alongside a bunch of other interesting values:
Pending testing with the BW2 games.