peerConnectPreAuth
Connects a peer object to the backend chat server and then logs in using authentication information from a parter authentication system.
- void peerConnectPreAuth(
- PEER peer,
- const gsi_char * authtoken,
- const gsi_char * partnerchallenge,
- peerNickErrorCallback nickErrorCallback,
- peerConnectCallback connectCallback,
- void * param,
- PEERBool blocking );
Routine | Required Header | Distribution |
---|---|---|
peerConnectPreAuth | <peer.h> | SDKZIP |
Parameters
- peer
- [in] Initialized peer object.
- authtoken
- [in] Authtoken for this login.
- partnerchallenge
- [in] Partner challenge for this login.
- nickErrorCallback
- [in] Callback function to be called if a nick error occurs.
- connectCallback
- [in] Callback function to be called when the operation completes.
- param
- [in] Pointer to user data. This is optional and will be passed unmodified to the callback function.
- blocking
- [in] When set to PEERTrue this function will not return until the operation has completed.
Remarks
The peerConnectPreAuth attempts to connect a peer object to the backend chat server and then login using an account from a partner authentication system. The connection can be ended at any time by called peerDisconnect() (peerShutdown() will also close the connection). If the connection gets disconnected for any other reason (such as an intermediate router going down), the peerDisconnectedCallback() callback will be called. This function will fail if the Peer object is already connected.
Once connected to the backend chat server, Peer is fully enabled, and the user can join rooms, create rooms, list games, message other players, etc. Typically at this point the user would be joined up to the game’s title room with peerJoinTitleRoom(). A title must be set with peerSetTitle() before this function is called.
Unicode Mappings
Routine | GSI_UNICODE Not Defined | GSI_UNICODE Defined |
---|---|---|
peerConnectPreAuth | peerConnectPreAuthA | peerConnectPreAuthW |
peerConnectPreAuthW and peerConnectPreAuthA are UNICODE and ANSI mapped versions of peerConnectPreAuth. The arguments of peerConnectPreAuthA are ANSI strings; those of peerConnectPreAuthW are wide-character strings.
Section Reference: Gamespy Peer SDK
See Also: peerConnect, peerConnectLogin