Microsoft DirectX 8.1 (Visual Basic)

SimpleClient

The SimpleClient sample is a simple application that can connect to a server and make funny faces to other players on that server.

Path

Source: (SDK root)\Samples\Multimedia\VBSamples\DirectPlay\SimpleClient

Executable: (SDK root)\Samples\Multimedia\VBSamples\DirectPlay\Bin

User's Guide

Double-click the SimpleClient icon to start the game. First, you must enter your name and choose your service provider, then click OK. When the Create or Join Session dialog box opens, click the Start Search button to find a session. A window will open where you may enter a remote host address. If you do not enter an address, SimpleClient will search the local network. Choose a session in the Create or Join Session dialog box and click Join. When the game window opens, click the Make Faces button to make faces at other players.

Note   The SimpleServer must be running to play this game.

Programming Notes

When the Make Faces button is pressed, the cmdFace_Click function:

  1. Creates an empty byte array, since all we can do is make faces.
  2. Calls DirectPlay8Client.Send with the buffer() parameter set to the byte array. The server will receive this message and handle it.

When a message is received from the server, the DirectPlay8Event_Receive function checks for the following message types.

Msg_NumPlayers Change the number of current and max players in this session, update user interface (UI).
Msg_NoOtherPlayers Notify the client there are no other players in the session.
Msg_SendWave Notify the client that someone made a funny face at them.