Plugins: server plugins know the map and hear it change

On a dedicated server reskate.level.current() was empty and level_loaded and level_unloading never
fired, so a server plugin could not tell which map ran or that it had changed. The server's
plugins are now told the map's level each tick, named as players' games name it (a destination's
level, after its "|"). When the server changes the map, they hear level_unloading for the old one
and level_loaded for the new one, as a game's plugins do; players load it after.

dingosdk_server_plugin_tests checks level.current() and both events across a map change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hs7xxJDf6SDcQUaXnzmtL5
This commit is contained in:
Robin MoellerandClaude Opus 5.5 committed 2026-10-22 20:38:22 +02:00
1 parent 45d4c64c75
commit fd5f95467f
4 files changed
+36

No files matched your search

+5
View File
@@ -240,6 +240,11 @@ void Host::fetching(Guest &guest) {
}
std::string Host::invite() const { return format_invite({id_, secret_}); }
std::string Host::map_name() const { return map_label(config_.map); }
std::string Host::map_level() const {
const auto destination = map_destination(config_.map);
const auto split = destination.find('|');
return split == std::string::npos ? destination : destination.substr(split + 1);
}
std::string Host::wire_map_label() const { // players without the map's mod still see its name
auto label = map_name();
cut_text(label, max_member_name);