Sign In Register

How can we help you today?

Start a new topic
Answered

Multiplayer Sync Pos & Leaderboard data when disconnected

Hello,


I have two questions.


1- In real time multiplayer games like FPS type, is there an official support to sync player position, shoots etc?

2- How to change leaderboard score if a player disconnects during the challange?


Best Answer

 Hey Ahmet,

Currently Gamesparks doesn't support that kind of live syncing at the moment, but it is something we are looking into for the future.


In regards to your second question though, there are a few ways you could go about it.


1 - You could wait till you challenge is completed and then post scores. That way you are ensured that only those logged in when the challenge is finished actually have their scores appear on the leaderboard.


2 - If that doesnt work for you, you can manually delete entries from a leaderboard using the deleteEntry() function.

     (check it out here -> https://docs.gamesparks.net/documentation/cloud-code-api/spark-cloud-code-api/sparkleaderboard )
    

 

Spark.getLeaderboards().getChallengeLeaderboard(challengeInstanceId).deleteEntry(userID, true);

 

So you could call that from an event when a player disconnects from the client-side, or you could hook that into the System -> Player Disconnected Cloud Code. You could even wrap it in a statement to check the player challenges, so it only deletes entries if they are currently in a challenge.

Hope that helps,

Sean

1 Comment

Answer

 Hey Ahmet,

Currently Gamesparks doesn't support that kind of live syncing at the moment, but it is something we are looking into for the future.


In regards to your second question though, there are a few ways you could go about it.


1 - You could wait till you challenge is completed and then post scores. That way you are ensured that only those logged in when the challenge is finished actually have their scores appear on the leaderboard.


2 - If that doesnt work for you, you can manually delete entries from a leaderboard using the deleteEntry() function.

     (check it out here -> https://docs.gamesparks.net/documentation/cloud-code-api/spark-cloud-code-api/sparkleaderboard )
    

 

Spark.getLeaderboards().getChallengeLeaderboard(challengeInstanceId).deleteEntry(userID, true);

 

So you could call that from an event when a player disconnects from the client-side, or you could hook that into the System -> Player Disconnected Cloud Code. You could even wrap it in a statement to check the player challenges, so it only deletes entries if they are currently in a challenge.

Hope that helps,

Sean

Login to post a comment