- fixed a serious bug where %T arguments were read backwards (they now match the wiki documentation of phrase and then client)
- fixed a bug where the argument count for %T was not checked properly
3 * ===============================================================
4 * SourceMod, Copyright (C) 2004-2007 AlliedModders LLC.
6 * ===============================================================
8 * This file is part of the SourceMod/SourcePawn SDK. This file may only be
9 * used or modified under the Terms and Conditions of its License Agreement,
10 * which is found in public/licenses/LICENSE.txt. As of this notice, derivative
11 * works must be licensed under the GNU General Public License (version 2 or
12 * greater). A copy of the GPL is included under public/licenses/GPL.txt.
14 * To view the latest information, see: http://www.sourcemod.net/license.php
19 #ifndef _INCLUDE_SOURCEMOD_TIMER_SYSTEM_H_
20 #define _INCLUDE_SOURCEMOD_TIMER_SYSTEM_H_
23 * @file ITimerSystem.h
24 * @brief Contains functions for creating and managing timers.
28 #include <IShareSys.h>
29 #include <IForwardSys.h>
31 #define SMINTERFACE_TIMERSYS_NAME "ITimerSys"
32 #define SMINTERFACE_TIMERSYS_VERSION 1
39 * @brief Event callbacks for when a timer is executed.
45 * @brief Called when a timer is executed.
47 * @param pTimer Pointer to the timer instance.
48 * @param pData Private pointer passed from host.
49 * @return Pl_Stop to stop timer, Pl_Continue to continue.
51 virtual ResultType OnTimer(ITimer *pTimer, void *pData) =0;
54 * @brief Called when the timer has been killed.
56 * @param pTimer Pointer to the timer instance.
57 * @param pData Private data pointer passed from host.
59 virtual void OnTimerEnd(ITimer *pTimer, void *pData) =0;
62 #define TIMER_FLAG_REPEAT (1<<0)
64 class ITimerSystem : public SMInterface
67 const char *GetInterfaceName()
69 return SMINTERFACE_TIMERSYS_NAME;
71 unsigned int GetInterfaceVersion()
73 return SMINTERFACE_TIMERSYS_VERSION;
77 * @brief Creates a timed event.
79 * @param pCallbacks Pointer to ITimedEvent callbacks.
80 * @param fInterval Interval, in seconds, of the timed event to occur.
81 * The smallest allowed interval is 0.1 seconds.
82 * @param pData Private data to pass on to the timer.
83 * @param flags Extra flags to pass on to the timer.
84 * @return An ITimer pointer on success, NULL on failure.
86 virtual ITimer *CreateTimer(ITimedEvent *pCallbacks,
92 * @brief Kills a timer.
94 * @param pTimer Pointer to the ITimer structure.
97 virtual void KillTimer(ITimer *pTimer) =0;
100 * @brief Arbitrarily fires a timer. If the timer is not a repeating
101 * timer, this will also kill the timer.
103 * @param pTimer Pointer to the ITimer structure.
104 * @param delayExec If true, and the timer is repeating, the
105 * next execution will be delayed by its interval.
108 virtual void FireTimerOnce(ITimer *pTimer, bool delayExec=false) =0;
112 #endif //_INCLUDE_SOURCEMOD_TIMER_SYSTEM_H_