void lookThrough(GSEnumerable <AroundMeLeaderboardResponse._LeaderboardData> arr)
 {
     foreach (var d in arr)
     {
         GameObject score = Instantiate(scorePrefab);
         score.transform.SetParent(parent);
         score.GetComponent <TextMeshProUGUI>().SetText(d.Rank + ": " + d.UserName + " - " + d.JSONData["S"].ToString());
     }
 }
Пример #2
0
        public static GameFriendsReply GameFriendsToGameFriendsReply(GSEnumerable <ListGameFriendsResponse._Player> socialFriends)
        {
            GameFriendsReply reply = new GameFriendsReply(true);

            foreach (ListGameFriendsResponse._Player friend in socialFriends)
            {
                reply.Friends.Add(new GameFriendsReply.Friend(friend.ExternalIds.GetString("FB"), friend.DisplayName));
            }

            return(reply);
        }
    private void GetMessageResponseCallBack(ListTeamChatResponse response)
    {
        messages = response.Messages;
        //int count = 0;
        List <ChatTableLogic.PlayerMessageData> messageData = new List <ChatTableLogic.PlayerMessageData>();

        foreach (ListTeamChatResponse._ChatMessage msg in messages)
        {
            ChatTableLogic.PlayerMessageData data = new ChatTableLogic.PlayerMessageData();
            data.messages = msg.Message;
            data.player   = msg.Who;
            data.playerID = msg.FromId;
            messageData.Add(data);
            //Debug.Log("Message " + count + ": " + msg.Message);
        }
        chatTable.setChatMessage(messageData.ToArray());
    }
Пример #4
0
    private void ProcessLeaderBoardData(LeaderboardDataResponse response)
    {
        string challengeInstanceId = response.ChallengeInstanceId;
        GSEnumerable <LeaderboardDataResponse._LeaderboardData> data = response.Data;
        string leaderboardShortCode = response.LeaderboardShortCode;
        GSData scriptData           = response.ScriptData;

        foreach (LeaderboardDataResponse._LeaderboardData entry in data)
        {
            string score = entry.JSONData[scoreKey].ToString();
            Debug.Log("Score raw: " + score);
            string name = entry.UserName.ToString();
            playerScores.Add(score);
            playerNames.Add(name);
        }
        DisplayLeaderboard();
    }
Пример #5
0
 public static void MatchFoundListener()
 {
     MatchFoundMessage.Listener = (message) =>
     {
         if (LoginWithFB.FacebookLoggedIn)
         {
             isOppnentsImageID_received = false;
             messageToSend = LoginWithFB.url;
         }
         ShowToast.MyShowToastMethod("Match Made:");
         GSEnumerable <MatchFoundMessage._Participant> participants = message.Participants;
         foreach (MatchFoundMessage._Participant i in participants)
         {
             playerNames[count] = i.DisplayName;
             playerIDs[count]   = i.Id;
             count++;
         }
     };
 }
Пример #6
0
        public void OnClickButton_Friends()
        {
            FriendsDict = new Dictionary <string, string>();

            new ListGameFriendsRequest().Send((response) =>
            {
                GSEnumerable <ListGameFriendsResponse._Player> friends = response.Friends;
                GSData scriptData = response.ScriptData;


                foreach (var i in friends)
                {
                    FriendsDict.Add(i.Id, i.DisplayName);
                }

                _gameManager.OnFriendsUpdate(FriendsDict);

                SetPanelState_Friends();
            });

            RemoveFromFriendDict();
        }
    // Use this for initialization
    void Start()
    {
        int    entryCount           = 3;
        int    includeFirst         = 1;
        int    includeLast          = 1;
        string leaderboardShortCode = "HIGHSCORE";

        new AroundMeLeaderboardRequest()
        .SetEntryCount(entryCount)
        .SetIncludeFirst(includeFirst)
        .SetIncludeLast(includeLast)
        .SetLeaderboardShortCode(leaderboardShortCode)
        .Send((response) => {
            GSEnumerable <AroundMeLeaderboardResponse._LeaderboardData> data  = response.Data;
            GSEnumerable <AroundMeLeaderboardResponse._LeaderboardData> first = response.First;
            GSEnumerable <AroundMeLeaderboardResponse._LeaderboardData> last  = response.Last;

            lookThrough(first);
            lookThrough(data);
            lookThrough(last);
        });
    }
 void CheckedTeams(GetMyTeamsResponse response)
 {
     teams = response.Teams;
     Debug.Log(teams);
     JoinGlobalTeam();
 }