Question about Reward service

0 votes
Version : 25
Hi!

I have 3 reward, Bronze, Silver and Gold. And I have 3 leaderdboard for this 3 rewards.

Bronze = 0 - 2000 Trophys

Silver= 2000-4000 Trophys

Gold = +4000 Trophys

All work fine but I have a problem, when some user raise 2000 trophys I want to delete this user on Bronze leaderboard and move to Silver Leaderboard. I dont see any method for delete record or move between Reward.

How I can make this?
asked Aug 25 in Unity by rupas30 (15 points)

2 Answers

0 votes
Hi Rupas,

Apologies for late reply.

Could you please share some details like:

1. How are saving Trophys? Which API are you using?

2. How are you managing the leaderboard and rewards together? Please share the APIs you are using.

It will help us to understand the query in better way.

Thanks.
answered Aug 28 by rajeev.etc (1,498 points)
Please see the answer
0 votes

Thank for reply.

 

1.- For Trophys etc I am using Reward Service API.

2.- Same for leaderboard

 

Example how I use API for show leaderboard for Silver Division:

 

 public GameObject grid;
    public GameObject prefab;

    private string gameName = GlobalContext.gameName;
    private string rewardName = GlobalContext.TrophySilver;
    private int Max = 100;



    RewardService rewardService;



    // Use this for initialization
    void Start()
    {

        App42API.Initialize(GlobalContext.APIKEY, GlobalContext.APISECRET);

        rewardService = App42API.BuildRewardService();
        rewardService.GetTopNRewardEarners(gameName, rewardName, Max, this);

    }



    public void OnSuccess(object response)
    {

        IList<Reward> reward = (IList<Reward>)response;
        int ScorePos = 0;


        for (int i = 0; i < reward.Count; i++)
        {

            ScorePos++;
            Debug.Log("rewardName is: " + reward[i].rank + " UserName: " + reward[i].GetUserName() + " rewardName is: " + reward[i].GetName() + " Point is : " + reward[i].GetPoints());

            GameObject go = Instantiate(prefab, Vector3.zero, Quaternion.identity, grid.transform) as GameObject;
            ClasificacionPlayerData data = go.GetComponent<ClasificacionPlayerData>();

            data.NamePlayer = reward[i].GetUserName();
            data.Score = reward[i].GetPoints().ToString();
            data.TopNumber = ScorePos.ToString();

        }


    }






    public void OnException(Exception e)
    {

        Debug.Log("Exception: " + e);

    }

 

answered Aug 28 by rupas30 (15 points)
Hi Rupas,
Apologies for late reply.
I have already put a request to provide DeleteReward API and I will update you once it is live.
Thanks.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
Migrate from Parse to ShepHertz App42
...