Microsoft DirectX 8.1 (Visual Basic)

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 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 DirectPlay8LobbiedApplication 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:

  1. Create a DirectPlay8LobbiedApplication object.
  2. Register a DirectPlay8LobbyEvent message handler object by calling DirectPlay8LobbiedApplication.RegisterMessageHandler. If the application was lobby-launched, DirectPlay will call your DirectPlay8LobbyEvent.Connect method. The dlNotify parameter will contain a DPL_MESSAGE_CONNECT type with connection information such as address objects for the members of the session.

Note  The DirectPlay8LobbyEvent object is essentially an event handler that receives notifications directly from the lobbied application object, and indirectly from the lobby client and the lobby. It is not provided by DirectPlay and must be implemented by your application. See the reference documentation for details.

Once an application has been successfully lobby launched, Microsoft® DirectPlay® automatically sends status updates to the lobby client when events such as host migration occur. You can also use the lobbied application interface to send messages to the lobby client.

Be aware that your message handler object might be called by the lobby client before the initialization method returns. In addition to the connection message, the DirectPlay calls the object 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.