Platform SDK: DirectX

Lobbies

A DirectPlay lobby server is a common place on a network that (at a minimum) tracks DirectPlay application sessions in progress and connected users. Users can navigate around the lobby server to find areas of interest, chat with other users, join a session, or gather a group of players to start a new session.

A lobby server's main advantage is that it acts as a central, well-known location where users can go to find sessions and other people to interact with. The lobby server manages all the network addresses of the various players and sessions and can automatically launch applications on the users' machines and connect them to the correct address without user intervention. The management of sessions, players, and their network addresses is especially useful on the Internet.

Lobby servers can be enhanced to provide many more services to the user, such as tournaments, individual score tracking, high-score lists, personal profiles, avatars (graphical representations of users), message boards, news, authenticated membership, software updates, and so on.

A lobby-aware application is one that has been specifically developed to operate with lobby servers. There are two types of lobbies that a user can experience: external and internal.

An external lobby is a client application whose sole purpose is to interact with a lobby server and the other users connected to it. When the time comes to start or join an application session, the lobby client launches the application in a separate process and gives it all the information necessary to establish a connection to the session. Adding support for external lobby launching to a DirectPlay application is quite straightforward and explained further in Supporting External Lobby Launching.

An internal lobby is a lobby user interface that is integrated into the application itself. This is more difficult to implement because the application must implement the user interface for the lobby as well as that for the game. However, it has the advantage that you can customize the lobby experience to match the application's theme.

The DirectPlay lobby architecture consists of a client API that all applications, whether they are external lobby clients or applications that have a lobby client built in, use to connect to any DirectPlay-compliant lobby server. This is done through a lobby provider interface that, like a service provider, abstracts the interaction with the lobby server. The author of the lobby server application must write the lobby provider that resides on the client computer. The application calls the standard DirectPlay methods, and the lobby provider's dynamic-link library (DLL) services these methods by communicating with the lobby server software.

The following diagram illustrates the DirectPlay lobby architecture. Different lobby client applications can connect to the same lobby server through the DirectPlay API.

At the very least, the lobby server must be able to track all the users currently connected to it, organize them by grouping them, and synchronize the launch of an application session.

The DirectPlay API defines a common level of functionality for all lobby servers. Any generic lobby client application can connect to any generic lobby server and, through the DirectPlay API and the lobby provider architecture, they can work together. An application can extend the basic functionality by defining properties that can be altered in response to messages. A lobby client designed to work with a specific lobby server can implement extended functionality that is not defined by the DirectPlay API.