Game authorization
Feature description
Section titled “Feature description”Game authorization verifies whether the current player legitimately owns the game on IGP. Integrate it early in the startup flow so failed results are handled before the player enters core gameplay.
Supported engines
Section titled “Supported engines”| Engine | Status | Notes |
|---|---|---|
| Unity | Preview | IGPRuntimeManager automatically integrates the desktop client authorization flow. |
| GameMaker | Preview | Authorization is completed through the Windows runtime and the local desktop client. |
| Godot | No standalone entry yet | Godot currently focuses on launch tickets, rooms, and achievements. No standalone game authorization API is provided yet. |
Prerequisites
Section titled “Prerequisites”- Startup and connection is complete.
- The IGP-assigned
appIdis configured. - The local IGP desktop client is available.
- For a production game validation, backend authorization configuration must match the current
appId.
By engine
Section titled “By engine”Unity projects usually only need to configure appId; the runtime handles the authorization flow. Business code mainly listens to state changes.
using UnityEngine;using IGP.UnitySDK;
public sealed class IGPAuthorizationView : MonoBehaviour{ [SerializeField] private IGPRuntimeManager runtimeManager;
private void OnEnable() { runtimeManager.onAuthorizationStateChanged.AddListener(OnAuthorizationChanged); runtimeManager.onAuthorizationFailed.AddListener(OnAuthorizationFailed); }
private void OnDisable() { runtimeManager.onAuthorizationStateChanged.RemoveListener(OnAuthorizationChanged); runtimeManager.onAuthorizationFailed.RemoveListener(OnAuthorizationFailed); }
private void OnAuthorizationChanged(IGPAuthorizationState state) { Debug.Log($"IGP authorization: {state}");
if (runtimeManager.IsAuthorized) { // Allow entering the main menu or continuing the game. } }
private void OnAuthorizationFailed(string message) { Debug.LogError($"IGP authorization failed: {message}"); }}For minimal validation, run Unity Quick Start first.
GameMaker needs to initialize the runtime first, then update every frame and read authorization state.
// Createglobal.igp_app_id = YOUR_APP_ID;igp_init(global.igp_app_id, { desktop_auto_attach: true});// Stepigp_update();
var state = igp_get_authorization_state();if (state == "authorized_online" || state == "authorized_offline"){ // Allow entering the game.}
var evt = igp_poll_event();while (!is_undefined(evt)){ if (evt.type == "authorization_state_changed") { show_debug_message("IGP authorization: " + string(evt.state)); }
evt = igp_poll_event();}For the complete integration order, see GameMaker Quick Start.
Godot currently has no standalone game authorization entry point. The development version can read launch tickets from the command line and enter the multiplayer flow, but it should not be treated as a formal game authorization API.
Self-test
Section titled “Self-test”| Engine | Checkpoint |
|---|---|
| Unity | AuthorizedOnline or AuthorizedOffline is observed, and failure reasons are visible when authorization fails. |
| GameMaker | igp_get_authorization_state() moves from pending to authorized_online, authorized_offline, or failed. |
| Godot | Standalone game authorization is not validated currently. |
Troubleshooting
Section titled “Troubleshooting”- Authorization remains
pending: confirm the desktop client connection succeeded. - Authorization fails while connection is normal: check whether
appIdmatches backend configuration. - Desktop capability testing fails in Unity Editor: configure Editor debugging by following Unity debugging.
- GameMaker has no events: confirm
igp_update()is called every frame andigp_poll_event()is continuously polled.