28 if (language.Steam == steamLanguage)
37 : _clientConVars(clientConVars), _translations(translations)
40 if (player.IsBot() || !_translations.PlayerLanguage(player.Slot()).empty())
45 _clientConVars.Query(player.Slot(),
"cl_language",
46 [
this](
int slot,
ClientConVarStatus status, std::string_view, std::string_view value) {
47 if (status != ClientConVarStatus::Answered)
53 if (!code.empty() && _translations.PlayerLanguage(slot).empty())
55 _translations.SetPlayerLanguage(slot, code);
Asks a connected client what one of its own convars is set to.
ClientLanguage(PlayerManager &players, ClientConVars &clientConVars, Translations &translations)
The roster: every connected player, and the signals for the connection lifecycle.
Event< Player & > FullyConnected
A player finished connecting (post ClientFullyConnect) - the first point their name and replicated co...
One connected player, owned by PlayerManager for the length of the connection.
Localization system. Loads one JSON file per language; nested objects flatten into dotted keys (categ...
static constexpr std::array SteamLanguages
static std::string_view ToLanguageCode(std::string_view steamLanguage)
ClientConVarStatus
How the client answered a convar query (CCLCMsg_RespondCvarValue::status_code).