Microsoft DirectX 8.1 (Visual Basic)

Implementing a Lobby Client 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 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 lobby client requests information. The exception is DirectPlay8LobbyEvent.Receive. This method is called to pass data directly from the game application to the lobby client.

DirectPlay8LobbyEvent.Connect

This method is called by DirectPlay following the launch of a lobbyable application. The message indicates that the application has been successfully connected. The associated DPL_MESSAGE_CONNECT type holds a variety of information, including:

DirectPlay8LobbyEvent.ConnectionSettings

This message is called by DirectPlay whenever an associated lobbyable application calls its DirectPlay8LobbiedApplication.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 lobbyable application disconnects from the session by calling DirectPlay8LobbiedApplication.Close. Your lobby client application should delete the connection from its list and free any data that is associated with the application.

DirectPlay8LobbyEvent.Receive

This message enables an application to pass data to the lobby client by calling DirectPlay8LobbiedApplication.Send. DirectPlay passes the data block from the application to the lobby client in a DPL_MESSAGE_RECEIVE type. It is up to the lobby client to process the data.

DirectPlay8LobbyEvent.SessionStatus

This message is sent by DirectPlay whenever one of the following six changes in the session's status occurs.

The type of status change is indicated by the value of the method's status parameter.

For more information, see A Sample Lobby Client Message Handler.