$this->userPreferences->get() failing

Game development with Board Game Arena Studio
Post Reply
User avatar
crableybradtree
Posts: 13
Joined: 29 December 2023, 02:05

$this->userPreferences->get() failing

Post by crableybradtree »

I am calling $this->userPreferences->get() in my first game state after manager gameSetup on the PHP side. Intermittently it is not retrieving a value and only returns the empty string.

Do I need to wait on the PHP side for something to happen beyond transitioning to the first game state for userPreferences to be reliably available?
User avatar
Victoria_La
Posts: 665
Joined: 28 December 2015, 20:55

Re: $this->userPreferences->get() failing

Post by Victoria_La »

How are you calling it? This works
$pref = (int) $this->userPreferences->get($player_id, $code);
User avatar
crableybradtree
Posts: 13
Joined: 29 December 2023, 02:05

Re: $this->userPreferences->get() failing

Post by crableybradtree »

I did not have the cast to integer before the call. I will give that a try. Thanks. :-)
Post Reply

Return to “Developers”