| 709 | } |
| 710 | |
| 711 | ConfigResult 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 | |
| 739 | void Translator::OnSourceModLevelChange(const char *mapName) |
| 740 | { |
nothing calls this directly
no test coverage detected