MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / OnSourceModConfigChanged

Method OnSourceModConfigChanged

core/logic/Translator.cpp:711–737  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

709}
710
711ConfigResult Translator::OnSourceModConfigChanged(const char *key,
712 const char *value,
713 ConfigSource source,
714 char *error,
715 size_t maxlength)
716{
717 if (strcasecmp(key, "ServerLang") == 0)
718 {
719 if (source == ConfigSource_Console)
720 {
721 unsigned int index;
722 if (!GetLanguageByCode(value, &index))
723 {
724 ke::SafeSprintf(error, maxlength, "Language code \"%s\" is not registered", value);
725 return ConfigResult_Reject;
726 }
727
728 m_ServerLang = index;
729 } else {
730 strncopy(m_InitialLang, value, sizeof(m_InitialLang));
731 }
732
733 return ConfigResult_Accept;
734 }
735
736 return ConfigResult_Ignore;
737}
738
739void Translator::OnSourceModLevelChange(const char *mapName)
740{

Callers

nothing calls this directly

Calls 1

strncopyFunction · 0.70

Tested by

no test coverage detected