Sign In Register

How can we help you today?

Start a new topic

Challenges: separate attempt consumption from score

Hi,

I am trying to create a "special tournament" system with the following specifications:

  1. player joins a tournament
  2. he can play up to N matches (individual matches are done using RT)
  3. before each match, he consumes an attempt (Start event)
  4. after each match, he sends his score to the challenge leaderboard (End event)
(step 3 and 4 are separated to prevent player from cheating by closing the app just before he loses or similar)

so, is there a way using challenges to consume an attempt with the Start event and send the score with the End event even if its corresponding Start event has consumed his last attempt?

sequence of operations (example: challenge "A" with 3 attempts)
join "A" > Start [consume attempt 1] > End(score = s1) > Start [consume attempt 2] > End(score = s2) > Start [consume last attempt] > End ( score = s3) [i want this to be accepted]

each End event must have a corresponding Start, and each Start event may have up to 1 corresponding End (or none if the player rage-quitted)


Hi Mauro,


You can use SparkChallenges consumeTurn call to take a players turn. This will take a players turn silently and move to the next player.


"is there a way using challenges to consume an attempt with the Start event and send the score with the End event even if its corresponding Start event has consumed his last attempt?"


You'll have to break this down a little bit more for us. Are you saying you want to have a specific "Start" event for the first attempt in a challenge by a player ? Then when you know its the players final turn in a challenge send it via an "End" event ?


Thanks,

Liam

nope, I just want to have a challenge with the following characteristics:

  1. the challenge represent a tournament
  2. players can play at most N games in the tournament
  3. the turn is consumed at the beginning of the game (so player can't cheat if they lose)
  4. at the end of each game, player sends the score
  5. if player quits before ending the game, score is not submitted but attempt should be consumed
my game will be for mobile, so users can (and will) quit the app by backgrounding it and kill it with swipe, so i can't rely on "OnApplicationQuit" event from Unity - and if app is killed but RT session is still alive, player can reconnect and continue game

the challenge events will typically go "start [consume attempt] -> end [submit score] -> start [consume attempt] -> end [submit score] -> start [consume attempt] -> end [submit score] -> etc..."
but occasionally they can go "start [consume attempt] -> end [submit score] -> start [consume attempt] -> start [consume attempt] -> end [submit score] -> etc..." (player lost an end event and the right to submit his score (is counted as 0 points))

Hi,

anyone here?

Login to post a comment