Reversi Code Exception

Game development with Board Game Arena Studio
Post Reply
User avatar
gameczar
Posts: 18
Joined: 27 November 2022, 20:47

Reversi Code Exception

Post 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?
User avatar
Tisaac
Posts: 2736
Joined: 26 August 2014, 21:28

Re: Reversi Code Exception

Post by Tisaac »

PHP8 enforces the argument order of the implode function. Just swap the two.
User avatar
gameczar
Posts: 18
Joined: 27 November 2022, 20:47

Re: Reversi Code Exception

Post by gameczar »

Thanks, that did the trick.
User avatar
thoun
Posts: 1618
Joined: 10 December 2020, 22:25

Re: Reversi Code Exception

Post 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.
User avatar
tchobello
Posts: 693
Joined: 18 March 2012, 13:19

Re: Reversi Code Exception

Post 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.
User avatar
gameczar
Posts: 18
Joined: 27 November 2022, 20:47

Re: Reversi Code Exception

Post 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?
User avatar
thoun
Posts: 1618
Joined: 10 December 2020, 22:25

Re: Reversi Code Exception

Post by thoun »

I updated the reversi code a few weeks ago, so it might be outdated if you copied it before.
User avatar
gameczar
Posts: 18
Joined: 27 November 2022, 20:47

Re: Reversi Code Exception

Post 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?
User avatar
thoun
Posts: 1618
Joined: 10 December 2020, 22:25

Re: Reversi Code Exception

Post 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 :)
Post Reply

Return to “Developers”