public override void RequestUserData() { pData.Wallet = pData.InitWallet(); pData.Inventory = pData.InitInventory(); Spil.PlayerData = new PlayerDataHelper(this); pData.SetInitalWalletValues(); pData.SetInitalInventoryValues(); SpilEvent spilEvent = Spil.MonoInstance.gameObject.AddComponent <SpilEvent>(); spilEvent.eventName = "requestUserData"; JSONObject playerDataJSON = new JSONObject(); JSONObject walletJSON = new JSONObject(); walletJSON.AddField("offset", pData.Wallet.offset); playerDataJSON.AddField("wallet", walletJSON); JSONObject inventoryJSON = new JSONObject(); inventoryJSON.AddField("offset", pData.Inventory.offset); playerDataJSON.AddField("inventory", inventoryJSON); spilEvent.customData.AddField("playerData", playerDataJSON); JSONObject gameStateJSON = new JSONObject(); JSONObject gameStateArray = new JSONObject(JSONObject.Type.ARRAY); gameStateArray.Add("private"); if (Response.provider != null & Response.externalId != null) { gameStateArray.Add("public"); } gameStateJSON.AddField("access", gameStateArray); spilEvent.customData.AddField("gameState", gameStateJSON); spilEvent.customData.AddField("deviceVersions", UserDataManager.GenerateUserDataVersionsJSON(UserDataManager.userDataVersions)); spilEvent.Send(); }