VNG to P2P conversion for NetCard
$Revision: 1.2 $
$Date: 2007/07/13 21:55:45 $
Peer-to-Peer API Specifications
Steps to convert a program to use P2P instead of VNG
-
To start the conversion, do a global name change from VNG to P2P.
-
The structure VN is changed to VNHandle, which no longer has the VNG ID as a
member.
-
One major difference between VNG and P2P is the init function. VNG_Init
initializes a global context which is passed in as an argument. In P2P_Init,
this is implicit. Also, the P2P_InitParm structure allows the caller to pass in
the server name and port number. On the NetCard, P2P_Init will automatically
attempt to connect to the specified server (or the default server if NULL is
specified), with the given timeout.
-
Doing P2P_Init allows the application to use the P2P core. In order to use the
P2P services (e.g. P2P_SearchGames), it is necessary to call P2P_InitServices,
which takes in similar arguments as P2P_Init.
-
After joining or starting a VN, call P2P_OpenChannel to specify which channel
to use for sending or receiving messages.