Beispiel #1
0
    private void OnScoreSubmitted(string data)
    {
        Debug.Log("OnScoreSubmitted " + data);

        if (data.Equals(string.Empty))
        {
            Debug.Log("GooglePlayManager OnScoreSubmitted, no data avaiable");
            return;
        }

        string[] storeData;
        storeData = data.Split(AndroidNative.DATA_SPLITTER [0]);

        GPLeaderBoard        lb     = GetLeaderBoard(storeData [1]);
        GP_LeaderboardResult result = new GP_LeaderboardResult(lb, storeData [0]);

        if (result.IsSucceeded)
        {
            Debug.Log("Score was submitted to leaderboard -> " + lb);

            UpdatePlayerScoreLocal(lb);
        }
        else
        {
            ActionScoreSubmited(result);
        }
    }
Beispiel #2
0
    private void OnScoreSubmited(GP_LeaderboardResult result)
    {
                #if DEBUG_INFO
        Debug.Log("AndroidManager: score submited for leaderboard " + result.Leaderboard.Id + " with result:" + result.Message);
                #endif

                #if UNITY_ANDROID
        GooglePlayManager.ActionScoreSubmited -= OnScoreSubmited;
                #endif
    }
    void Android_HandleActionScoreSubmited(GP_LeaderboardResult res)
    {
        UM_Leaderboard leaderboard = UltimateMobileSettings.Instance.GetLeaderboardByAndroidId(res.Leaderboard.Id);

        if (leaderboard != null)
        {
            leaderboard.Setup(res.Leaderboard);

            UM_LeaderboardResult result = new UM_LeaderboardResult(leaderboard, res);
            ActionScoreSubmitted(result);
        }
    }
 private void OnScoreSubmited(GP_LeaderboardResult result)
 {
     if (result.IsSucceeded)
     {
         SA_StatusBar.text = "Score Submited:  " + result.Message
                             + " LeaderboardId: " + result.Leaderboard.Id
                             + " LongScore: " + result.Leaderboard.GetCurrentPlayerScore(GPBoardTimeSpan.ALL_TIME, GPCollectionType.FRIENDS).LongScore;
     }
     else
     {
         SA_StatusBar.text = "Score Submit Fail:  " + result.Message;
     }
 }
Beispiel #5
0
    private void OnScoreDataRecevied(string data)
    {
        Debug.Log("OnScoreDataRecevide");
        string[] storeData;
        storeData = data.Split(AndroidNative.DATA_SPLITTER [0]);

        GP_LeaderboardResult result = new GP_LeaderboardResult(null, storeData[0]);

        if (result.IsSucceeded)
        {
            GPBoardTimeSpan  timeSpan        = (GPBoardTimeSpan)System.Convert.ToInt32(storeData[1]);
            GPCollectionType collection      = (GPCollectionType)System.Convert.ToInt32(storeData[2]);
            string           leaderboardId   = storeData[3];
            string           leaderboardName = storeData[4];

            GPLeaderBoard lb = GetLeaderBoard(leaderboardId);
            lb.UpdateName(leaderboardName);
            result = new GP_LeaderboardResult(lb, storeData [0]);

            for (int i = 5; i < storeData.Length; i += 8)
            {
                if (storeData[i] == AndroidNative.DATA_EOF)
                {
                    break;
                }

                long score = System.Convert.ToInt64(storeData[i]);
                int  rank  = System.Convert.ToInt32(storeData[i + 1]);

                string playerId = storeData[i + 2];
                if (!players.ContainsKey(playerId))
                {
                    GooglePlayerTemplate p = new GooglePlayerTemplate(playerId, storeData[i + 3], storeData[i + 4], storeData[i + 5], storeData[i + 6], storeData[i + 7]);
                    AddPlayer(p);
                }

                GPScore s = new GPScore(score, rank, timeSpan, collection, lb.Id, playerId);
                lb.UpdateScore(s);

                if (playerId.Equals(player.playerId))
                {
                    lb.UpdateCurrentPlayerScore(s);
                }
            }
        }

        ActionScoresListLoaded(result);
    }
	//--------------------------------------
	// Private Methods
	//--------------------------------------
	
	private void DispatchUpdate() {
		if(Scores.Count == 6) {
			
			GPLeaderBoard board = GooglePlayManager.Instance.GetLeaderBoard(_leaderboardId);
			GP_LeaderboardResult result;			
			
			if(_ErrorData != null) {
				result =  new GP_LeaderboardResult(board, _ErrorData);
			} else {
				board.UpdateCurrentPlayerScore(Scores);
				result =  new GP_LeaderboardResult(board, _ErrorData);
			}

			GooglePlayManager.Instance.DispatchLeaderboardUpdateEvent(result);
			
		}
	}
Beispiel #7
0
    //--------------------------------------
    // Private Methods
    //--------------------------------------

    private void DispatchUpdate()
    {
        if (Scores.Count == 6)
        {
            GPLeaderBoard        board = GooglePlayManager.Instance.GetLeaderBoard(_leaderboardId);
            GP_LeaderboardResult result;

            if (_ErrorData != null)
            {
                result = new GP_LeaderboardResult(board, _ErrorData);
            }
            else
            {
                board.UpdateCurrentPlayerScore(Scores);
                result = new GP_LeaderboardResult(board, _ErrorData);
            }

            GooglePlayManager.Instance.DispatchLeaderboardUpdateEvent(result);
        }
    }
Beispiel #8
0
 public void DispatchLeaderboardUpdateEvent(GP_LeaderboardResult result)
 {
     ActionScoreSubmited(result);
 }
Beispiel #9
0
	void OnScoreSbumitted (GP_LeaderboardResult result) {
		//SA_StatusBar.text = "Score Submit Resul:  " + result.message;
		LoadScore();
	}
	private void OnScoreSubmited(GP_LeaderboardResult result) {
		if (result.isSuccess) {
			SA_StatusBar.text = "Score Submited:  " + result.message
			+ " LeaderboardId: " + result.Leaderboard.Id
			+ " LongScore: " + result.Leaderboard.GetCurrentPlayerScore(GPBoardTimeSpan.ALL_TIME, GPCollectionType.GLOBAL).LongScore;
		} else {
			SA_StatusBar.text = "Score Submit Fail:  " + result.message;
		}
	}
 void OnScoreSbumitted(GP_LeaderboardResult result)
 {
     SA_StatusBar.text = "Score Submit Resul:  " + result.Message;
     LoadScore();
 }
Beispiel #12
0
 void OnScoreSbumitted(GP_LeaderboardResult result)
 {
 }