|Microsoft DirectX 9.0|
LobbyClient is a simple lobby client application. It displays all registered Microsoft?DirectPlay?applications on the local system. It enables the user to launch one or more of these applications using a chosen service provider. A launched lobbied application can be told to either join or host a game.
Source: (SDK root)\Samples\C++\DirectPlay\LobbyClient
Executable: (SDK root)\Samples\C++\DirectPlay\Bin
The LobbyClient sample displays a dialog box that allows you to choose launch parameters before starting the application by clicking Launch App. The Active Connections list will display the handle to all current lobbied applications. Clicking Send Message will send a lobby message to the lobbied application. This is done mainly for demonstration purposes. In a more complex lobby client, you might want to use this functionality in a more meaningful way by passing a message to which the lobbied application responds.
The InitDirectPlay function does the following:
The OnInitDialog function does the following:
When Launch App is clicked, the LaunchApp function does the following:
The DirectPlayLobbyMessageHandler function can handle the following messages.
|DPL_MSGID_DISCONNECT||The lobbied application was disconnected. The pDisconnectMsg?gt;hDisconnectId parameter will contain the handle of the lobbied application that was disconnected and the pDisconnectMsg?gt;hrReason parameter will contain the reason. This sample pops up a message box.|
|DPL_MSGID_RECEIVE||The lobbied application sent the client data. This sample does not respond to any message.|
|DPL_MSGID_SESSION_STATUS||A lobbied application has changed its status. The pStatusMsg?gt;hSender parameter will be one of several predefined status codes. This sample updates the user interface (UI), showing that the lobby status has been updated. However, more complex lobby clients might take action.|
|DPL_MSGID_CONNECTION_SETTINGS||A lobbied application has changed its connection settings. This lobby client takes no action. However, more complex clients might take action.|
When Send Message is clicked, the SendMsgToApp function calls IDirectPlay8LobbyClient::Send. The hConnection parameter is set to the handle of the receiving lobbied application and the pBuffer parameter is set to the message buffer.
When Disconnect is clicked, the DisconnectFromApp function calls IDirectPlay8LobbyClient::ReleaseApplication. The hApplication parameter is set to the handle of the lobbied application from which to disconnect.