widelands / wl_addons_server

Provides the add-ons server and all add-ons for the Widelands game.
https://www.widelands.org
Other
6 stars 4 forks source link

Auto-Import Website Maps #118

Closed Noordfrees closed 5 days ago

Noordfrees commented 2 years ago

The add-ons server should be able to autogenerate an add-on for each map on the website's Maps section, to allow downloading website-uploaded maps in the add-ons manager.


This could be handled by frequently (every day or so) running a function from the sync thread that checks for any not-yet-imported entries in the maps database and generates an add-on for each of them.

Data about all maps and all their details is readily available in the website database. A map's files (the .wmf for the map, .png for the minimap) are publicly available and can be downloaded with a curl request.


Complications:


frankystone commented 2 years ago

Currently there is a category Map sets, will there be an additional category Single Maps?

Can't help myself but having maps as add-on(s) doesn't work well yet. The reasons are:

Maybe the workflow for packing a map as addon can be simplified. E.g. add a menu entry in the editors Main menu Publish this map as add-on. But the downsides of the the first point above still remain.

I try to look at all stuff from a players point of view, that's all...

frankystone commented 2 years ago

I am thinking about having best of both worlds.

Installing maps via the game is a nice feature. But displaying (single) maps with its information isn't nice (yet). Displaying maps is better on the website. Also it is much easier to upload a map on the website.

How about adding a new UI "Maps" in the game which shows maps with its information, gathered from the website Database? Including a button for easy download (without a player has to know where to save the map). Uploading a new map is done via the website like before, or, don't know if it is feasible, add a button for uploading a map inside the game, which uploads the map and stores all information in the website database.

The thing is: I have no clue about where to put a probably new UI "Maps" :-D

Noordfrees commented 2 years ago
bunnybot commented 10 months ago

Assigned to Nordfriese

bunnybot commented 10 months ago

NordfrieseMirrored from Codeberg On Sun Jan 28 10:41:32 CET 2024, Benedikt Straub (Nordfriese) wrote:


I now have a functional WL branch locally and a corresponding server branch running on alpha that allows you to view and download website maps.

I would like to provide more integration so the download counter is incremented and you can also vote and comment from the add-ons client as you would on the website. So two questions:

<@>frankystone <@>janus

grafik

bunnybot commented 10 months ago

frankystoneMirrored from Codeberg On Sun Jan 28 16:45:16 CET 2024, (frankystone) wrote:


I would like to provide more integration so the download counter is incremented and you can also vote and comment from the add-ons client as you would on the website. So two questions:

  • Is it acceptable to give the add-ons server write permission to the website database? (currently it is read-only)

I think we should only have one program which have write access to the website database. I fear otherwise there might be two processes writing at the same time which can lead to misbehavior. On the other side i think maria-db should handle such things correctly, but i am not sure though.

  • Will Django pick up changes automatically? I am especially concerned about maps ratings, where we have one table which links a map ID to a rating ID and another table that links rating IDs to multiple individual votes. Is it enough to change the individual user vote entry, or do we need to recompute the redundant entries for number of votes and average vote as well?

On the website we use a third party app called django.star-ratings which does the average calculation after a rating has been saved to the database. This is done by sending a django post-save signal, which is sent by django-star-ratings. I think just adding a vote directly in the corresponding database table wouldn't trigger the signal and no average calculating is executed.

I'll try to contact janus over IRC.