Skip to content

Commit

Permalink
Merge remote-tracking branch 'wdesgardin/feature/disable-networked-so…
Browse files Browse the repository at this point in the history
…unds'
  • Loading branch information
blattersturm committed Jun 6, 2023
2 parents a8d84df + 8d65590 commit 1e32597
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
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ std::shared_ptr<ConVar<fx::OneSyncState>> g_oneSyncVar;
std::shared_ptr<ConVar<bool>> g_oneSyncPopulation;
std::shared_ptr<ConVar<bool>> g_oneSyncARQ;

static std::shared_ptr<ConVar<bool>> g_networkedSoundsEnabledVar;
static bool g_networkedSoundsEnabled;

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

Expand Down Expand Up @@ -6756,6 +6759,14 @@ std::function<bool()> fx::ServerGameState::GetGameEventHandler(const fx::ClientS
return GetRequestControlEventHandler(client, std::move(buffer));
}

if(eventType == NETWORK_PLAY_SOUND_EVENT)
{
return []()
{
return g_networkedSoundsEnabled;
};
}

if (isReply)
{
switch(eventType)
Expand Down Expand Up @@ -6835,6 +6846,8 @@ static InitFunction initFunction([]()
return;
}

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

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

1 comment on commit 1e32597

@MatinHQ
Copy link

@MatinHQ MatinHQ commented on 1e32597 Jun 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally Thanks!

Please sign in to comment.