momentum-mod / website

Momentum Mod's main website.
https://momentum-mod.org
MIT License
58 stars 61 forks source link

Generalized Map Versioning #1032

Closed tsa96 closed 1 month ago

tsa96 commented 2 months ago

Closes #1006 Closes #857

Replaces the MapSubmissionVersion table with MapVersion. Map storage is now always using the zone system, even for approved maps. Previously, prior to approval maps, would be stored at submissions/<MapSubmissionVersion UUID ID>.bsp, then upon approval moved to maps/<map name>.bsp. Now, all maps are just stored at maps/<MapVersion UUID ID>.bsp. This makes frontend and game code quite a lot simpler.

Whilst I haven't done admin map updating quite yet (https://github.com/momentum-mod/website/issues/916), this change is essential to that system.

Also, since zones are now always stored on MapVersion, so always requires a join table to fetch, it's a lot easier to avoid fetching the zones JSON unnecessarily, plus I added Prisma's preview "omit" API which simplifies code even more. So https://github.com/momentum-mod/website/issues/857 can be closed in the process.

Checks

tsa96 commented 2 months ago

I'm not sure, but I remember someone on engine side asking for map downloads to have the same file name as a map file that is being downloaded.

Nope not a problem for us, our HTTP downloader code just fetches a big ol' buffer and we can write it wherever.

tsa96 commented 1 month ago

Not a big deal in this case but would prefer you let me merge my PRs @GordiNoki, at least when it's backend changes - when we have corresponding changes in red it's easiest if they all get in at once. If it's something you're waiting on feel free to badger me or nick