Skip to content

Add custom map pool support for dedicated servers#21179

Merged
PunkPun merged 3 commits into
OpenRA:bleedfrom
pchote:server-mappool
Nov 5, 2023
Merged

Add custom map pool support for dedicated servers#21179
PunkPun merged 3 commits into
OpenRA:bleedfrom
pchote:server-mappool

Conversation

@pchote

@pchote pchote commented Oct 31, 2023

Copy link
Copy Markdown
Member

#19323 resurrected and updated for translations etc:

This PR implements two big usability improvements for the ladder and similarly focused servers.

The first (for server hosts) is a new Server.MapPool setting to limit the maps that are allowed to be used on the server without resorting to modifying the local files and disabling RC queries. This setting takes a comma separated list of map UIDs, which may either be local maps or queried from the RC.

The second (for players) is that the map browser on these servers will now show the map pool, including maps that aren't installed (again, queried from the RC). This removes any confusion about "Map was not found on server" errors, and allows players to install maps directly ingame instead of having to deal with manually installing map packs.

I think that with this PR we now also implement enough to close #3357. There are too many UI issues around searching and filtering the RC content to realistically support a full ingame browser, so relying on server hosts to curate map packs that players are able to download ingame strikes a good compromise.

This takes a list of map UIDs which may be locally installed or hosted
on the resource center. If any maps aren't found, startup will be
delayed by up to 10 seconds while it attempts to query the resource
center.
Maps that aren't installed are queried from the resource center.
Comment on lines +42 to +44
// The default null means "no map restriction" while an empty set means "all maps restricted"
public HashSet<string> ServerMapPool = null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We really need to have a better system to store stuff (with proper lifecycle), now we are storing it here because its convenient.

@PunkPun PunkPun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The system bugs out if you include maps from other mods in the map pool. Let's say in RA I include https://resource.openra.net/maps/55010/ then it allows me to install that TD map. Afterwards after I enter map chooser the map isn't installed, and when I exit it wants me to install again

@PunkPun PunkPun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM

@pchote

pchote commented Nov 2, 2023

Copy link
Copy Markdown
Member Author

To fix that, we'd have to enforce that maps must be available and queryable at server-start time (right now, it only requires that they are available and queryable at player-selects-map time). This would mean that servers may start crashing (no available maps) on startup if the RC is offline. Are we happy to make that tradeoff, compared to just telling server operators to not do that?

@PunkPun

PunkPun commented Nov 2, 2023

Copy link
Copy Markdown
Member

What about instead just not allowing clients to download the maps & not showing them in map chooser

@PunkPun

PunkPun commented Nov 2, 2023

Copy link
Copy Markdown
Member

It could also log errors for the server provider instead of crashing

@pchote

pchote commented Nov 2, 2023

Copy link
Copy Markdown
Member Author

It does log errors; the issue is that if we want to validate the map hashes server-side then they need to be available, and if none are available the server won't have any valid maps to choose from.

Handling this client-side by making MapCache properly validate remote maps, the same way it does local maps, should be doable.

@pchote

pchote commented Nov 2, 2023

Copy link
Copy Markdown
Member Author

Updated.

@PunkPun PunkPun merged commit b3ee355 into OpenRA:bleed Nov 5, 2023
@PunkPun

PunkPun commented Nov 5, 2023

Copy link
Copy Markdown
Member

Changelogs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow map chooser and replay browser to index the content site

4 participants