public void GSPostLeaderboardScore(c2s_Leaderboard_Score packet) { Log.Info("GSPostLeaderboardScore"); LogEventRequest logEventRequest = new LogEventRequest(); logEventRequest.SetEventKey(packet.eventKey); logEventRequest.SetEventAttribute("SCORE", packet.SCORE); Log.InfoFormat("Data send to server: {0}", packet.ToString()); logEventRequest.Send(response => { if (response.HasErrors) { Debug.LogWarning("Error in GSPostLeaderboardScore()"); Debug.Log("Error: " + response.Errors.JSON); } else { Debug.Log("GSPostLeaderboardScore() succeed"); Debug.Log(response.JSONString); } }); }
private void PostScoreToleaderboard() { if (IsInternetConnected() && NetworkManager.Instance.IsAuthenticated) { Log.Info("PostScoreToleaderboard()"); // send leaderboard_score packet to server for leaderboard service c2s_Leaderboard_Score packet = new c2s_Leaderboard_Score(); packet.eventKey = PacketType.c2s_Leaderboard_Score.ToString(); packet.SCORE = PlayerData.Instance.Player.Score; NetworkManager.Instance.GSPostLeaderboardScore(packet); } }