Page 2 of 3
Re: Difference Studio and Private Alpha
Posted: 27 June 2021, 17:25
by Een
Checking the player table, the user ids are:
88784109 Badguizmo
84905642 Icesun
So I'm not sure how you get your $movedCardOwner, but 8882996 is not the ID of a player in the game, so you cannot find it. There is probably an issue getting $movedCardOwner
About getting a look at the database, you should be able to, by creating a bug on the table, then retrieving the database in the studio:
https://en.doc.boardgamearena.com/Pract ... bug_report
Re: Difference Studio and Private Alpha
Posted: 27 June 2021, 18:03
by Badguizmo
Een wrote: ↑27 June 2021, 17:25
Checking the player table, the user ids are:
88784109 Badguizmo
84905642 Icesun
So I'm not sure how you get your $movedCardOwner, but 8882996 is not the ID of a player in the game, so you cannot find it. There is probably an issue getting $movedCardOwner
About getting a look at the database, you should be able to, by creating a bug on the table, then retrieving the database in the studio:
https://en.doc.boardgamearena.com/Pract ... bug_report
AH !!!!!!!!!!!!!!!!!!!!!!!!!!!
Spotted the error.
I am using the substring function to get the player number :
Code: Select all
$movedCardOwner = substr($this->playerscards->getCard($cardMoved)['location'],0,7);
It was working Ok in the studio because the player ids are on 7 digits, the player ids are on 8 (or more maybe) digits in normal GBA.
I will modify my code and then update the post
Thank you ^^
NB : feel so stupid
EDIT : 8882996 are the 7 firsts numbers of another player I am testing

Re: Difference Studio and Private Alpha
Posted: 27 June 2021, 18:09
by Badguizmo
Hello again.
The php error disappeared.
I will rework the code to retreive the player id in a different way and then solve this topic

Re: Difference Studio and Private Alpha
Posted: 27 June 2021, 18:11
by Een
Good that it's cleared up

Re: Difference Studio and Private Alpha
Posted: 27 June 2021, 18:44
by robinzig
Well worked out. You probably want to change it to use a simple regular expression to get the number from the start of the string, you definitely shouldn't rely on the player ID always holding a particular number of digits. At least you found out before the game went to full production

Re: Difference Studio and Private Alpha
Posted: 27 June 2021, 18:45
by Badguizmo
Een wrote: ↑27 June 2021, 18:11
Good that it's cleared up
Last question : are all the players ID always the same numbers of digits (7 in studio and 8 on BGA for the moment) ? Even in the case of growing player number on BGA ?
(maybe the question is stupid due to the way I coded the game ...)
Re: Difference Studio and Private Alpha
Posted: 27 June 2021, 19:21
by Een
Badguizmo wrote: ↑27 June 2021, 18:45
Een wrote: ↑27 June 2021, 18:11
Good that it's cleared up
Last question : are all the players ID always the same numbers of digits (7 in studio and 8 on BGA for the moment) ? Even in the case of growing player number on BGA ?
(maybe the question is stupid due to the way I coded the game ...)
No, they are not fixed width (and yes, the number is growing

). If you are mixing players numbers with a label for the location and need to retrieve the player number from the location, you can for example rely on a separator such as hand_<player_id>. In general, it would be better to have "hand" in location and <player_id> in location_arg in order not to have to manipulate strings, but in some cases, it may be needed.
Re: Difference Studio and Private Alpha
Posted: 27 June 2021, 22:31
by tchobello
Een wrote: ↑27 June 2021, 17:25
Checking the player table, the user ids are:
88784109 Badguizmo
84905642 Icesun
So I'm not sure how you get your $movedCardOwner, but 8882996 is not the ID of a player in the game, so you cannot find it. There is probably an issue getting $movedCardOwner
About getting a look at the database, you should be able to, by creating a bug on the table, then retrieving the database in the studio:
https://en.doc.boardgamearena.com/Pract ... bug_report
it's broken
Re: Difference Studio and Private Alpha
Posted: 28 June 2021, 21:21
by Badguizmo
Thank you all !!
Apparently both bugs are solved with a small regular expression

Re: Difference Studio and Private Alpha
Posted: 29 June 2021, 09:48
by Een
tchobello wrote: ↑27 June 2021, 22:31
Een wrote: ↑27 June 2021, 17:25
Checking the player table, the user ids are:
88784109 Badguizmo
84905642 Icesun
So I'm not sure how you get your $movedCardOwner, but 8882996 is not the ID of a player in the game, so you cannot find it. There is probably an issue getting $movedCardOwner
About getting a look at the database, you should be able to, by creating a bug on the table, then retrieving the database in the studio:
https://en.doc.boardgamearena.com/Pract ... bug_report
it's broken
Oh? ok, I'll look into it.