forked from ddnet/ddnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
List available maps as console arguments for
sv_map
/change_map
Send list of all maps available in the `maps` folder on the server to authed clients, using version 18.7 or newer, that have access to the `sv_map` or `change_map` command, so the maps can be shown as console arguments for these commands. Progress of maplist sending is showing similar to rcon command sending progress. The maplist sending is implemented similar to the rcon command sending. Each tick the maplist for one particular client is updated. The maplist will be sent only after all rcon commands have been sent. The server will send the following new system messages: - `NETMSG_MAPLIST_ADD`: Contains up to 10 map names as strings which should be added to the list of maps in the given order. Currently the maximum size of map names on the server is 128 bytes, so this should always fit in one packet. Packing 10 map names into one packet instead of only 1 reduces overhead and makes maplist sending 10x faster (since it is currently bound to server ticks). When sending only 1 map name per message, sending the entire list of ddnet-maps would take almost an hour on a LAN server. When sending 10 map names per message it only takes a few minutes. The client is expected to unpack as many strings as possible from the message, as it may contain less than 10 map names in case of the last message and this also allows forward compatibility if we try to pack more map names depending on whether they will fit (which is not easily possible with `CPacker` at the moment). - `NETMSG_MAPLIST_GROUP_START`: Indicates the start of maplist sending. Contains an integer that specifies the number of expected maplist entries for progress reporting. The previous maplist should be cleared when receiving this message. - `NETMSG_MAPLIST_GROUP_END`: Indicates the end of maplist sending. The server sorts the maplist after initializing it and sends the entries in order. Clients therefore do not need to perform their own sorting of the maplist. The maplist is initialized when starting the server. The command `reload_maplist` is added to reload the maplist manually. This does not include handling for `access_level` being to change the access level for the `sv_map` or `change_map` command after a client has already logged in. Active maplist sending will not be canceled if the access level for all map commands is removed and it will not be started if access to a map command is granted while already logged in. Clients should logout and login again to get the updated maplist. This does not include support for the 0.7 maplist protocol. Closes 5727.
- Loading branch information
Showing
9 changed files
with
278 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.