mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Use 'g_pServer->IsActive()' over 'g_pHostState->m_bActiveGame'
This commit is contained in:
parent
a9aded7fd8
commit
0b49ea1f29
@ -445,7 +445,7 @@ void CBrowser::HostPanel(void)
|
||||
ImGui::Spacing();
|
||||
ImGui::Separator();
|
||||
|
||||
if (!g_pHostState->m_bActiveGame)
|
||||
if (!g_pServer->IsActive())
|
||||
{
|
||||
if (ImGui::Button("Start Server", ImVec2((ImGui::GetWindowSize().x - 10), 32)))
|
||||
{
|
||||
@ -499,7 +499,7 @@ void CBrowser::HostPanel(void)
|
||||
ImGui::InputText("##ServerHost_HostToken", &m_svHostToken, ImGuiInputTextFlags_ReadOnly);
|
||||
}
|
||||
|
||||
if (g_pHostState->m_bActiveGame)
|
||||
if (g_pServer->IsActive())
|
||||
{
|
||||
if (ImGui::Button("Weapon Reparse", ImVec2((ImGui::GetWindowSize().x - 10), 32)))
|
||||
{
|
||||
@ -556,7 +556,7 @@ void CBrowser::UpdateHostingStatus(void)
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> l(g_pServerListManager->m_Mutex);
|
||||
g_pServerListManager->m_HostingStatus = g_pHostState->m_bActiveGame ? EHostStatus_t::HOSTING : EHostStatus_t::NOT_HOSTING; // Are we hosting a server?
|
||||
g_pServerListManager->m_HostingStatus = g_pServer->IsActive() ? EHostStatus_t::HOSTING : EHostStatus_t::NOT_HOSTING; // Are we hosting a server?
|
||||
|
||||
switch (g_pServerListManager->m_HostingStatus)
|
||||
{
|
||||
|
@ -13,6 +13,9 @@
|
||||
#include "tier1/cvar.h"
|
||||
#include "engine/net.h"
|
||||
#include "engine/host_state.h"
|
||||
#ifndef CLIENT_DLL
|
||||
#include "engine/server/server.h"
|
||||
#endif // !CLIENT_DLL
|
||||
#include "vpc/keyvalues.h"
|
||||
#include "pylon.h"
|
||||
#include "listmanager.h"
|
||||
@ -76,7 +79,7 @@ void CServerListManager::LaunchServer(void) const
|
||||
KeyValues::ParsePlaylists(m_Server.m_svPlaylist.c_str());
|
||||
mp_gamemode->SetValue(m_Server.m_svPlaylist.c_str());
|
||||
|
||||
if (g_pHostState->m_bActiveGame)
|
||||
if (g_pServer->IsActive())
|
||||
{
|
||||
ProcessCommand(fmt::format("{:s} \"{:s}\"", "changelevel", m_Server.m_svHostMap).c_str());
|
||||
}
|
||||
|
@ -7,8 +7,10 @@
|
||||
|
||||
#include <core/stdafx.h>
|
||||
#include <tier1/cvar.h>
|
||||
#include <engine/host_state.h>
|
||||
#include <networksystem/pylon.h>
|
||||
#ifndef CLIENT_DLL
|
||||
#include <engine/server/server.h>
|
||||
#endif // !CLIENT_DLL
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Send keep alive request to Pylon Master Server.
|
||||
@ -17,7 +19,7 @@
|
||||
bool KeepAliveToPylon(const NetGameServer_t& netGameServer)
|
||||
{
|
||||
#ifndef CLIENT_DLL
|
||||
if (g_pHostState->m_bActiveGame && sv_pylonVisibility->GetBool()) // Check for active game.
|
||||
if (g_pServer->IsActive() && sv_pylonVisibility->GetBool()) // Check for active game.
|
||||
{
|
||||
string m_szHostToken;
|
||||
string m_szHostRequestMessage;
|
||||
|
Loading…
x
Reference in New Issue
Block a user