core/frame_hooks.cpp
author Michael McKoy <ferret99gt@gmail.com>
Sat Nov 24 03:28:33 2007 +0000 (2007-11-24)
changeset 1719 c9d5e55f0899
parent 1412 a2ca3d22dd71
child 1904 baa051d23eef
permissions -rw-r--r--
The current map played shouldn't appear in MapChooser votes or RTV votes now. It can still be nominated in RTV though.
dvander@1412
     1
/**
dvander@1412
     2
 * vim: set ts=4 :
dvander@1412
     3
 * =============================================================================
dvander@1412
     4
 * SourceMod
dvander@1412
     5
 * Copyright (C) 2004-2007 AlliedModders LLC.  All rights reserved.
dvander@1412
     6
 * =============================================================================
dvander@1412
     7
 *
dvander@1412
     8
 * This program is free software; you can redistribute it and/or modify it under
dvander@1412
     9
 * the terms of the GNU General Public License, version 3.0, as published by the
dvander@1412
    10
 * Free Software Foundation.
dvander@1412
    11
 * 
dvander@1412
    12
 * This program is distributed in the hope that it will be useful, but WITHOUT
dvander@1412
    13
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
dvander@1412
    14
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
dvander@1412
    15
 * details.
dvander@1412
    16
 *
dvander@1412
    17
 * You should have received a copy of the GNU General Public License along with
dvander@1412
    18
 * this program.  If not, see <http://www.gnu.org/licenses/>.
dvander@1412
    19
 *
dvander@1412
    20
 * As a special exception, AlliedModders LLC gives you permission to link the
dvander@1412
    21
 * code of this program (as well as its derivative works) to "Half-Life 2," the
dvander@1412
    22
 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
dvander@1412
    23
 * by the Valve Corporation.  You must obey the GNU General Public License in
dvander@1412
    24
 * all respects for all other code used.  Additionally, AlliedModders LLC grants
dvander@1412
    25
 * this exception to all derivative works.  AlliedModders LLC defines further
dvander@1412
    26
 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
dvander@1412
    27
 * or <http://www.sourcemod.net/license.php>.
dvander@1412
    28
 *
dvander@1412
    29
 * Version: $Id$
dvander@1412
    30
 */
dvander@1412
    31
#include "frame_hooks.h"
dvander@1412
    32
#include "TimerSys.h"
dvander@1412
    33
#include "Database.h"
dvander@1412
    34
#include "HalfLife2.h"
dvander@1412
    35
#include "MenuStyle_Valve.h"
dvander@1412
    36
#include "MenuStyle_Radio.h"
dvander@1412
    37
#include "PlayerManager.h"
dvander@1412
    38
dvander@1412
    39
float g_LastMenuTime = 0.0f;
dvander@1412
    40
float g_LastAuthCheck = 0.0f;
dvander@1412
    41
dvander@1412
    42
void RunFrameHooks()
dvander@1412
    43
{
dvander@1412
    44
	/* Frame based hooks */
dvander@1412
    45
	g_DBMan.RunFrame();
dvander@1412
    46
	g_HL2.ProcessFakeCliCmdQueue();
dvander@1412
    47
dvander@1412
    48
	float curtime = *g_pUniversalTime;
dvander@1412
    49
dvander@1412
    50
	if (curtime - g_LastMenuTime >= 1.0f)
dvander@1412
    51
	{
dvander@1412
    52
		g_ValveMenuStyle.ProcessWatchList();
dvander@1412
    53
		g_RadioMenuStyle.ProcessWatchList();
dvander@1412
    54
		g_LastMenuTime = curtime;
dvander@1412
    55
	}
dvander@1412
    56
dvander@1412
    57
	if (*g_NumPlayersToAuth && curtime - g_LastAuthCheck >= 0.7f)
dvander@1412
    58
	{
dvander@1412
    59
		g_Players.RunAuthChecks();
dvander@1412
    60
		g_LastAuthCheck = curtime;
dvander@1412
    61
	}
dvander@1412
    62
}
dvander@1412
    63