User Operations
User operations allow your game to interact with the Game Jolt profile of the person currently playing. This is essential for features like friends lists and personalized gameplay.
đ¤ Fetching User Profilesâ
You can get basic information about a user (like their avatar, profile description, and friends) using their Username or User ID.
đ Profile Dataâ
This contains:
- User ID: The unique numeric ID for each user.
- Username: The handle chosen by the user.
- Avatar URL: Link to their profile picture.
- User Type: Whether the user is a standard member, moderator, or administrator.
Image: How user profiles and avatars are displayed on Game Jolt.
đ Implementation (Unity SDK)â
In the Unity SDK, fetching user data is straightforward:
using GameJolt.API;
public void GetUserInfo(string username) {
Users.Get(username, (User user) => {
if (user != null) {
Debug.Log("User: " + user.Name);
Debug.Log("Status: " + user.Status);
} else {
Debug.Log("User not found.");
}
});
}
đ°ī¸ Essential Namespaces Overviewâ
As your game grows, you'll need more than just user profiles. Here's a breakdown of the key namespaces:
| Namespace | Symbol | Description |
|---|---|---|
| Users | đ¤ | Fetch user info and authentication. |
| Sessions | đĄ | Track user session (active/ping). |
| Trophies | đ | The Achievements system. |
| Scores | đ | Leaderboards and score management. |
| Friends | đ¤ | Listing and interacting with friends. |
| Data-Store | đĻ | Cloud-based data storage for save games. |
| Batch | ⥠| Group multiple API requests into one call. |
Image: Diagram of how namespaces communicate with the Game Jolt backend.
What's Next?
Learn how to store game progress in the Cloud Data Storage guide!