peerStartListingGames

GameSpy SDK

peerStartListingGames

Begin listing the currently running games and staging rooms.

void peerStartListingGames(
PEER peer,
const unsigned char * fields,
int numFields,
const gsi_char * filter,
peerListingGamesCallback callback,
void * param );
RoutineRequired HeaderDistribution
peerStartListingGames<peer.h>SDKZIP

Parameters

peer
[in] Initialized peer object.
fields
[in] Array of registered QR2 keys to request from the servers.
numFields
[in] Number of keys in the fields array.
filter
[in] SQL-link rule filter.
callback
[in] Callback function to be called when each server updates.
param
[in] Pointer to user data. This is optional and will be passed unmodified to the callback function.

Remarks

The peerStartListingGames function starts listing the currently running games and staging rooms. This is used to maintain a list that can presented to the user, so they can pick a game (or staging room) to join. Games and staging rooms are filtered based on what group the local user is in. If the local user isn't in a group, then only games and staging rooms that aren't part of any group are listed. Peer first gets an initial list of existing servers, then it receives continuous updates about new servers, deleted servers, and updated servers. The callback will keep being called repeatedly with new information until the listing is stopped with peerStopListingGames(), or the title is cleared or changed with peerClearTitle() or peerSetTitle().
The filter can be a SQL-style Boolean statement, such as:
"gametype=’ctf’" or
"numplayers > 1 and numplayers < 8".
The fitler can be arbitrarily complex and supports all standard SQL groupings and Boolean operations. The following fields are available for filtering: hostport, gamever, location, hostname, mapname, gametype, gamemode, numplayers, maxplayers, groupid.
This function will fail if there is no title set.

Unicode Mappings

RoutineGSI_UNICODE Not DefinedGSI_UNICODE Defined
peerStartListingGamespeerStartListingGamesApeerStartListingGamesW

peerStartListingGamesW and peerStartListingGamesA are UNICODE and ANSI mapped versions of peerStartListingGames. The arguments of peerStartListingGamesA are ANSI strings; those of peerStartListingGamesW are wide-character strings.

Section Reference: Gamespy Peer SDK