peerNickErrorCallback

GameSpy SDK

peerNickErrorCallback

Callback for peerConnect.

typedef void (*peerNickErrorCallback)(
PEER peer,
int type,
const gsi_char * nick,
int numSuggestedNicks,
const gsi_char ** suggestedNicks,
void * param );
RoutineRequired HeaderDistribution
peerNickErrorCallback<peer.h>SDKZIP

Parameters

peer
[in] Initialized peer object
type
[in] One of the predefined error types
nick
[in] The player's nickname passed to peerConnect or peerRegisterUniqueNick
numSuggestedNicks
[in] The number of suggested nicknames
suggestedNicks
[in] A List of suggested nicknames
param
[in] Pointer to user data. This is optional and will be passed unmodified to the callback function.

Remarks

If this function is called with type equal to PEER_IN_USE or PEER_INVALID, there was an error with the nick that was passed to peerConnect() or peerRetryWithNick(). The connection attempt is put on hold until peerRetryWithNick() is called. It does not need to be called immediately, but should be called within a reasonable amount of time, or the connection attempt may time out. If the nick passed to peerRetryWithNick fails, this callback will be called again (and as many times as needed) until the server accepts a nick. To stop attempting reconnects, call peerRetryWithNick() with a NULL or empty nickname. That will cause the connectCallback passed to peerConnect() to be called with success set to false.
If this function is called with type equal to PEER_UNIQUENICK_EXPIRED or PEER_NO_UNIQUENICK, then there was a problem with the uniquenick associated with the profile passed to peerConnectLogin. The connection attempt is put on hold until peerRegisterUniqueNick() is called. It does not need to be called immediately - the connection will stay alive until it is called. If the uniquenick passed to peerRegisterUniqueNick is invalid or already being used, then this callback will be called again with a type of PEER_INVALID_UNIQUENICK, and with suggestedNicks member filled with an array of suggested uniquenicks (based on the uniquenick passed to peerRegisterUniqueNick). In that case, peerRegisterUniqueNick should be called again with a new uniquenick.

Unicode Mappings

RoutineGSI_UNICODE Not DefinedGSI_UNICODE Defined
peerNickErrorCallbackpeerNickErrorCallbackApeerNickErrorCallbackW

peerNickErrorCallbackW and peerNickErrorCallbackA are UNICODE and ANSI mapped versions of peerNickErrorCallback. The arguments of peerNickErrorCallbackA are ANSI strings; those of peerNickErrorCallbackW are wide-character strings.

Section Reference: Gamespy Peer SDK