[Dedicated] Actually fix sv_lanOnly
This commit is contained in:
parent
d28dc6ecc4
commit
219a10d6a0
@ -253,8 +253,14 @@ namespace Components
|
|||||||
|
|
||||||
void Dedicated::Heartbeat()
|
void Dedicated::Heartbeat()
|
||||||
{
|
{
|
||||||
int masterPort = Dvar::Var("masterPort").get<int>();
|
// Do not send a heartbeat if sv_lanOnly is set to true
|
||||||
const char* masterServerName = Dvar::Var("masterServerName").get<const char*>();
|
if (Dedicated::SVLanOnly.get<bool>())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto masterPort = Dvar::Var("masterPort").get<int>();
|
||||||
|
const auto* masterServerName = Dvar::Var("masterServerName").get<const char*>();
|
||||||
|
|
||||||
Network::Address master(Utils::String::VA("%s:%u", masterServerName, masterPort));
|
Network::Address master(Utils::String::VA("%s:%u", masterServerName, masterPort));
|
||||||
|
|
||||||
@ -386,12 +392,6 @@ namespace Components
|
|||||||
{
|
{
|
||||||
static Utils::Time::Interval interval;
|
static Utils::Time::Interval interval;
|
||||||
|
|
||||||
// Do not send an heartbeat if sv_lanOnly is set to true
|
|
||||||
if (Dedicated::SVLanOnly.get<bool>())
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Dvar::Var("sv_maxclients").get<int>() > 0 && interval.elapsed(2min))
|
if (Dvar::Var("sv_maxclients").get<int>() > 0 && interval.elapsed(2min))
|
||||||
{
|
{
|
||||||
interval.update();
|
interval.update();
|
||||||
|
Loading…
Reference in New Issue
Block a user