Page 1 of 1

Reversi Code Exception

Posted: 20 June 2024, 20:07
by gameczar
I found that the Reversi tutorial no longer matches the Reversi code in BGA. So I downloaded the code from BGA and changed all the references from reversi to reversijbm and put it into my project. But when I try to express start a table, I get the following exception.

Code: Select all

ly_metasite.js:1 Unexpected error:  Wrong formatted data from gameserver 2 (method: createGame): JSON_ERROR_SYNTAX <br />
<b>Fatal error</b>:  Uncaught TypeError: implode(): Argument #2 ($array) must be of type ?array, string given in /var/tournoi/release/games/reversijbm/999999-9999/reversijbm.game.php:52
Stack trace:
#0 /var/tournoi/release/games/reversijbm/999999-9999/reversijbm.game.php(52): implode(Array, '...')
Can anyone point me in the direction of what might be wrong?

Re: Reversi Code Exception

Posted: 20 June 2024, 20:31
by Tisaac
PHP8 enforces the argument order of the implode function. Just swap the two.

Re: Reversi Code Exception

Posted: 20 June 2024, 23:13
by gameczar
Thanks, that did the trick.

Re: Reversi Code Exception

Posted: 21 June 2024, 08:06
by thoun
gameczar wrote: 20 June 2024, 20:07 I found that the Reversi tutorial no longer matches the Reversi code in BGA. So I downloaded the code from BGA and changed all the references from reversi to reversijbm and put it into my project.
Where did you find badly written implode (so it can be fixed)? The source code of the game is compatible, and the doc seems correct too.

Re: Reversi Code Exception

Posted: 21 June 2024, 11:26
by tchobello
thoun wrote: 21 June 2024, 08:06
gameczar wrote: 20 June 2024, 20:07 I found that the Reversi tutorial no longer matches the Reversi code in BGA. So I downloaded the code from BGA and changed all the references from reversi to reversijbm and put it into my project.
Where did you find badly written implode (so it can be fixed)? The source code of the game is compatible, and the doc seems correct too.
Reversi code looks Ok but Gomoku is not.

Re: Reversi Code Exception

Posted: 22 June 2024, 03:39
by gameczar
thoun wrote: 21 June 2024, 08:06
gameczar wrote: 20 June 2024, 20:07 I found that the Reversi tutorial no longer matches the Reversi code in BGA. So I downloaded the code from BGA and changed all the references from reversi to reversijbm and put it into my project.
Where did you find badly written implode (so it can be fixed)? The source code of the game is compatible, and the doc seems correct too.
It's the code in my SFTP, in the "reversi" folder. The file is "reversi.game.php" and the issue is on lines 52 and 72. This code is up to date with BGA server side. I have a "hearts" and "reversi" folders, they are read-only and cannot be updated. If I checked these out as "read-only", is it possible that these "personal" copies are out of sync with the "real" code versions?

Re: Reversi Code Exception

Posted: 22 June 2024, 10:17
by thoun
I updated the reversi code a few weeks ago, so it might be outdated if you copied it before.

Re: Reversi Code Exception

Posted: 02 July 2024, 21:57
by gameczar
thoun wrote: 22 June 2024, 10:17 I updated the reversi code a few weeks ago, so it might be outdated if you copied it before.
How do I pull updated code for a read-only local version?

Re: Reversi Code Exception

Posted: 02 July 2024, 22:15
by thoun
gameczar wrote: 02 July 2024, 21:57
thoun wrote: 22 June 2024, 10:17 I updated the reversi code a few weeks ago, so it might be outdated if you copied it before.
How do I pull updated code for a read-only local version?
You just come back to your FTP folder and copy it again to your computer :)