Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Bistudio · Apr 30, 2015 at 10:40 PM · c#facebookscoreleaderboardreview

Facebook leaderboard issue

Goodmorning everyone, Tomorrow should be available my new game, but today doing some tests I realized that the game is not the scores of my friends (apart from my brother who is developing the game with me).

Yesterday I put it available to all of facebook as you can see from the image.

alt text

Unfortunately for lack of things (game trailer) we could send in review only yesterday, my question is to see the scores of friends we have to wait the end of the review by facebook? or there is something wrong in my script? (The one below)

public void SetScores() { var scoreData = new Dictionary (); scoreData ["score"] = currentScore.ToString ();

     FB.API ("/me/scores", Facebook.HttpMethod.POST, delegate(FBResult result) {
         Debug.Log ("Score submit result: " + result.Text);
     }, scoreData);
 }

 public void QueryScores()
 {
     FB.API ("/app/scores?fields=score,user.limit(30)", Facebook.HttpMethod.GET, ScoresCallback);
 }
 
 private void ScoresCallback (FBResult result)
 {
     Debug.Log ("Scores callback" + result.Text);
     scoresList = Util.DeserializeScores (result.Text);
     
     foreach(Transform child in ScoreScrollList.transform)
     {
         GameObject.Destroy (child.gameObject);
     }
     
     foreach(object score in scoresList)
     {
         var entry = (Dictionary<string,object>) score;
         var user = (Dictionary<string,object>) entry["user"];
         
         
         GameObject ScorePanel;
         ScorePanel = Instantiate (ScoreEntryPanel) as GameObject;
         ScorePanel.transform.SetParent(ScoreScrollList.transform, false);
         Transform ThisScoreScore = ScorePanel.transform.Find("Friend Score");
         
         Text ScoreScore = ThisScoreScore.GetComponent<Text>();
         
         ScoreScore.text = entry["score"].ToString ();
         
         Transform TheUserAvatar = ScorePanel.transform.Find ("FriendAvatar");
         Image UserAvatar = TheUserAvatar.GetComponent<Image>();
         
         
         FB.API (Util.GetPictureURL(user["id"].ToString (), 128,128), Facebook.HttpMethod.GET, delegate(FBResult pictureResult)
                 {
             string imageUrl = DeserializePictureURLString(pictureResult.Text);
             StartCoroutine(LoadPictureEnumerator(imageUrl,pictureTexture =>
                                                  {
                 UserAvatar.sprite = Sprite.Create (pictureTexture, new Rect(0,0,128,128), new Vector2(0,0));
             }));
         });
     }
     
 }

 delegate void LoadPictureCallback (Texture2D texture);
 
 IEnumerator LoadPictureEnumerator(string url, LoadPictureCallback callback)    
 {
     WWW www = new WWW(url);
     yield return www;
     callback(www.texture);
 }
 
 public string DeserializePictureURLString(string response)
 {
     return DeserializePictureURLObject(Json.Deserialize(response));
 }
 
 public string DeserializePictureURLObject(object pictureObj)
 {
     var picture = (Dictionary<string, object>)(((Dictionary<string, object>)pictureObj)["data"]);
     object urlH = null;
     if (picture.TryGetValue("url", out urlH))
     {
         return (string)urlH;
     }
     return null;
 }
 
 private string GetPictureURL(string facebookID, int? width = null, int? height = null, string type = null)
 {
     string url = string.Format("/{0}/picture", facebookID);
     string query = width != null ? "&width=" + width.ToString() : "";
     query += height != null ? "&height=" + height.ToString() : "";
     query += type != null ? "&type=" + type : "";
     query += "&redirect=false";
     if (query != "") url += ("?g" + query);
     return url;
 }


I know it's a question a little silly but I need to know.

Thanks in advance.

immagine.png (30.1 kB)
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bistudio · May 04, 2015 at 12:14 PM 0
Share

Do you have any suggestions?

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Implement own highscore script into existing FB SDK example 1 Answer

How I do load scene by Singleton Patten Score and Countdown Timer in Unity # C 0 Answers

Getting multiple photos at once but in the correct order with Facebook SDK 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges