Microsoft DirectX 8.1 (Visual Basic)

Implementing a Lobbied Application Callback Message Handler

The message handler is a DirectPlay8LobbyEvent object, that receives messages directly from the lobby client object, and indirectly from the application. It is not provided by Microsoft® DirectPlay® and must be implemented by your application.

Your message handler must implement all of the following methods:

Most of these methods are called by DirectPlay in response to changes in the game status, or when the lobbied application requests information. The exception is DirectPlay8LobbyEvent.Receive. This method is called to pass data directly from the lobby client to the game application.

DirectPlay8LobbyEvent.Connect

This method is called when the lobby client calls DirectPlay8LobbyClient.ConnectApplication to connect an application to a session. The associated DPL_MESSAGE_CONNECT type holds a variety of information, including:

DirectPlay8LobbyEvent.ConnectionSettings

DirectPlay calls this method whenever an associated lobby client calls its DirectPlay8LobbyClient.SetConnectionSettings method to modify the session connections. The associated DPL_MESSAGE_CONNECTION_SETTINGS type contains the updated connection information.

DirectPlay8LobbyEvent.Disconnect

This message is sent when the lobby client disconnects the application from the session by calling DirectPlay8LobbyClient.ReleaseApplication. Your application should delete the connection from its list, and free any data that is associated with the session.

DirectPlay8LobbyEvent.Receive

This message enables a lobby client to pass data to an application. When the lobby client calls DirectPlay8LobbyClient.Send, DirectPlay passes the data to the application by calling DirectPlay8LobbyEvent.Receive. It is up to the application to process the data.

DirectPlay8LobbyEvent.SessionStatus

DirectPlay does not call this method for lobbyable application message handlers. You must implement this method, but it can simply return 0.