SAKESearchForRecordsInput

GameSpy SDK

SAKESearchForRecordsInput

Input object passed to sakeSearchForRecords.

typedef struct 
{
char * mTableId;
char ** mFieldNames;
int mNumFields;
char * mFilter;
char * mSort;
int mOffset;
int mMaxRecords;
char * mTargetRecordFilter;
int mSurroundingRecordsCount;
int * mOwnerIds;
int mNumOwnerIds;
gsi_bool mCacheFlag;
} SAKESearchForRecordsInput;

Members

mTableId
Points to the tableid of the table to be searched.
mFieldNames
Points to an array of strings, each of which contains the name of a field for which to return values. This list controls the values which will be returned as part of the response. The array can contain just one field name, the names of all the fields in the table, or any subset of the field names.
mNumFields
Stores the number of strings in the mFieldNames array.
mFilter
SQL-like filter string which is used to search for records based on the values in their fields. For example, to find everyone who has a score of more than 50 use “score > 50”, or to find everyone who has a name that starts with an A use “name like ‘A%’”. Note that a field can be used in the filter string even if it is not listed in the mFieldNames array, and that file metadata fields can be used in a filter string.
mSort
SQL-like sort string which is used to sort the records which are found by the search. To sort the results on a particular field, just pass in the name of that field, and the results will be sorted from lowest to highest based on that field. To make the sort descending instead of ascending add “ desc” after the name of the field. Note that a field can be used in the sort string even if it is not listed in the mFieldNames array, and that file metadata fields can be used in a sort.
mOffset
If not set to 0, then the backend will return records starting from the given offset into the result set.
mMaxRecords
Used to specify the maximum number of records to return for a particular search.
mTargetRecordFilter
Used to specify a single record to return - when done in conjunction with mSurroundingRecordsCount, this will return the "target" record plus the surrounding records above and below this target record. Can also be used to specify a "set" of target records to return, but when used in this context the surrounding records count does not apply.
mSurroundingRecordsCount
Used in conjunction with mTargetRecordFilter - specifies the number of records to return above and below the target record. (e.g. if = 5, you will receive a maximum of 11 possible records, the target record + 5 above and 5 below).
mOwnerIds
Specifies an array of ownerIds (profileid of record owner) to return from the search.
mNumOwnerIds
Specifies the number of ids contained in the mOwnerIds array.
mCacheFlag
Enables caching if set to gsi_true. Defaults to no caching if none is specified.

Remarks

In addition to the fields which the developer defines, you can also request values for the “recordid” field, “ownerid” field (if the table has an owner type of profile), and “num_ratings” and “average_rating” fields (if the table has its ratings option set to true).

See Appendix II in the Overview for more information on special fields used in Sake.

Section Reference: Gamespy Sake SDK

See Also: sakeSearchForRecords