コード例 #1
0
    public IEnumerator RejectReceivedFriendRequest(Friendship fromFriend)
    {
        Debug.Log("Rejecting friend request");

        Dictionary <string, string> data = new Dictionary <string, string>();

        data ["fromUser"] = fromFriend.GetOtherUser().GetUserId();

        ServerCall waitFor = new ServerCall(INSTANCE.SendServerInformationRequest(REJECT_FRIEND_REQUEST, data));

        yield return(StartCoroutine(waitFor.call()));

        string infoText = waitFor.Response;

        Debug.Log("Received " + infoText);

        LoggedInUser.GetLoggedInUser().friends.Remove(fromFriend);

        yield return(infoText);
    }
コード例 #2
0
    public IEnumerator CancelSentFriendRequest(Friendship toUser)
    {
        Debug.Log("Canceling sent friend request");

        Dictionary <string, string> data = new Dictionary <string, string>();

        data ["toUser"] = toUser.GetOtherUser().GetUserId();

        ServerCall waitFor = new ServerCall(INSTANCE.SendServerInformationRequest(CANCEL_FRIEND_REQUEST, data));

        yield return(StartCoroutine(waitFor.call()));

        string infoText = waitFor.Response;

        Debug.Log("Received " + infoText);

        LoggedInUser.GetLoggedInUser().friends.Remove(toUser);

        yield return(infoText);
    }
コード例 #3
0
    public IEnumerator AcceptReceivedFriendRequest(Friendship existingToAccept)
    {
        Debug.Log("Accepting friend request");

        Dictionary <string, string> data = new Dictionary <string, string>();

        data ["fromUser"] = existingToAccept.GetOtherUser().GetUserId();

        ServerCall waitFor = new ServerCall(INSTANCE.SendServerInformationRequest(ACCEPT_FRIEND_REQUEST, data));

        yield return(StartCoroutine(waitFor.call()));

        string infoText = waitFor.Response;

        Debug.Log("Received " + infoText);

        Friendship accepted = JsonUtility.FromJson <Friendship> (infoText);

        LoggedInUser.GetLoggedInUser().friends.Remove(existingToAccept);
        LoggedInUser.GetLoggedInUser().friends.Add(accepted);

        yield return(accepted);
    }
コード例 #4
0
 public void SetFriendship(Friendship friendship)
 {
     friend = friendship;
     avatarImage.SetUser(friend.GetOtherUser());
     usernameText.text = friend.GetOtherUser().GetUserFriendlyName();
 }
コード例 #5
0
 private void OnMenuItemButton()
 {
     userProfile.ShowUser(friend.GetOtherUser());
 }