-
Notifications
You must be signed in to change notification settings - Fork 186
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
FP issue on beta world #1059
Comments
Daran arbeiten wir gerade: #1044 Inno überträgt die FP im Inventar nun nicht mehr beim Öffnen eines LGs. Diese müssen in Zukunft über das Inventar getrackt werden. |
- fixed the 'GreatBuildingsService.getConstruction' handler (left the code for legacy but added an if condition which is never true unless Inno add the availablePackagesForgePointSum field back to the json response) - added inventory tracking for spending FPs for research - inventory tracking for spending FPs for GBs still works as before (so the FP stock is correctly updated when FPs from the stock are added to a GB)
This reverts commit f3c84c9.
- fixed the 'GreatBuildingsService.getConstruction' handler (left the code for legacy but added an if condition which is never true unless Inno add the availablePackagesForgePointSum field back to the json response) - added inventory tracking for spending FPs for research - inventory tracking for spending FPs for GBs still works as before (so the FP stock is correctly updated when FPs from the stock are added to a GB) - TODO: update the stock after an investment is returned (when a GB was leveled)
I have a fix for the zeroing (of the FP Stock when a player open a GB window) and for tracking the FP stock when used for research. Still needs to update when a GB is level (and invested FPs are returned to the stock)... then I guess I'll refactor it out to its own file p.s. ... and I'm sorry I accidentally committed it to an existing pull request so had to revert |
@scibuff The Fix for 0 is the easy part, but tracking GBs that are leveled is a lot more complicated and requires permanent listening on the websocket. I think I already have a fix working, but stillneeds a bit of testing. |
@andrgin Yeah. I saw that the Infobox does it but the amount of return FPs is not always correct. Research tracking is a bit of a pain but i think I have that figured out too. I haven't looked at all at packs from quests but I hope that's as simple as figuring out the correct class/service names and the json path to the data |
It is a bit more complicated in this case as the previous implementation had several problems: |
@andrgin OK, so just to summarize, after the initial inventory stock value is set, we need to track all + and - of FP packs.
The scenarios where FP backs are added:
|
I just pushed my fix to beta branch. The important listeners are: |
Update: |
I get several bugs with the update actually. Once the counter is off, it keeps adding/subtracting values from the wrong number. I think it might be a good idea to just take all the code into a separate file which is what I've done (without changing any of your code and just printing the FP Stock value to the console). To test the gb leveling is a pain though (it's a slow time of the day). |
I have 2 more fixes: I will test with the current version tomorrow and see if my values stay correct. Btw. we have a new debug flag. Set Infoboard.DebugWebsocket to true and all websocket communication is dumped to the Console |
Yeah, I'm seeing quite a bit of count duplication. Especially, if you level a GB yourself or you get two GB leveled one after another @andrgin I think your |
All my progress is here in my branch for this bug |
I think I got it working in all cases now (subject to more testing). Branch updated |
3.) Nice to know, but I dont think we can rely too much on that. 4.) I have not thought of that yet. localStorage is not an option, because if the player has used another PC or the app before, NoticeIndicators will be wrong. 5.) Yes I think with that many events to handle another file would be a good idea. 6.) I think using the NoticeIndicators will be a much bigger pain than I thought. I will try using newReward instead. Now that we know we will receive getItem via Websocket, we can be 100% sure the item is in MainParser.Inventory. All we have to do is split the reward into the 3 packets (if reward is uneven there must be one 5FP packet, rest is 10FP and 2FP. Then we can search the items per name. |
Update: |
In any case, I'm creating a pull request as my current code seems to be handling majority of these issues (the only other problem I saw a while back - so might be fixed already - was several GBs leveling in a quick succession which threw the calculations off, but that was a dozen commits ago and it's very hard to replicate) |
BlueprintService.newReward gives the total amount of FP. As long as you know you have all FP packets in inventory you can find them and split the total amount into packets. Every reward needs to be at least 5FP. There is noe reward below that. |
Good idea, that should work as long as the decomposition into packs is guaranteed i.e. that 10fp reward will always be given as 1x10pack and not 5x2pack or 2x5pack, which I believe is the case. |
Oh, the issue with using |
@andrgin Managed to get this working properly without the newReward and Indicators (don't need to track new packs at all). It was damn simple - stupid Inno just sends Inventory services through regular services (json) as well as raw WS so we need to handle both:
|
Wow I really missed the getItemAmount via Websocket. It really makes sense now. |
I noticed a few days ago that when I entered a GB, the fps from the tool would disappear, it says I have no fps, even though I do.
The text was updated successfully, but these errors were encountered: