Ejemplo n.º 1
0
    //=============================================================================

    public void ReportScoreTest(System.Int64 Score, string PlayerName, string PlayerID)
    {
                #if UNITY_EDITOR
        string sourceType = "Editor";
                #elif UNITY_IPHONE
        string sourceType = "iOS";
                #elif UNITY_ANDROID
        string sourceType = "iOS";         //"Android";
                #else
        string sourceType = "Unknown";
                #endif

        string CurCountry = PreHelpers.GetCountryCode();

        PlayerScore NewScore = new PlayerScore
        {
            playername      = PlayerName,
            playerid        = PlayerID,
            points          = Score,
            table           = "testboard",
            allowduplicates = false,
            source          = sourceType,
            fields          = new PDictionary
            {
                { "country", CurCountry }
            },
            filters = new PDictionary
            {
                { "perpage", 5 },
                { "highest", true },
                { "mode", eScoreTime.AllTime.ToString().ToLower() },
                { "allowduplicates", false }
            }
        };

        Playtomic.Leaderboards.SaveAndList(NewScore, ScoreListComplete);
    }
Ejemplo n.º 2
0
    //=============================================================================

    public void ReportScore(System.Int64 Score)
    {
        // Report score to GC/GP first
                #if UNITY_IPHONE
        if ((IsLoggedIn() == true) && (m_ManagerState == eManagerState.Idle))
        {
            GameCenterBinding.reportScore(Score, ScoreboardID);
            m_ManagerState = eManagerState.ReportScore;
        }
        else
        {
            if (ReportScoreFailEvent != null)
            {
                ReportScoreFailEvent("Error - not logged in or manager busy");
            }
        }
                #endif

                #if UNITY_ANDROID
        if ((IsLoggedIn() == true) && (m_ManagerState == eManagerState.Idle))
        {
            PlayGameServices.submitScore(ScoreboardIDAndroid, Score);
            m_ManagerState = eManagerState.ReportScore;
        }
        else
        {
            if (ReportScoreFailEvent != null)
            {
                ReportScoreFailEvent("Error - not logged in or manager busy");
            }
        }
                #endif

        // Now report score to playtomic system along with any custom parameters
        if (IsPlayerRegistered() == false)
        {
            return;
        }

                #if UNITY_EDITOR
        string sourceType = "Editor";
                #elif UNITY_IPHONE
        string sourceType = "iOS";
                #elif UNITY_ANDROID
        string sourceType = "iOS";         //"Android";
                #else
        string sourceType = "Unknown";
                #endif

        string CurCountry = PreHelpers.GetCountryCode();

        PlayerScore NewScore = new PlayerScore
        {
            playername      = GetPlayerName(),
            playerid        = GetPlayerID(),
            points          = Score,
            table           = ScoreboardID,
            allowduplicates = false,
            source          = sourceType,
            fields          = new PDictionary
            {
                { "country", CurCountry }
            }
        };

        Playtomic.Leaderboards.Save(NewScore, ScoreSubmitComplete);
    }