DirectPlay is provided by Microsoft and presents a common interface to the application. The DirectPlay interface hides the complexities and unique tasks required to establish an arbitrary communications link inside the DirectPlay service provider implementation. An application using DirectPlay need only concern itself with the performance of the communications medium, not with whether a modem, network, or online service provided that medium.
DirectPlay will dynamically bind to any DirectPlay service provider installed on the user's system. The application interacts with the DirectPlay object. The DirectPlay object interacts with one of the available DirectPlay service providers, and the selected service provider interacts with the transport or protocol.
The DirectPlay API is exposed to the application through a COM interface. For DirectPlay version 3, there are two interfaces available: IDirectPlay2 and IDirectPlay2A. IDirectPlay2 uses Unicode strings in all the DirectPlay structures, whereas IDirectPlay2A uses ANSI strings. The IDirectPlay interface still exists as the default interface for backward compatibility with applications written for DirectPlay versions 1 and 2, and it uses only ANSI strings.
The application instantiates a single DirectPlay object and performs all communications through that object, even if the application manages multiple players. For performance, only the DirectPlay objects communicate directly with each other; after a DirectPlay object receives a message, it will replicate that message (if necessary) for all the players the local application created, and add those messages to the message queue.
This version of DirectPlay supports the peer-to-peer gaming paradigm—that is, any player can send a message directly to any other player in the session. A session host arbitrates new computers that join the session and assigns ID numbers when new players and groups are created. You can design a game in a client/server model where all messages are sent to a server player on the host computer, who then forwards them to the appropriate client players. Future versions of DirectPlay will support application servers.