Skip to content
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

Add custom map pool support for dedicated servers #21179

Merged
merged 3 commits into from Nov 5, 2023

Conversation

pchote
Copy link
Member

@pchote pchote commented Oct 31, 2023

#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
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.

Copy link
Member

@PunkPun PunkPun left a comment

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

Copy link
Member

@PunkPun PunkPun left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM

@pchote
Copy link
Member Author

pchote commented Nov 2, 2023

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
Copy link
Member

PunkPun commented Nov 2, 2023

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

@PunkPun
Copy link
Member

PunkPun commented Nov 2, 2023

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

@pchote
Copy link
Member Author

pchote commented Nov 2, 2023

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
Copy link
Member Author

pchote commented Nov 2, 2023

Updated.

@PunkPun PunkPun merged commit b3ee355 into OpenRA:bleed Nov 5, 2023
3 checks passed
@PunkPun
Copy link
Member

PunkPun commented Nov 5, 2023

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