peerParseQuery
Pass a manually received server query to the peer SDK. Use with peerStartReportingWithSocket or peerCreateStagingRoomWithSocket.
- void peerParseQuery(
- PEER peer,
- gsi_char * query,
- int len,
- struct sockaddr * sender );
Routine | Required Header | Distribution |
---|---|---|
peerParseQuery | <peer.h> | SDKZIP |
Parameters
- peer
- [in] Initialized peer object.
- query
- [in] String of query data received on the socket.
- len
- [in] String length of query, not including the NULL.
- sender
- [in] The address this query was received from.
Remarks
The peerParseQuery can be used to translate peer packets into data. If hosting a room or a game using shared sockets, then this function needs to be used to pass any data received on that socket to Peer. When data is received on the socket, the application must determine if the data is a query meant to be passed to Peer, or if it is data for the game itself. This can be done by checking the first two bytes in a packet for QR_MAGIC_1 and QR_MAGIC_2.
Again, this function only needs to be called if reporting over a shared socket, which is initiated by either peerCreateStagingRoomWithSocket() or peerStartReportingWithSocket().
Section Reference: Gamespy Peer SDK