$#K SNetRegisterEventHandler

Registers a callback function which will be called when the specified event occurs.  Applications can use this functionality to receive notifications of players joining and leaving a game, among other things.

Events can occur at any time, but Storm queues the events and only dispatches them to the appropriate event handler function during an application call to SNetReceiveMessage() or SNetReceiveTurns().  This protects the application from reentrancy issues.

BOOL SNetRegisterEventHandler (
	DWORD			eventid,
	SNETEVENTPROC	callback
);

Parameters

eventid
The ID of the event for which the callback function is being registered.  The following events are defined:

Value	Meaning	
SNET_EVENT_INITDATA	Used to receive application-specific initialization data that the game creator specified in the call to SNetCreateGame().	
SNET_EVENT_GAMEDESTROY	The current game has been destroyed by the owner.	
SNET_EVENT_GAMESTART	The current game has been started.	
SNET_EVENT_PLAYERJOIN	A player has joined the current game.	
SNET_EVENT_PLAYERLEAVE	A player has left the current game.	

callback
A pointer to the callback function.  See EventProc() for a description.

Return Value

This function returns TRUE for success or FALSE for failure.  The function can fail if:
•	An invalid event ID was specified
•	No callback function was provided