The SC_UsersController requests lists of SC_User objects from the server based on different citeria.

The users may be requested based on a variety of different criteria such as:
  • User login

  • User email address

  • The local address book

  • A social provider

  • buddyhood

Some of the basic Use Cases are listed below:

Use Case 1: Search for users (email, login or by social provider)
  1. Set the match limit for the controller by using SC_UsersController_SetSearchLimit(). The search request stops returning user objects once this limit has been reached and will return only the number of matches instead. This number is limited to 999.

  2. Set the flag that indicates whether the search should extend beyond users of the current game by calling SC_UsersController_SetSearchesGlobal().

  3. Wait for a successful server response via delegate callbacks.

  4. Call SC_UsersController_GetUsers() to access the list of users that is retrieved from the server.

If the number of users matched on the server exceeds the limit set by SC_UsersController_SetSearchLimit(), the following happens:
Use Case 2: Load the buddy list of a user:
  1. Create an instance of UsersController, or re-use an existing instance.

  2. Call SC_UsersController_LoadBuddies() to make the server request.

  3. All the other search criteria are then ignored.

  4. Wait for notification via delegate callbacks.

  5. After a successful request, access the retrieved buddy list by using SC_User's SC_UsersController_GetUsers().

Last modified: 2014-09-29

Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus