ServerBrowserNew
Initialize the ServerBrowser SDK.
- ServerBrowser ServerBrowserNew(
- const gsi_char * queryForGamename,
- const gsi_char * queryFromGamename,
- const gsi_char * queryFromKey,
- int queryFromVersion,
- int maxConcUpdates,
- int queryVersion,
- SBBool lanBrowse,
- ServerBrowserCallback callback,
- void * instance );
Routine | Required Header | Distribution |
---|---|---|
ServerBrowserNew | <sb_serverbrowsing.h> | SDKZIP |
Return Value
This function returns the initialized ServerBrowser interface. No return value is reserved to indicate an error.
Parameters
- queryForGamename
- [in] Servers returned will be for this Gamename.
- queryFromGamename
- [in] Your assigned GameName.
- queryFromKey
- [in] Secret key that corresponds to the queryFromGamename.
- queryFromVersion
- [in] Set to zero unless directed otherwise by GameSpy.
- maxConcUpdates
- [in] The maximum number of queries the ServerBrowsing SDK will send out at one time.
- queryVersion
- [in] The QueryReporting protocol used by the server. Should be QVERSION_GOA or QVERSION_QR2. See remarks.
- lanBrowse
- [in] The switch to turn on only LAN browsing
- callback
- [in] Function to be called when the operation completes.
- instance
- [in] Pointer to user data. This is optional and will be passed unmodified to the callback function.
Remarks
The ServerBrowserNew function initializes the ServerBrowsing SDK. Developers should then use ServerBrowserUpdate or ServerBrowserLANUpdate to begin retrieving the list of registered game servers.
Unicode Mappings
Routine | GSI_UNICODE Not Defined | GSI_UNICODE Defined |
---|---|---|
ServerBrowserNew | ServerBrowserNewA | ServerBrowserNewW |
ServerBrowserNewW and ServerBrowserNewA are UNICODE and ANSI mapped versions of ServerBrowserNew. The arguments of ServerBrowserNewA are ANSI strings; those of ServerBrowserNewW are wide-character strings.
Example
(In this particular file, we should refer them to the ServerBrowser sample as it is very simple already.)/* SERVERBROWSERNEW.C: This program uses ServerBrowserNew * to initialize the ServerBrowsing SDK */ #include <sb_serverbrowsing.h> void main( void ){ ServerBrowser aServerBrowser = SBServerBrowserNew("gmtest", "HA6zkS", 0, 10, QVERSION_QR2, SBCallback, NULL); }
Section Reference: Gamespy Server Browsing SDK
See Also: ServerBrowserFree, ServerBrowserUpdate, ServerBrowserLANUpdate