mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-08 01:39:36 +00:00
1
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "ServerConfigPanel.h"
|
||||
|
||||
#include <vgui/ISystem.h>
|
||||
|
||||
using namespace vgui;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
//-----------------------------------------------------------------------------
|
||||
CServerConfigPanel::CServerConfigPanel(vgui::Panel *parent, const char *name, const char *mod) : CVarListPropertyPage(parent, name)
|
||||
{
|
||||
SetBounds(0, 0, 500, 170);
|
||||
LoadControlSettings("Admin\\ServerConfigPanel.res", "PLATFORM");
|
||||
|
||||
// load our rules
|
||||
if (!LoadVarList("scripts/GameServerConfig.vdf"))
|
||||
{
|
||||
//!! no local mod info, need to load from server
|
||||
//!! always load from server if on a remote connection
|
||||
}
|
||||
|
||||
m_flUpdateTime = 0.0f;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Destructor
|
||||
//-----------------------------------------------------------------------------
|
||||
CServerConfigPanel::~CServerConfigPanel()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Reset data
|
||||
//-----------------------------------------------------------------------------
|
||||
void CServerConfigPanel::OnResetData()
|
||||
{
|
||||
RefreshVarList();
|
||||
// update every minute
|
||||
m_flUpdateTime = (float)system()->GetFrameTime() + (60 * 1.0f);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Checks to see if data needs to be refreshed
|
||||
//-----------------------------------------------------------------------------
|
||||
void CServerConfigPanel::OnThink()
|
||||
{
|
||||
if (m_flUpdateTime < system()->GetFrameTime())
|
||||
{
|
||||
OnResetData();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user