Microsoft DirectX 9.0

Lobbyable Applications

Lobbyable applications are designed to work with a lobby client based on Microsoft?DirectPlay? While a lobby client can use DirectPlay to launch any application, lobbyable applications have a number of advantages.

In short, DirectPlay virtually eliminates the need for game-specific or lobby client-specific communication code. You can use a standard API for everything with little or no modification for the particular game or lobby client.

For a discussion of implementation details, see Implementing a Lobbyable Application or software development kit (SDK) samples such as SimplePeer, or StagedPeer.

Launching a Lobbyable Application

One of the first things a lobbyable application should do after it is launched is create a lobbied application object. Among other things, this object enables your application to determine whether it was lobby-launched. A lobbied application must also implement a message-handler callback function to receive messages from the lobby client. The basic procedure is:

Once an application has been successfully lobby launched, DirectPlay can automatically send status updates to the lobby client when events such as host migration occur. To enable automatic status updates, call the RegisterLobby method of the IDirectPlay8Peer, IDirectPlay8Client, or IDirectPlay8Server interface. You can also use the lobbied application interface to send messages to the lobby client.

Be aware that your message handler function might receive messages from the lobby client before the initialization method returns. In addition to the connection message, the callback function receives messages when the lobby client changes connection settings, or it breaks the connection. The lobby client can also send messages directly to your message handler that contain game-specific information.

Note  It is possible to receive messages from more than one thread. To handle messaging properly, your lobbied application callback function should be re-entrant.

© 2002 Microsoft Corporation. All rights reserved.