IGameEventManager: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 19: Line 19:
== Note on IGameEventManager2 ==
== Note on IGameEventManager2 ==


With the release of the updated SDK for Ep1 the IGameEventManager was upgraded to version 2. This version allows for registering for only the events that are explicitly desired instead of registering for all events. ''Beware'' of changes in the API for this version.
With the release of the updated SDK for Ep1 the IGameEventManager was upgraded to version 2. This version allows for registering for only the events that are explicitly desired instead of registering for all events. '''Beware''' of changes in the API for this version.


== See Also ==
== See Also ==
* {{doxygen|igameevents_8h-source.html igameevents.h on HL2 SDK Doxygen}}
* {{doxygen|igameevents_8h-source.html igameevents.h on HL2 SDK Doxygen}}
[[Category:Programming]][[Category:Interfaces]]
[[Category:Programming]][[Category:Interfaces]]

Revision as of 13:06, 16 August 2006

Getting an Instance if the IGameEventManager

bool Plugin::Load( CreateInterfaceFn interfaceFactory, CreateInterfaceFn gameServerFactory ) {
	IGameEventManager2* gameeventmanager = 
		(IGameEventManager2*) interfaceFactory( INTERFACEVERSION_GAMEEVENTSMANAGER2, NULL);
}

Subscribing for Events

void Plugin::LevelInit( char const* pMapName ) {
	Msg( "Level \"%s\" has been loaded\n", pMapName );
	gameeventmanager->AddListener( this, "player_say", true );
}

Note on IGameEventManager2

With the release of the updated SDK for Ep1 the IGameEventManager was upgraded to version 2. This version allows for registering for only the events that are explicitly desired instead of registering for all events. Beware of changes in the API for this version.

See Also