The SC_ChallengeController manages single instance of the SC_Challenge class.
The SC_ChallengeController is used to
Accept a challenge
Reject a challenge
Submit a challenge's score or context to the server
The contender decides on a stake and creates a challenge. The contender also decides if the challenge should be open to any user or directed to a designated user.
The contender plays the game and submits the challenge and the score he obtained to the Scoreloop server.
A second Scoreloop user, the contestant, accepts the challenge and pays the challenge stake. If the challenge is open it may be accepted by any Scoreloop user. If it is a direct challenge, only the user, to whom the challenge was assigned by the contender may accept it.
The contestant plays the game and submits the score to Scoreloop.
Scoreloop compares the scores of the contender and the contestant in accordance with the game scoring schema as defined by the game developer, and declares a winner.
The winner takes the challenge prize (the combined contender and contestant stakes decreased by a challenge sink).
To create a challenge:
Call the SC_Client_CreateChallenge() method to create the challenge with the given stake and contestant.
The challenge contender is automatically set as equal to the current session user. The contestant is equal to the user argument passed in step 1. Pass a NULL value as the user argument instead, in order to create an open challenge. The controller automatically sets the challenge in the current session (for further easier access).
To accept, reject, or submit a challenge:
Get an instance of SC_ChallengeController or re-use an existing instance.
Call the SC_ChallengeController_SetChallenge() on the controller. This is the challenge that the controller will deal with. If this is not explicitly set, the controller will take the challenge from the current session instead.
Call the appropriate method to accept, reject, or submit the challenge.
Await notification of success using delegate callbacks.
Do not modify a challenge object, or any of its sub-objects like score or the userContext of a score, while one of the following asynchronous methods is in progress, as this might result in undefined results:
Last modified: 2013-08-14