peerStartGame

GameSpy SDK

peerStartGame

Called by the host to begin the game.

void peerStartGame(
PEER peer,
const gsi_char * message,
int reportingOptions );
RoutineRequired HeaderDistribution
peerStartGame<peer.h>SDKZIP

Parameters

peer
[in] Initialized peer object.
message
[in] Optional message to send to each client.
reportingOptions
[in] Bitfield flags used to set reporting options.  (example: PEER_KEEP_REPORTING)

Remarks

The peerStartGame function is called only by a staging room host to start the game. All the other people in the staging room will have their peerGameStartedCallback() called. The message gets passed to everyone in the callback, and can be used to pass information such as a special port or password.
Peer does not enforce readiness -- this function can be called at any time, no matter who is ready or not. If the application wishes to only launch the game once everyone is ready, then it is up to the application to enforce that.
If PEER_STOP_REPORTING is set in reportingOptions, Peer will stop server reporting, and the program is responsible from then on for reporting the server to the backend. If PEER_KEEP_REPORTING is set instead, Peer will continue doing server reporting, and calling the program-supplied callbacks. Peer will normally not report all the same information while playing. While playing, the application will be responsible for reporting the gamemode (if not openplaying), the hostname, the numplayers, the maxplayers, and any password in the callbacks, unless the PEER_REPORT_INFO flag is set in reportingOptions. The application will also need to report the players and pings in the callbacks, unless the PEER_REPORT_PLAYERS flag is set in reportingOptions. For more details, see the peerQR*Callback() in the callback section below.

Unicode Mappings

RoutineGSI_UNICODE Not DefinedGSI_UNICODE Defined
peerStartGamepeerStartGameApeerStartGameW

peerStartGameW and peerStartGameA are UNICODE and ANSI mapped versions of peerStartGame. The arguments of peerStartGameA are ANSI strings; those of peerStartGameW are wide-character strings.

Section Reference: Gamespy Peer SDK