Maze

DirectPlay

 
Microsoft DirectX 9.0 SDK Update (Summer 2003)

Maze


The maze sample is a Microsoft® DirectPlay® client/server application. There are two different client applications—a console-based version and a Microsoft Direct3D® client. The Direct3D client can optionally be run as screen saver by copying Mazeclient.exe to your \winnt\system32\ folder and renaming it Mazeclient.scr. Doing so will make it a screen saver that can be detected by the display control panel application.

Path

Path: (SDK root)\Samples\C++\DirectPlay\Maze

Executable: (SDK root)\Samples\C++\DirectPlay\Bin

User's Guide

There are three executable maze samples—MazeClient, MazeConsoleClient, and MazeServer. MazeClient is a self-contained executable file but MazeServer and MazeConsoleClient must be run together. Instructions for running each sample are described below.

Note  If you choose the Internetwork Packet Exchange (IPX) service provider and want to have DirectPlay perform a search for the address, select the use DPNSVR check box.

MazeClient

You can run MazeClient in three ways:

  • Start MazeClient from the Bin folder by double-clicking the MazeClient icon. This runs the sample in settings mode. When you click the icon, a dialog box appears. Choose the setting you want and click Launch. This starts the maze sample. To quit the sample, press any key or click the mouse.

  • To run MazeClient in test mode, at the command prompt type:

    mazeclient.exe /t 

    In test mode, you can search and join a server game or you can choose to not connect to a server. There are few simple commands you can type when running mazeclient in test mode:

    • a  will turn autopilot on or off, but when moving about. There is no collision detection code, so you can go through walls.
    • r  will turn reflections on or off.
  • To run MazeClient in screen saver mode, at the command prompt type the following:

    mazeclient.exe /s

    This mode will autoconnect to a server using the settings from settings mode. If a server is not found, it will run without connecting to a server. It will also exit upon mouse or keyboard input.

MazeConsoleClient

Start MazeConsoleClient by double-clicking the MazeConsoleClient icon in the Bin folder or by typing at the command prompt:

MazeConsoleClient.exe

MazeConsoleClient should automatically search for a session on the local network. If it does not, at the command prompt type:

setup

When asked if you want to connect to a local server, type:

Yes

If you are already running MazeServer, MazeConsoleClient will automatically connect and start. To search for a session at a specific Internet Protocol (IP) address, type it at the command prompt, for example,

MazeConsoleClient 255.255.255.255 

If a server is not found or the session is lost, it will exit automatically. Press CTRL+C to close the session.

MazeServer

Start MazeServer by double-clicking the MazeServer icon in the Bin folder or typing at the command prompt:

mazeserver.exe

MazeServer will automatically create a host session that clients can join. MazeServer.exe takes an optional command prompt parameter to set the size of the maze. For example, to set the maze to 16 wide and 128 high, type:

mazeserver.exe /size 16 128

The width and height are restricted to these numbers: 16, 32, 64, or 128.

Once started, the server will display a simple command prompt to control the server. Here is the list of commands.

helpLists simple commands you can use.
stopShuts down the server.
statsDisplays how many players are connected.
sr or serverreliable  Set what percentage of the packets going from the server to the client have the DPNSEND_GUARANTEED flag.
cr or clientreliableSet what percentage of the packets going from every client to the server have the DPNSEND_GUARANTEED flag.
cu or clientupdate Set how many milliseconds pass between updates from each client.
ct or clienttimeoutSets the timeout value of packets sent by the clients.
st or servertimeoutSets the timeout value of packets sent by the server.
ci or connectioninfoDisplays information about the connection from the server to a client. For example, ci 00300003.
loglevelSet how much extra information it provides about what is happening behind the scenes.

© 2003 Microsoft Corporation. All rights reserved.