Exemple #1
0
    private void UpdatePlayerScore(bool win)
    {
        attack.EndGame();
        defense.EndGame();
        float ratingDiff   = UIManager.CurrentRival.score - UIManager.CurrentUser.score;
        float den          = 1 + (float)Math.Pow(10, ratingDiff / 400);
        float exp          = 1.0f / den;
        float ratingChange = win?1:0;

        ratingChange = (ratingChange - exp) * 32;
        req          = new ScoreUpdateRequest()
        {
            Username     = UIManager.CurrentUser.user_id,
            Score        = ratingChange,
            SessionToken = UIManager.CurrentUser.session_tk
        };
        StartCoroutine("PostScoreUpdate");
    }