thepeacockproject / Peacock

The Peacock Project is a HITMAN™ World of Assassination trilogy server replacement.
https://thepeacockproject.org
GNU Affero General Public License v3.0
383 stars 59 forks source link

Cannot enter planning page of contracts whose JSONs are not found locally #382

Closed moonysolari closed 7 months ago

moonysolari commented 9 months ago

e.g. Trending, most played last week, and contract search. Broken by #362.

RDIL commented 9 months ago

I'm thinking that if we fetch something from the official servers, we should save it. I'd consider this intended behavior, as we shouldn't try and fetch everything on every single route.

moonysolari commented 9 months ago

Around 10-20 contract JSONs are fetched when the respective contract menus are loaded, and the user will only play a few of them as they browse through the menus. It's a bit wasteful to save all contract JSONs fetched when most of them will not be played.

RDIL commented 9 months ago

IOI does not want us making mass requests to their servers - if we're going to fetch something, we need to not re-fetch it unless absolutely needed.

grappigegovert commented 9 months ago

Around 10-20 contract JSONs are fetched when the respective contract menus are loaded, and the user will only play a few of them as they browse through the menus. It's a bit wasteful to save all contract JSONs fetched when most of them will not be played.

Contract jsons are only about 10KiB each (pretty printed, so even less minimized), so even storing hundreds of them will only take up a couble of megs