Friends & Profile

개요

Edit your own profile, look up another player by their player id, and send them a friend request or follow them. Once they accept, each of you appears under Your friends; players you follow appear under Players you follow. A profile has three parts: a name everyone sees, text only friends see, and text only followers see.

체험 방법

  1. Under You, fill in Your profile: a name everyone sees, text for your friends, and text for your followers. Then press Save your profile.
  2. Open this demo in another browser (or a private window) for a second player, and press Copy your id in one of them.
  3. In the other browser, paste the id under Find a player by their id (Paste an id), press Look them up, then press Send a friend request or Follow.
  4. The receiving player sees the sender’s name under Friend requests to you and presses Accept or Decline. The sender sees it under Friend requests you sent and can press Cancel.
  5. After accepting, both players see each other’s name and friend text under Your friends, with Remove to end the friendship. A followed player appears under Players you follow with their follower text, and Unfollow ends the follow.

Profile edits are not announced, so a name the other player changed shows in your lists only once they are read again (at most 15 minutes, or on reload).

사용하는 GS2 서비스

  • GS2-Friend: GS2-Friend holds the profile (public, friend-only and follower-only parts), the friend and follow lists, and the friend requests in each direction. Receiving, accepting, rejecting and cancelling a request, and removing a friend, are pushed to the other player as notifications, so their page updates right away.

GS2 Studio에서 사용하기

GS2 Studio의 Simple 모드에서 Add features 를 열고 Friends & Profile 의 Add 를 누르면 이 기능을 자신의 프로젝트에 가져올 수 있습니다. 패키지를 직접 지정하려면 Add from GitHub 를 선택하고 아래 패키지를 입력합니다.

https://github.com/gs2io/gs2-studio-package/tree/main/foundation-social-graph/packages/foundation-social-graph
  • Owner: gs2io
  • Repository: gs2-studio-package
  • Subdirectory: foundation-social-graph/packages/foundation-social-graph

소스 코드