It would be good to allow hosting of custom maps in private lobbies, for experimentation, testing and so on.
The maps hosted this way must be safe, so, no code, no ability to inject anything into the game. There are two obvious way to approach this:
- Online packer that builds functional map archive from some base information and images uploaded by user.
- Online verification, that unpacks (and repacks) the archive, and then validates every single file that for correctness and string adherence to acceptable values.
Both of those require some new online service that will handle that (authentication and some limit on number of maps per/time period required).
After we have safe map
Below is just an idea of implementation based on preliminary research, other implementations are possible.
Once we have safe maps, we can likely host them in regular CDN, maybe with some TTL or something, or maybe it won't matter: we can start with just using existing CDN. To upload to existing CDN, the online service would just have to put the new file in the upload GCS bucket and that's it.
To get the game actually hosted on the game server, in current infra, I imagine player:
- Create map and upload
- Creating private match
- Calling custom command e.g.
!setvirtualmap Custom My Map 1.1
- If map exists, and is available, it will be loaded in the lobby and downloaded by players.
For that we will need a custom SPADS plugin that will register new command setvirtualmap that does something like:
- Switch on ghost maps
- Validate map name to see if it's allowed e.g. check against some HTTP endpoint, or in some locally pushed config file
- Call something like
$spads->saveMapHash($mapName,$currentSpringVersion,1); (saveMapHash is available SPADS) to get the map into ghost set.
- Call
!set map $mapName
On any other map switch, the plugin should use pre-command hook to disable allowing ghost maps, to not allow to pick any other arbitrary map. Setting ghost map should be only from allowed set, and not e.g. picking old maps that were in the past on server.
It would be good to allow hosting of custom maps in private lobbies, for experimentation, testing and so on.
The maps hosted this way must be safe, so, no code, no ability to inject anything into the game. There are two obvious way to approach this:
Both of those require some new online service that will handle that (authentication and some limit on number of maps per/time period required).
After we have safe map
Below is just an idea of implementation based on preliminary research, other implementations are possible.
Once we have safe maps, we can likely host them in regular CDN, maybe with some TTL or something, or maybe it won't matter: we can start with just using existing CDN. To upload to existing CDN, the online service would just have to put the new file in the upload GCS bucket and that's it.
To get the game actually hosted on the game server, in current infra, I imagine player:
!setvirtualmap Custom My Map 1.1For that we will need a custom SPADS plugin that will register new command
setvirtualmapthat does something like:$spads->saveMapHash($mapName,$currentSpringVersion,1);(saveMapHashis available SPADS) to get the map into ghost set.!set map $mapNameOn any other map switch, the plugin should use pre-command hook to disable allowing ghost maps, to not allow to pick any other arbitrary map. Setting ghost map should be only from allowed set, and not e.g. picking old maps that were in the past on server.