### Manage Game Data with C# Data Persistence API Source: https://context7.com/mirrasdk/sdk5/llms.txt Demonstrates how to use the Data module for persistent storage of primitive types and serializable objects. Supports immediate synchronization for important data. Includes methods for setting, getting, checking existence, deleting keys, and forcing a save. ```csharp using MirraGames.SDK; using MirraGames.SDK.Common; using System; using UnityEngine; [Serializable] public class PlayerProgress { public int level; public int coins; public string[] unlockedItems; } public class DataManager : MonoBehaviour { private IData data; void Start() { // Access data module through SDK // data = sdk.Data; } public void SaveAndLoadData() { // Boolean data data.SetBool("tutorial_complete", true, important: true); bool tutorialDone = data.GetBool("tutorial_complete", defaultValue: false); // Integer data data.SetInt("high_score", 15000, important: true); int highScore = data.GetInt("high_score", defaultValue: 0); // Float data data.SetFloat("music_volume", 0.8f, important: false); float volume = data.GetFloat("music_volume", defaultValue: 1.0f); // String data data.SetString("player_name", "Player1", important: true); string name = data.GetString("player_name", defaultValue: "Guest"); // Serializable objects var progress = new PlayerProgress { level = 5, coins = 1000, unlockedItems = new[] { "sword", "shield" } }; data.SetObject("player_progress", progress, important: true); PlayerProgress loaded = data.GetObject("player_progress"); Debug.Log($"Level: {loaded?.level}, Coins: {loaded?.coins}"); // Utility methods if (data.HasKey("player_progress")) { Debug.Log("Progress data exists"); } data.DeleteKey("temp_data"); // Delete specific key // data.DeleteAll(); // Clear all data (use with caution) data.Save(); // Force save to persistent storage } } ``` -------------------------------- ### Control Audio and Time using Mirrasdk SDK5 (C#) Source: https://context7.com/mirrasdk/sdk5/llms.txt Shows how to manage global audio volume and pause state, as well as control the time scale and retrieve date/holiday information using the Mirrasdk SDK's audio and time modules. Dependencies include MirraGames.SDK, MirraGames.SDK.Common, System, and UnityEngine. ```csharp using MirraGames.SDK; using MirraGames.SDK.Common; using System; using UnityEngine; public class AudioTimeManager : MonoBehaviour { private IAudio audio; private ITime time; void Start() { // Access modules through SDK // audio = sdk.Audio; // time = sdk.Time; } public void HandleAudio() { // Volume control (0.0 to 1.0) audio.Volume = 0.5f; // Set to 50% float currentVolume = audio.Volume; // Pause audio globally audio.Pause = true; // Pause all audio audio.Pause = false; // Resume audio } public void HandleTime() { // Time scale control (affects Time.timeScale) time.Scale = 1.0f; // Normal speed time.Scale = 0.5f; // Slow motion time.Scale = 2.0f; // Fast forward time.Scale = 0.0f; // Pause game time // Get current date/time DateTime currentDate = time.CurrentDate; Debug.Log($"Current date: {currentDate}"); // Holiday detection for seasonal content HolidayType holiday = time.CurrentHoliday; Debug.Log($"Current holiday: {holiday}"); // Example: Enable seasonal content if (holiday != HolidayType.None) { EnableSeasonalDecorations(holiday); } } private void EnableSeasonalDecorations(HolidayType holiday) { } } ``` -------------------------------- ### Manage Player Account and Authentication in C# Source: https://context7.com/mirrasdk/sdk5/llms.txt This C# snippet demonstrates how to manage player accounts, check login status, access player profile information, and handle login/logout events using the Mirra SDK's Player module. It includes logic for prompting login and handling success or error callbacks. ```csharp using MirraGames.SDK; using MirraGames.SDK.Common; using UnityEngine; public class PlayerManager : MonoBehaviour { private IPlayer player; void Start() { // Access player module through SDK // player = sdk.Player; } public void HandlePlayerAccount() { // Check login state if (player.IsLoggedIn) { // Access player information Debug.Log($"Display Name: {player.DisplayName}"); Debug.Log($"First Name: {player.FirstName}"); Debug.Log($"Last Name: {player.LastName}"); Debug.Log($"Username: {player.Username}"); Debug.Log($"Unique ID: {player.UniqueId}"); } else { // Prompt login player.InvokeLogin( onLoginSuccess: () => { Debug.Log($"Welcome, {player.DisplayName}!"); LoadPlayerData(); }, onLoginError: () => { Debug.Log("Login failed or cancelled"); ContinueAsGuest(); } ); } } private void LoadPlayerData() { } private void ContinueAsGuest() { } } ``` -------------------------------- ### Load Assets using Mirrasdk SDK5 (C#) Source: https://context7.com/mirrasdk/sdk5/llms.txt Demonstrates how to load assets from Addressables, AssetBundles, and StreamingAssets using the Mirrasdk SDK's unified assets module. It covers asynchronous loading patterns, error handling, and resource release. Dependencies include MirraGames.SDK and UnityEngine. ```csharp using MirraGames.SDK; using MirraGames.SDK.Common; using UnityEngine; public class AssetManager : MonoBehaviour { private IAssets assets; void Start() { // Access assets module through SDK // assets = sdk.Assets; } public void LoadAddressables() { // Load addressable asset assets.LoadAddressable("prefab_enemy", onSuccess: (prefab) => { GameObject enemy = Instantiate(prefab); Debug.Log("Enemy prefab loaded and instantiated"); }, onError: () => { Debug.LogError("Failed to load enemy prefab"); } ); // Load addressable texture assets.LoadAddressable("texture_background", onSuccess: (texture) => { ApplyBackgroundTexture(texture); } ); // Release addressable when no longer needed assets.ReleaseAddressable("prefab_enemy"); } public void LoadAssetBundles() { string bundleUrl = "https://example.com/bundles/level1"; // Load asset bundle from URL assets.LoadBundle("level1_bundle", bundleUrl, onSuccess: (bundle) => { GameObject level = bundle.LoadAsset("Level1"); Instantiate(level); Debug.Log("Level 1 bundle loaded"); }, onError: () => { Debug.LogError("Failed to load level bundle"); } ); // Release bundle when done assets.ReleaseBundle("level1_bundle", unloadAllObjects: true); } public void LoadStreamingAssets() { // Load audio from StreamingAssets assets.LoadStreamingAudioClip("Audio/background_music.ogg", AudioType.OGGVORBIS, onSuccess: (clip) => { AudioSource source = GetComponent(); source.clip = clip; source.Play(); }, onError: () => Debug.LogError("Failed to load audio") ); // Load text file assets.LoadStreamingText("Config/settings.txt", onSuccess: (text) => { Debug.Log($"Settings: {text}"); } ); // Load texture assets.LoadStreamingTexture2D("Images/logo.png", onSuccess: (texture) => { ApplyTexture(texture); } ); // Load JSON with automatic deserialization assets.LoadStreamingJSON("Config/game_config.json", onSuccess: (config) => { ApplyGameConfig(config); } ); } private void ApplyBackgroundTexture(Texture2D tex) { } private void ApplyTexture(Texture2D tex) { } private void ApplyGameConfig(GameConfig config) { } } [System.Serializable] public class GameConfig { public int maxLives; public float difficultyMultiplier; } ``` -------------------------------- ### Utilize Event Systems with Mirra SDK (C#) Source: https://context7.com/mirrasdk/sdk5/llms.txt Shows how to integrate with Mirra SDK's event systems, including EventDispatcher for Unity lifecycle events and coroutine management, and EventAggregator for custom publish/subscribe messaging. It covers subscribing to and publishing custom events, managing coroutines, and handling Unity lifecycle callbacks. ```csharp using MirraGames.SDK; using MirraGames.SDK.Common; using System.Collections; using UnityEngine; public class EventManager : MonoBehaviour, IEventListener { private IEventDispatcher eventDispatcher; private IEventAggregator eventAggregator; void Start() { // Access event systems through SDK // eventDispatcher = sdk.EventDispatcher; // eventAggregator = sdk.EventAggregator; } public void SetupEventDispatcher() { // Subscribe to Unity lifecycle events eventDispatcher.Start += OnSDKStart; eventDispatcher.LateUpdate += OnLateUpdate; eventDispatcher.OnGUI += OnSDKGui; eventDispatcher.OnApplicationFocus += OnFocusChange; eventDispatcher.OnApplicationPause += OnPauseChange; eventDispatcher.OnDestroy += OnSDKDestroy; // Start coroutines through SDK Coroutine routine = eventDispatcher.StartCoroutine(LoadDataAsync()); // Stop specific coroutine eventDispatcher.StopCoroutine(routine); // Stop all coroutines eventDispatcher.StopAllCoroutines(); } public void SetupEventAggregator() { // Subscribe to custom events eventAggregator.Subscribe(this); // Publish custom events var pauseEvent = new PauseChangeEvent(isPaused: true); eventAggregator.Publish(this, pauseEvent); // Unsubscribe when done eventAggregator.Unsubscribe(this); // Dispose all subscriptions // eventAggregator.Dispose(); } // IEventListener implementation public void OnEvent(PauseChangeEvent eventData) { if (eventData.IsPaused) { Debug.Log("Game paused via event"); } else { Debug.Log("Game resumed via event"); } } private void OnSDKStart() { } private void OnLateUpdate() { } private void OnSDKGui() { } private void OnFocusChange(bool hasFocus) { } private void OnPauseChange(bool isPaused) { } private void OnSDKDestroy() { } private IEnumerator LoadDataAsync() { yield return new WaitForSeconds(1f); Debug.Log("Data loaded"); } } ``` -------------------------------- ### Manage In-App Purchases and Consumables with Payments API (C#) Source: https://context7.com/mirrasdk/sdk5/llms.txt This C# snippet illustrates how to manage in-app purchases using the Payments API. It covers retrieving product data, checking ownership, making purchases, restoring previous purchases, and handling consumable products. Dependencies include MirraGames.SDK and MirraGames.SDK.Common. ```csharp using MirraGames.SDK; using MirraGames.SDK.Common; using UnityEngine; public class PurchaseManager : MonoBehaviour { private IPayments payments; void Start() { // Access payments module through SDK // payments = sdk.Payments; } public void HandlePurchases() { string productTag = "premium_pack"; // Get product information ProductData product = payments.GetProductData(productTag); if (product != null) { Debug.Log($"Product: {product.Tag}"); Debug.Log($"Price: {product.GetFullPriceFloat()}"); // "9.99 USD" Debug.Log($"Integer price: {product.PriceInteger}"); Debug.Log($"Float price: {product.PriceFloat}"); Debug.Log($"Currency: {product.Currency}"); } // Check if already purchased (for non-consumables) if (payments.IsAlreadyPurchased(productTag)) { Debug.Log("Product already owned"); return; } // Make a purchase payments.Purchase(productTag, onSuccess: () => { Debug.Log("Purchase successful!"); UnlockPremiumContent(); }, onError: () => { Debug.Log("Purchase failed or cancelled"); } ); } public void RestorePurchases() { // Restore previous purchases (required for iOS) payments.RestorePurchases((restoreData) => { Debug.Log($"All purchases: {string.Join(", ", restoreData.AllPurchases)}"); Debug.Log($"Pending products: {string.Join(", ", restoreData.PendingProducts)}"); // Process each restored product foreach (string productTag in restoreData.AllPurchases) { restoreData.RestoreProduct(productTag, () => { Debug.Log($"Restored: {productTag}"); UnlockContent(productTag); }); } }); } public void HandleConsumables() { string productTag = "coin_pack_100"; // Get supply information string supplyId = payments.GetSupplyId(productTag); int currentCount = payments.GetSupplyCount(productTag); Debug.Log($"Supply ID: {supplyId}, Count: {currentCount}"); // Set supply count directly payments.SetSupplyCount(productTag, 50); // Supply product with callback payments.SupplyProduct(productTag, productSupply: () => { AddCoins(100); }, countProduct: true // Track supply count ); } private void UnlockPremiumContent() { } private void UnlockContent(string tag) { } private void AddCoins(int amount) { } } ``` -------------------------------- ### Identify Platform and Interact with Platform Features in C# Source: https://context7.com/mirrasdk/sdk5/llms.txt This C# code snippet illustrates how to identify the current platform and deployment type using the Mirra SDK's Platform module. It also shows how to trigger platform-specific interactions such as sharing the game or opening the app store rating dialog. ```csharp using MirraGames.SDK; using MirraGames.SDK.Common; using UnityEngine; public class PlatformManager : MonoBehaviour { private IPlatform platform; void Start() { // Access platform module through SDK // platform = sdk.Platform; } public void HandlePlatformInfo() { // Get current platform PlatformType currentPlatform = platform.Current; DeploymentType deployment = platform.Deployment; string appId = platform.AppId; Debug.Log($"Platform: {currentPlatform}"); Debug.Log($"Deployment: {deployment}"); Debug.Log($"App ID: {appId}"); } public void HandlePlatformInteractions() { // Share game (uses native share dialog) platform.ShareGame("Check out this awesome game!"); platform.ShareGame(); // Default message // Open app store rating dialog platform.RateGame(); } } ``` -------------------------------- ### Manage Feature Flags and Localization with Mirra SDK (C#) Source: https://context7.com/mirrasdk/sdk5/llms.txt Demonstrates how to access and utilize feature flags (boolean, integer, float, string) and language settings through the Mirra SDK. It covers retrieving flag values with default fallbacks and checking for flag existence, as well as accessing the current language for localization. ```csharp using MirraGames.SDK; using MirraGames.SDK.Common; using UnityEngine; public class ConfigManager : MonoBehaviour { private IFlags flags; private ILanguage language; void Start() { // Access modules through SDK // flags = sdk.Flags; // language = sdk.Language; } public void HandleFeatureFlags() { // Boolean flags for feature toggles bool newUIEnabled = flags.GetBool("enable_new_ui", defaultValue: false); bool darkModeAvailable = flags.GetBool("dark_mode_available", defaultValue: true); // Integer flags for numeric configuration int maxRetries = flags.GetInt("max_retries", defaultValue: 3); int dailyRewardAmount = flags.GetInt("daily_reward_coins", defaultValue: 100); // Float flags for fine-tuned values float difficultyMultiplier = flags.GetFloat("difficulty_mult", defaultValue: 1.0f); float adFrequency = flags.GetFloat("ad_frequency_minutes", defaultValue: 5.0f); // String flags for text/IDs string welcomeMessage = flags.GetString("welcome_message", defaultValue: "Welcome!"); string promoCode = flags.GetString("active_promo", defaultValue: ""); // Check if flag exists if (flags.HasKey("special_event_active")) { bool eventActive = flags.GetBool("special_event_active"); if (eventActive) { EnableSpecialEvent(); } } } public void HandleLanguage() { // Get current language LanguageType currentLanguage = language.Current; Debug.Log($"Current language: {currentLanguage}"); // Load appropriate localization resources LoadLocalization(currentLanguage); } private void EnableSpecialEvent() { } private void LoadLocalization(LanguageType lang) { } } ``` -------------------------------- ### Read Game Preferences with Preferences API (C#) Source: https://context7.com/mirrasdk/sdk5/llms.txt The Preferences API provides read-only access to configuration groups defined in project resources, facilitating game settings and default values. It allows reading boolean, integer, float, and string values with specified default fallbacks. ```csharp using MirraGames.SDK; using MirraGames.SDK.Common; using UnityEngine; public class PreferencesManager : MonoBehaviour { private PreferencesReader preferences; void Start() { // Access preferences through SDK // preferences = sdk.Preferences; } public void ReadPreferences() { // Get a preference group IPreferencesGroup gameSettings = preferences.GetPreferenceGroup("game_settings"); // Read values from group bool soundEnabled = gameSettings.GetBool("sound_enabled", defaultValue: true); int startingLives = gameSettings.GetInt("starting_lives", defaultValue: 3); float musicVolume = gameSettings.GetFloat("music_volume", defaultValue: 0.8f); string defaultLanguage = gameSettings.GetString("default_language", defaultValue: "en"); Debug.Log($"Sound: {soundEnabled}, Lives: {startingLives}"); Debug.Log($"Volume: {musicVolume}, Language: {defaultLanguage}"); // Get default value groups (for fallbacks) IPreferencesGroup defaults = preferences.GetDefaultValueGroup("level_defaults"); int defaultDifficulty = defaults.GetInt("difficulty", defaultValue: 1); } } ``` -------------------------------- ### Manage Achievements and Leaderboards with C# Achievements API Source: https://context7.com/mirrasdk/sdk5/llms.txt Explains how to implement achievements, manage leaderboards, and track player scores using the Achievements module. Includes functions for unlocking achievements, submitting scores, retrieving player scores, and fetching full leaderboard data. ```csharp using Mirra.SDK; using Mirra.SDK.Common; using UnityEngine; public class AchievementManager : MonoBehaviour { private IAchievements achievements; void Start() { // Access achievements module through SDK // achievements = sdk.Achievements; } public void HandleAchievements() { // Trigger platform-specific celebration effect achievements.HappyTime(); // Unlock a specific achievement achievements.Unlock("first_victory"); achievements.Unlock("complete_tutorial"); achievements.Unlock("reach_level_10"); } public void HandleLeaderboard() { string boardId = "global_highscore"; // Submit a score to leaderboard achievements.SetScore(boardId, 25000); // Get current player's score achievements.GetScore(boardId, (score) => { Debug.Log($"Your score: {score}"); }); // Get full leaderboard data achievements.GetLeaderboard(boardId, (leaderboard) => { foreach (PlayerScore player in leaderboard.players) { Debug.Log($"#{player.position} {player.displayName}: {player.score}"); // player.profilePictureUrl available for avatar display } }); } } ``` -------------------------------- ### Access Device Information and Control Cursor in C# Source: https://context7.com/mirrasdk/sdk5/llms.txt This C# code snippet shows how to retrieve device-specific information such as platform type and system type using the Mirra SDK's Device module. It also demonstrates controlling cursor visibility and lock states for different gameplay scenarios. ```csharp using MirraGames.SDK; using MirraGames.SDK.Common; using UnityEngine; public class DeviceManager : MonoBehaviour { private IDevice device; void Start() { // Access device module through SDK // device = sdk.Device; } public void HandleDeviceInfo() { // Platform detection bool isMobile = device.IsMobile; SystemType system = device.SystemType; Debug.Log($"Is Mobile: {isMobile}"); Debug.Log($"System Type: {system}"); // Adapt UI based on platform if (isMobile) { EnableTouchControls(); } else { EnableKeyboardControls(); } } public void HandleCursor() { // Cursor visibility control device.CursorVisible = false; // Hide cursor during gameplay device.CursorVisible = true; // Show cursor in menus // Cursor lock state device.CursorLock = CursorLockMode.Locked; // Lock to center (FPS games) device.CursorLock = CursorLockMode.Confined; // Keep within window device.CursorLock = CursorLockMode.None; // Free cursor } public void HandleBrowser() { // Open external URLs (web platform support) device.OpenUrl("https://example.com/store"); device.OpenUrl("https://example.com/privacy-policy"); } private void EnableTouchControls() { } private void EnableKeyboardControls() { } } ``` -------------------------------- ### Track Game Events and Sessions with Analytics API (C#) Source: https://context7.com/mirrasdk/sdk5/llms.txt This C# snippet demonstrates how to use the Analytics API to track various game events, including simple events, events with single values, events with multiple parameters, and gameplay session reporting. It requires the MirraGames.SDK and MirraGames.SDK.Common namespaces. ```csharp using MirraGames.SDK; using MirraGames.SDK.Common; using System.Collections.Generic; using UnityEngine; public class AnalyticsManager : MonoBehaviour { private IAnalytics analytics; void Start() { // Access analytics module through SDK // analytics = sdk.Analytics; } public void TrackGameEvents() { // Simple event tracking analytics.Report("button_clicked"); analytics.Report("menu_opened"); // Event with single value analytics.Report("level_selected", "level_5"); analytics.Report("item_purchased", "golden_sword"); // Event with multiple parameters var purchaseParams = new Dictionary { { "item_id", "sword_001" }, { "item_name", "Golden Sword" }, { "price", 500 }, { "currency", "coins" }, { "player_level", 10 } }; analytics.Report("in_game_purchase", purchaseParams); var levelParams = new Dictionary { { "level", 5 }, { "time_spent", 120.5f }, { "enemies_defeated", 25 }, { "coins_collected", 150 } }; analytics.Report("level_complete", levelParams); } public void TrackGameplaySession() { // Call when game is fully loaded and ready analytics.GameIsReady(); // Track gameplay sessions analytics.GameplayStart(level: 1); // Player starts playing analytics.GameplayRestart(level: 1); // Player restarts level analytics.GameplayStop(level: 1); // Player stops/exits level } } ``` -------------------------------- ### Data Persistence API Source: https://context7.com/mirrasdk/sdk5/llms.txt The data module provides persistent storage for game data with support for primitive types and serializable objects. Data can be marked as important for immediate synchronization. ```APIDOC ## Data Persistence API ### Description Provides persistent storage for game data, supporting primitive types and serializable objects. Data can be marked for immediate synchronization. ### Methods - `SetBool(key, value, important)`: Sets a boolean value. - `GetBool(key, defaultValue)`: Retrieves a boolean value. - `SetInt(key, value, important)`: Sets an integer value. - `GetInt(key, defaultValue)`: Retrieves an integer value. - `SetFloat(key, value, important)`: Sets a float value. - `GetFloat(key, defaultValue)`: Retrieves a float value. - `SetString(key, value, important)`: Sets a string value. - `GetString(key, defaultValue)`: Retrieves a string value. - `SetObject(key, obj, important)`: Sets a serializable object. - `GetObject(key)`: Retrieves a serializable object. - `HasKey(key)`: Checks if a key exists. - `DeleteKey(key)`: Deletes a specific key. - `DeleteAll()`: Deletes all data. - `Save()`: Forces saving to persistent storage. ### Parameters #### Common Parameters - **key** (string) - Required - The unique identifier for the data. - **important** (boolean) - Optional - Marks data for immediate synchronization. - **defaultValue** (type) - Optional - The value to return if the key is not found. #### Request Body (for SetObject) - **obj** (object) - Required - The serializable object to store. ### Response #### Success Response (200) - **value** (type) - The retrieved data value. ### Request Example ```csharp // Setting and getting boolean data data.SetBool("tutorial_complete", true, important: true); bool tutorialDone = data.GetBool("tutorial_complete", defaultValue: false); // Setting and getting serializable object var progress = new PlayerProgress { level = 5, coins = 1000 }; data.SetObject("player_progress", progress, important: true); PlayerProgress loaded = data.GetObject("player_progress"); ``` ### Response Example ```json { "tutorial_complete": true, "player_progress": { "level": 5, "coins": 1000, "unlockedItems": ["sword", "shield"] } } ``` ``` -------------------------------- ### Manage Game Pauses with Pause API (C#) Source: https://context7.com/mirrasdk/sdk5/llms.txt The Pause Management API allows multiple sources to register their pause states, ensuring coordinated game pausing across different systems. The game is paused if any source registers 'true', and resumes only when all sources register 'false'. ```csharp using MirraGames.SDK; using MirraGames.SDK.Common; using UnityEngine; public class PauseManager : MonoBehaviour { private IPause pause; void Start() { // Access pause module through SDK // pause = sdk.Pause; } public void HandlePause() { // Register pause from different sources // Game is paused if ANY source registers true // UI menu requests pause pause.Register(this, value: true); // Ad system requests pause pause.Register("AdSystem", value: true); // Resume from this source pause.Register(this, value: false); // Game remains paused until ALL sources register false pause.Register("AdSystem", value: false); } } ``` -------------------------------- ### Achievements and Leaderboards API Source: https://context7.com/mirrasdk/sdk5/llms.txt The achievements module enables game achievements, leaderboard management, and player score tracking with support for retrieving and displaying rankings. ```APIDOC ## Achievements and Leaderboards API ### Description Enables game achievements, leaderboard management, and player score tracking with support for retrieving and displaying rankings. ### Methods - `HappyTime()`: Triggers a platform-specific celebration effect. - `Unlock(achievementId)`: Unlocks a specific achievement. - `SetScore(leaderboardId, score)`: Submits a score to a leaderboard. - `GetScore(leaderboardId, callback)`: Retrieves the current player's score for a leaderboard. - `GetLeaderboard(leaderboardId, callback)`: Retrieves the full leaderboard data. ### Parameters #### Common Parameters - **achievementId** (string) - Required - The unique identifier for the achievement. - **leaderboardId** (string) - Required - The unique identifier for the leaderboard. - **score** (number) - Required - The score to submit. - **callback** (function) - Required - A function to handle the retrieved data. ### Request Example ```csharp // Unlocking achievements achievements.Unlock("first_victory"); // Submitting and retrieving scores achievements.SetScore("global_highscore", 25000); achievements.GetScore("global_highscore", (score) => { Debug.Log($"Your score: {score}"); }); // Retrieving leaderboard achievements.GetLeaderboard("global_highscore", (leaderboard) => { ... }); ``` ### Response #### Success Response (200) - **leaderboard** (object) - Contains player scores and rankings. - **players** (array) - List of player scores. - **position** (number) - Player's rank. - **displayName** (string) - Player's name. - **score** (number) - Player's score. - **profilePictureUrl** (string) - URL for the player's avatar (if available). #### Response Example ```json { "players": [ { "position": 1, "displayName": "Player1", "score": 30000, "profilePictureUrl": "http://example.com/avatar1.png" }, { "position": 2, "displayName": "Player2", "score": 25000, "profilePictureUrl": null } ] } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.