Let logic binary access ServerLang value on startup (bug 4675, r=dvander).
This commit is contained in:
parent
c01101dbd0
commit
458378be66
@ -750,6 +750,12 @@ void Translator::OnSourceModAllInitialized()
|
|||||||
{
|
{
|
||||||
AddLanguage("en", "English");
|
AddLanguage("en", "English");
|
||||||
|
|
||||||
|
const char* lang = smcore.GetCoreConfigValue("ServerLang");
|
||||||
|
if (lang)
|
||||||
|
{
|
||||||
|
strncpy(m_InitialLang, lang, sizeof(m_InitialLang));
|
||||||
|
}
|
||||||
|
|
||||||
g_pCorePhrases = CreatePhraseCollection();
|
g_pCorePhrases = CreatePhraseCollection();
|
||||||
g_pCorePhrases->AddPhraseFile("core.phrases");
|
g_pCorePhrases->AddPhraseFile("core.phrases");
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ using namespace SourceMod;
|
|||||||
* Add 1 to the RHS of this expression to bump the intercom file
|
* Add 1 to the RHS of this expression to bump the intercom file
|
||||||
* This is to prevent mismatching core/logic binaries
|
* This is to prevent mismatching core/logic binaries
|
||||||
*/
|
*/
|
||||||
#define SM_LOGIC_MAGIC (0x0F47C0DE - 16)
|
#define SM_LOGIC_MAGIC (0x0F47C0DE - 17)
|
||||||
|
|
||||||
#if defined SM_LOGIC
|
#if defined SM_LOGIC
|
||||||
class IVEngineServer
|
class IVEngineServer
|
||||||
@ -115,6 +115,7 @@ struct sm_core_t
|
|||||||
const char * (*GetGameDescription)();
|
const char * (*GetGameDescription)();
|
||||||
const char * (*GetSourceEngineName)();
|
const char * (*GetSourceEngineName)();
|
||||||
bool (*SymbolsAreHidden)();
|
bool (*SymbolsAreHidden)();
|
||||||
|
const char * (*GetCoreConfigValue)(const char*);
|
||||||
/* Data */
|
/* Data */
|
||||||
ServerGlobals *serverGlobals;
|
ServerGlobals *serverGlobals;
|
||||||
void * serverFactory;
|
void * serverFactory;
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
#include "PlayerManager.h"
|
#include "PlayerManager.h"
|
||||||
#include "AdminCache.h"
|
#include "AdminCache.h"
|
||||||
#include "HalfLife2.h"
|
#include "HalfLife2.h"
|
||||||
|
#include "CoreConfig.h"
|
||||||
|
|
||||||
#if defined _WIN32
|
#if defined _WIN32
|
||||||
#define MATCHMAKINGDS_SUFFIX ""
|
#define MATCHMAKINGDS_SUFFIX ""
|
||||||
@ -176,6 +177,11 @@ static bool symbols_are_hidden()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const char* get_core_config_value(const char* key)
|
||||||
|
{
|
||||||
|
return g_CoreConfig.GetCoreConfigValue(key);
|
||||||
|
}
|
||||||
|
|
||||||
static ServerGlobals serverGlobals;
|
static ServerGlobals serverGlobals;
|
||||||
|
|
||||||
static sm_core_t core_bridge =
|
static sm_core_t core_bridge =
|
||||||
@ -209,6 +215,7 @@ static sm_core_t core_bridge =
|
|||||||
get_game_description,
|
get_game_description,
|
||||||
get_source_engine_name,
|
get_source_engine_name,
|
||||||
symbols_are_hidden,
|
symbols_are_hidden,
|
||||||
|
get_core_config_value,
|
||||||
&serverGlobals
|
&serverGlobals
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user