mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
parent
195b2a11d7
commit
b8744a9ab8
@ -991,6 +991,56 @@ void RCON_Disconnect_f(const CCommand& args)
|
||||
}
|
||||
#endif // !DEDICATED
|
||||
|
||||
#ifndef CLIENT_DLL
|
||||
|
||||
static const char* s_LanguageNames[] = {
|
||||
"english",
|
||||
"french",
|
||||
"german",
|
||||
"italian",
|
||||
"japanese",
|
||||
"polish",
|
||||
"russian",
|
||||
"spanish",
|
||||
"schinese",
|
||||
"tchinese",
|
||||
"korean"
|
||||
};
|
||||
|
||||
static bool IsValidTextLanguage(const char* pLocaleName)
|
||||
{
|
||||
for (int i = 0; i < SDK_ARRAYSIZE(s_LanguageNames); ++i)
|
||||
{
|
||||
if (strcmp(pLocaleName, s_LanguageNames[i]) == NULL)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void SV_LanguageChanged_f(IConVar* pConVar, const char* pOldString, float flOldValue)
|
||||
{
|
||||
if (ConVar* pConVarRef = g_pCVar->FindVar(pConVar->GetCommandName()))
|
||||
{
|
||||
const char* pNewString = pConVarRef->GetString();
|
||||
|
||||
if (IsValidTextLanguage(pNewString))
|
||||
return;
|
||||
|
||||
// if new text isn't valid but the old value is, reset the value
|
||||
if (IsValidTextLanguage(pOldString))
|
||||
{
|
||||
pConVarRef->SetValue(pOldString);
|
||||
return;
|
||||
}
|
||||
else // this shouldn't really happen, but if neither the old nor new values are valid, set to english
|
||||
pConVarRef->SetValue("english");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
=====================
|
||||
RCON_PasswordChanged_f
|
||||
|
@ -53,6 +53,7 @@ void RCON_Disconnect_f(const CCommand& args);
|
||||
#endif // !DEDICATED
|
||||
void RCON_PasswordChanged_f(IConVar* pConVar, const char* pOldString, float flOldValue);
|
||||
#ifndef CLIENT_DLL
|
||||
void SV_LanguageChanged_f(IConVar* pConVar, const char* pOldString, float flOldValue);
|
||||
void RCON_WhiteListAddresChanged_f(IConVar* pConVar, const char* pOldString, float flOldValue);
|
||||
void RCON_ConnectionCountChanged_f(IConVar* pConVar, const char* pOldString, float flOldValue);
|
||||
void SQVM_ServerScript_f(const CCommand& args);
|
||||
|
@ -89,6 +89,8 @@ ConVar* navmesh_draw_poly_bounds = nullptr;
|
||||
ConVar* navmesh_draw_poly_bounds_inner = nullptr;
|
||||
#endif // !DEDICATED
|
||||
|
||||
ConVar* sv_language = nullptr;
|
||||
|
||||
ConVar* sv_showconnecting = nullptr;
|
||||
ConVar* sv_globalBanlist = nullptr;
|
||||
ConVar* sv_pylonVisibility = nullptr;
|
||||
@ -308,6 +310,8 @@ void ConVar_StaticInit(void)
|
||||
navmesh_draw_poly_bounds = ConVar::StaticCreate("navmesh_draw_poly_bounds" , "-1", FCVAR_DEVELOPMENTONLY, "Draws the bounds of the NavMesh polys.", false, 0.f, false, 0.f, nullptr, "Index: > 0 && < mesh->m_tileCount");
|
||||
navmesh_draw_poly_bounds_inner = ConVar::StaticCreate("navmesh_draw_poly_bounds_inner" , "0" , FCVAR_DEVELOPMENTONLY, "Draws the inner bounds of the NavMesh polys (requires navmesh_draw_poly_bounds).", false, 0.f, false, 0.f, nullptr, "Index: > 0 && < mesh->m_tileCount");
|
||||
#endif // !DEDICATED
|
||||
|
||||
sv_language = ConVar::StaticCreate("sv_language", "english", FCVAR_RELEASE, "Language of the server. Sent to MasterServer for localising error messages", false, 0.f, false, 0.f, SV_LanguageChanged_f, nullptr);
|
||||
sv_showconnecting = ConVar::StaticCreate("sv_showconnecting" , "1", FCVAR_RELEASE, "Logs information about the connecting client to the console.", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
sv_globalBanlist = ConVar::StaticCreate("sv_globalBanlist" , "1", FCVAR_RELEASE, "Determines whether or not to use the global banned list.", false, 0.f, false, 0.f, nullptr, "0 = Disable, 1 = Enable.");
|
||||
sv_pylonVisibility = ConVar::StaticCreate("sv_pylonVisibility", "0", FCVAR_RELEASE, "Determines the visibility to the Pylon master server.", false, 0.f, false, 0.f, nullptr, "0 = Offline, 1 = Hidden, 2 = Public.");
|
||||
|
@ -79,6 +79,7 @@ extern ConVar* navmesh_draw_polys;
|
||||
extern ConVar* navmesh_draw_poly_bounds;
|
||||
extern ConVar* navmesh_draw_poly_bounds_inner;
|
||||
#endif // DEDICATED
|
||||
extern ConVar* sv_language;
|
||||
extern ConVar* sv_showconnecting;
|
||||
extern ConVar* sv_globalBanlist;
|
||||
extern ConVar* sv_pylonVisibility;
|
||||
|
Loading…
x
Reference in New Issue
Block a user