peerQRServerKeyCallback

GameSpy SDK

peerQRServerKeyCallback

Called when a server key is requested during a hosted game.

typedef void (*peerQRServerKeyCallback)(
PEER peer,
int key,
qr2_buffer_t buffer,
void * param );
RoutineRequired HeaderDistribution
peerQRServerKeyCallback<peer.h>SDKZIP

Parameters

peer
[in] Initialized peer object
key
[in] The value associated with this key will be returned
buffer
[in] The Qr2 buffer for holding the data
param
[in] Pointer to user data. This is optional and will be passed unmodified to the callback function.

Remarks

The peerQRServerKeyCallback function is called while hosting a game to report values for server keys. For example usage see the PeerTest sample. For a detailed explanation of how server reporting works, see the Query & Reporting 2 SDK documentation.
If in staging, and either not playing or peerStartGame was called with PEER_REPORT_INFO set in the reporting options, then Peer will report the following keys: HOSTNAME_KEY, NUMPLAYERS_KEY, MAXPLAYERS_KEY, GAMEMODE_KEY (only if not playing), and PASSWORD_KEY, and the callback will not be called for these key. Peer will also always report the GROUPID_KEY if in a group room. The application is responsible for reporting any other server keys and is also responsible for these keys when Peer does not report them. Any other keys the application reports must be registered with the peerQRKeyListCallback() (see below).

Section Reference: Gamespy Peer SDK