added a new forward for OnServerActivate
authorDavid Anderson <dvander@alliedmods.net>
Sat Mar 17 20:25:08 2007 +0000 (2007-03-17)
changeset 643f55b20bb1007
parent 642 702c27be0a32
child 644 2a90d4324fc0
added a new forward for OnServerActivate
included timers from sourcemod.inc
core/PlayerManager.cpp
core/PlayerManager.h
plugins/include/sourcemod.inc
plugins/include/timers.inc
     1.1 --- a/core/PlayerManager.cpp	Sat Mar 17 16:32:40 2007 +0000
     1.2 +++ b/core/PlayerManager.cpp	Sat Mar 17 20:25:08 2007 +0000
     1.3 @@ -60,6 +60,7 @@
     1.4  	m_clcommand = g_Forwards.CreateForward("OnClientCommand", ET_Hook, 2, NULL, Param_Cell, Param_Cell);
     1.5  	m_clinfochanged = g_Forwards.CreateForward("OnClientSettingsChanged", ET_Ignore, 1, p2);
     1.6  	m_clauth = g_Forwards.CreateForward("OnClientAuthorized", ET_Ignore, 2, NULL, Param_Cell, Param_String);
     1.7 +	m_onActivate = g_Forwards.CreateForward("OnServerLoad", ET_Ignore, 0, NULL);
     1.8  }
     1.9  
    1.10  void PlayerManager::OnSourceModShutdown()
    1.11 @@ -80,6 +81,7 @@
    1.12  	g_Forwards.ReleaseForward(m_clcommand);
    1.13  	g_Forwards.ReleaseForward(m_clinfochanged);
    1.14  	g_Forwards.ReleaseForward(m_clauth);
    1.15 +	g_Forwards.ReleaseForward(m_onActivate);
    1.16  
    1.17  	delete [] m_Players;
    1.18  }
    1.19 @@ -97,6 +99,7 @@
    1.20  
    1.21  		memset(m_AuthQueue, 0, sizeof(unsigned int) * (m_maxClients + 1));
    1.22  	}
    1.23 +	m_onActivate->Execute(NULL);
    1.24  }
    1.25  
    1.26  void PlayerManager::RunAuthChecks()
     2.1 --- a/core/PlayerManager.h	Sat Mar 17 16:32:40 2007 +0000
     2.2 +++ b/core/PlayerManager.h	Sat Mar 17 20:25:08 2007 +0000
     2.3 @@ -111,6 +111,7 @@
     2.4  	IForward *m_clcommand;
     2.5  	IForward *m_clinfochanged;
     2.6  	IForward *m_clauth;
     2.7 +	IForward *m_onActivate;
     2.8  	CPlayer *m_Players;
     2.9  	int m_maxClients;
    2.10  	int m_PlayerCount;
     3.1 --- a/plugins/include/sourcemod.inc	Sat Mar 17 16:32:40 2007 +0000
     3.2 +++ b/plugins/include/sourcemod.inc	Sat Mar 17 20:25:08 2007 +0000
     3.3 @@ -43,6 +43,7 @@
     3.4  #include <usermessages>
     3.5  #include <events>
     3.6  #include <functions>
     3.7 +#include <timers>
     3.8  
     3.9  /**
    3.10   * Declare this as a struct in your plugin to expose its information.
    3.11 @@ -105,6 +106,13 @@
    3.12  forward OnGameFrame();
    3.13  
    3.14  /**
    3.15 + * Called when the map is loaded and configs have been parsed.
    3.16 + * Note that commands are processed per-frame, and thus config
    3.17 + * files may not be fully loaded until a few seconds later.
    3.18 + */
    3.19 +forward OnServerLoad();
    3.20 +
    3.21 +/**
    3.22   * Returns the calling plugin's Handle.
    3.23   *
    3.24   * @return				Handle of the calling plugin.
     4.1 --- a/plugins/include/timers.inc	Sat Mar 17 16:32:40 2007 +0000
     4.2 +++ b/plugins/include/timers.inc	Sat Mar 17 20:25:08 2007 +0000
     4.3 @@ -67,7 +67,7 @@
     4.4   * @param flags				Flags to set (such as repeatability or auto-Handle closing).
     4.5   * @return					Handle to the timer object.  You do not need to call CloseHandle().
     4.6   */
     4.7 -native Handle:CreateTimer(Float:interval, Timer:func, {Handle,_}:value, flags);
     4.8 +native Handle:CreateTimer(Float:interval, Timer:func, {Handle,_}:value, flags=0);
     4.9  
    4.10  /**
    4.11   * Kills a timer.  Use this instead of CloseHandle() if you need more options.