Skip to content

Commit

Permalink
tweak(gamestate/server): allow blocking phone explosion events
Browse files Browse the repository at this point in the history
  • Loading branch information
Ciastekbatak authored and blattersturm committed Oct 13, 2023
1 parent 37fa83b commit 0fa9842
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions code/components/citizen-server-impl/src/state/ServerGameState.cpp
Expand Up @@ -90,6 +90,9 @@ std::shared_ptr<ConVar<bool>> g_oneSyncARQ;
static std::shared_ptr<ConVar<bool>> g_networkedSoundsEnabledVar;
static bool g_networkedSoundsEnabled;

static std::shared_ptr<ConVar<bool>> g_networkedPhoneExplosionsEnabledVar;
static bool g_networkedPhoneExplosionsEnabled;

static std::shared_ptr<ConVar<int>> g_requestControlVar;
static std::shared_ptr<ConVar<int>> g_requestControlSettleVar;

Expand Down Expand Up @@ -6778,6 +6781,14 @@ std::function<bool()> fx::ServerGameState::GetGameEventHandler(const fx::ClientS
};
}

if (eventType == REQUEST_PHONE_EXPLOSION_EVENT)
{
return []()
{
return g_networkedPhoneExplosionsEnabled;
};
}

if (isReply)
{
switch(eventType)
Expand Down Expand Up @@ -6859,6 +6870,8 @@ static InitFunction initFunction([]()

g_networkedSoundsEnabledVar = instance->AddVariable<bool>("sv_enableNetworkedSounds", ConVar_None, true, &g_networkedSoundsEnabled);

g_networkedPhoneExplosionsEnabledVar = instance->AddVariable<bool>("sv_enableNetworkedPhoneExplosions", ConVar_None, false, &g_networkedPhoneExplosionsEnabled);

g_requestControlVar = instance->AddVariable<int>("sv_filterRequestControl", ConVar_None, (int)RequestControlFilterMode::NoFilter, (int*)&g_requestControlFilterState);
g_requestControlSettleVar = instance->AddVariable<int>("sv_filterRequestControlSettleTimer", ConVar_None, 30000, &g_requestControlSettleDelay);

Expand Down

0 comments on commit 0fa9842

Please sign in to comment.