SC_User

Instances of SC_User model the game user.

Scoreloop considers users to be unique players tied to unique devices. Instances of SC_Session maintain an instance of the local user, referred to as the session user.

Instances of SC_User that are not the session user may not have all properties available.

However, the following properties are always available:
  • Login

SC_User objects are managed by two controllers:
  1. The SC_UserController is used to retrieve information for an arbitrary user from the server. It is also used to update the attributes of the session user.

  2. The SC_UsersController, retrieves lists of SC_User objects from the server.

Sample code to copy string into QStrings:

To display strings received from the Scoreloop APIs (e.g. when using SC_User_GetLogin), watch out for string encodings issues. The Scoreloop APIs always return UTF-8 encoded strings. If the UI Toolkit has it's own datatype for strings (e.g. QString in the case of the Cascades framework), ensure that the encoding is respected when copying the Scoreloop string into the frameworks datatype.

 SC_String_h *mySCString = SC_User_GetLogin(myUser);

 QString myQString;
 if (mySCString && SC_String_GetData(mySCString)) // handle NULL cases
 {
   myQString = QString::fromUtf8(SC_String_GetData(mySCString)); // tell QString that the data we copy is UTF8
 }

Last modified: 2014-05-14



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

comments powered by Disqus