GameSpy SDK


Creates a new staging room with the local player as the host.

void peerCreateStagingRoomWithSocket(
PEER peer,
const gsi_char * name,
int maxPlayers,
const gsi_char password[PEER_PASSWORD_LEN],
SOCKET socket,
unsigned short port,
peerJoinRoomCallback callback,
void * param,
PEERBool blocking );
RoutineRequired HeaderDistribution


[in] Initialized peer object.
[in] The name of the staging room.
[in] Optional max number of players allowed in the room. May be 0.
[in] Optional room password.
[in] The socket that is being shared. Parameter used when calling peerCreateStagingRoomWithSocket.
[in] The local port the socket is bound to. Parameter used when calling peerCreateStagingRoomWithSocket.
[in] Callback function called when the operation completes.
[in] Pointer to user data. This is optional and will be passed unmodified to the callback function.
[in] When set to PEERTrue, this call will not return until the operation has completed.


The peerCreateStagingRoomWithSocket creates a new staging room, with the local player hosting. If the password parameter is not NULL or "", this will create a passworded room. The same case-sensitive password needs to be passed into peerJoinStagingRoom[ByIP]() for other player's to join the room. Spaces in passwords are not allowed. Any password with spaces should be stripped of those spaces before calling this function, or a warning to the user will suffice. No more than maxPlayers players will be allowed in the room, unless maxPlayers is set to 0, in which case no limit is set and the maxplayers key is not reported. If the user is in a group room when this function is called, then the room will be reported as being a part of that group (even if the local user then leaves and joins another group).
If successful, the peerQR*Callback() callbacks will start getting called. These are used to provide information about the room to other players. For more information on what to report in the callbacks, see their descriptions.
If peerCreateStagingRoomWithSocket is used, the socket provided must be an already created UDP socket. It will be used for sending out query replies, and any queries the application reads off of the socket must be passed to Peer using peerParseQuery(). This can be useful when running a game host behind a NAT/firewall/proxy--for a full explanation of how this helps, see the "NAT and Firewall Support" appendix in the "GameSpy Query and Reporting 2 SDK" documentation.
This function is only valid if a title is set. If the user is already in a staging room, this function will fail.

Section Reference: Gamespy Peer SDK