DirectPlay Question
Hi All,
I''m trying to develop a simpel peer to peer game application. I''m new to this field, so I''m having a little hard time. I''ve developed the host and clients connect properly. What I want to do is, when anyone connect to host, the name & DPNID is stored at host & other peers, so that anyone can talk to that client, but the point is, how to give the names & DPNIDs of already connected peers to the new peer.
One way that I figure out, was to send a self-defined message along with the data(containing the name & DPNID). I would like to know, is there anyone way (provided by the framework).
Any help in this matter will be highly appriciated. Thanx in advance.
Regaads,
Ejaz.
> how to give the names & DPNIDs
> of already connected peers to
> the new peer
All the peers (including the new peer) will receive DPN_MSGID_CREATE_PLAYER messages. The already running peers will receive one message with the DPNID of the new connecting peer; the connecting peer will receive a DPN_MSGID_CREATE_PLAYER message for each and every running peer, including itself. You get the string names (and extra data if you want) of any peer with ''IDirectPlay8Peer::GetPeerInfo()''.
The reason why the 3rd peer is not connecting is because you have set the ''dwMaxPlayers'' parameter in the DPN_APPLICATION_DESC struct to 2 instead of a higher number. That number was probably set by a little hasty Cut&Paste here and there maybe?
-cb
> of already connected peers to
> the new peer
All the peers (including the new peer) will receive DPN_MSGID_CREATE_PLAYER messages. The already running peers will receive one message with the DPNID of the new connecting peer; the connecting peer will receive a DPN_MSGID_CREATE_PLAYER message for each and every running peer, including itself. You get the string names (and extra data if you want) of any peer with ''IDirectPlay8Peer::GetPeerInfo()''.
The reason why the 3rd peer is not connecting is because you have set the ''dwMaxPlayers'' parameter in the DPN_APPLICATION_DESC struct to 2 instead of a higher number. That number was probably set by a little hasty Cut&Paste here and there maybe?
-cb
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement