Platform SDK: DirectX |
This topic pertains only to application development in C++. See DirectPlay Visual Basic Samples.
The Bellhop sample is a lobby client program that uses the IDirectPlay4 interface to communicate with a lobby server. The Lobby Server application must be running in order for Bellhop to work.
Bellhop can be used to test lobby support in your application.
Source: (SDK root)\Samples\Multimedia\DPlay\Src\Bellhop
Executable: (SDK root)\Samples\Multimedia\DPlay\Bin\Bellhop.exe
After launching Bellhop, you are asked to select a lobby provider. If the Lobby Server application is running, choose Lobby Connection for DirectPlay.
You are presented with a dialog asking you to select a service provider. The sample lobby server and lobby provider are capable of operating over any network supported by DirectPlay. Select an appropriate service provider (such as TCP/IP), and choose OK.
With a TCP/IP connection, you are prompted for the address of the lobby server. You can leave this blank to try to find the address on your local network. Alternatively, you can enter the computer name or IP address. When the lobby session name is displayed, join it as either a player or spectator. (There is no practical difference, because the application treats players and spectators in the same way.)
If the lobby server is not being run in test mode, you see several doors representing groups, or rooms. Double-click on one of the doors. You see a character that represents you in the virtual gaming environment. To join another group without leaving the first, double-click the doorway you wish to enter. To leave any room, right-click on the player icon and choose Delete Player From Group. To leave one room and enter another at the same time, you can drag and drop the icon representing your player.
You see the contents only of rooms you have joined. Once you leave a room, all the doorways (subgroups) and players in that room disappear.
Bellhop provides context-sensitive menus. If you right-click on a player or group, you see the options available for that specific item. If you right-click on the background, you can choose to refresh its display. Bellhop will re-enumerate all the groups and players that are available to you.
When you want to create a subgroup or staging area in an existing room, right-click the folder. In the menu that appears, select Create Group In Group. If you choose to create a staging area, you need to select which game to play from the list box. Only applications registered with DirectPlay are shown. Any other applications that may be running on the network are ignored. In addition to selecting a game, you must choose which connection will be used to launch the game. You can optionally specify a password for the session and the maximum number of players.
If you want to join a staging area, you can right-click on its icon and select Connection Settings in the menu that appears. Bellhop shows you properties of the staging area. You can modify these settings.
To start a game from a staging area, right-click on the staging area icon and select Start Session. This will launch the application on the machines of all the people in the staging area and connect them together in a session. If you move into the staging area after the session has started, select Start Session to join the session in progress. When a session is in progress, the icon changes from a green triangle to a red and black triangle.
To change the name of local groups or players, right-click the group or player and select Set Group Name or Set Player Name. Alternatively, you can simply click on the text of the group or player name.
To send a chat message to other players in the same room, enter the text in the text box at the bottom of the screen and click Send.