Page 1 of 1

Unexpected error: Wrong formatted data from BGA gameserver 1

Posted: 24 November 2019, 21:18
by stylix
When trying to quick start, I met error message.
Unexpected error: Wrong formatted data from BGA gameserver 1 (method: createGame): {"status":1,"data":true}
What does it mean?
I didn't change setupNewGame function
It doesn't give any clue.

Re: Unexpected error: Wrong formatted data from BGA gameserver 1

Posted: 24 November 2019, 22:04
by RicardoRix
the last thing you changed.

try this:
https://phpcodechecker.com/

Re: Unexpected error: Wrong formatted data from BGA gameserver 1

Posted: 24 November 2019, 22:48
by DrKarotte
Really no hint? Usually this is a PHP type error, see this helpful documantation of some messages

http://en.doc.boardgamearena.com/Troubl ... me.29:_...

Re: Unexpected error: Wrong formatted data from BGA gameserver 1

Posted: 25 November 2019, 03:13
by stylix
I don't mean my code is perfect.
I just want to know which part of my code change cause that error.
That message doesn't give any useful information like line number, erroneous object name...
Actually I change many codes in "playing state" in my turn with continuously refreshing page.
In that page, there is no error while refreshing page. Meanwhile I barely change setup code and DB structure.
After that, when I try to create new game table, I suddenly met that error.

Re: Unexpected error: Wrong formatted data from BGA gameserver 1

Posted: 25 November 2019, 09:03
by RicardoRix
Concentrate on those last changes, DB structure. comment out those last changes in setup. try var_dump??
1 wrong character is sometime enough. Did it pass the checker?

Re: Unexpected error: Wrong formatted data from BGA gameserver 1

Posted: 25 November 2019, 21:18
by DrKarotte
A var_dump may cause messages like this.

Re: Unexpected error: Wrong formatted data from BGA gameserver 1

Posted: 28 November 2019, 09:19
by stylix
There are no issues found with phpcodechecker.com
For debugging, Is there any information about php function call order when creating a new table?
Which are "setup" functions?
I didn't chagne code setupNewGame function in xxx.game.php. I didn't change DB structure much, I just add one simple table for logging.
At least, I wanna know just a file name or function name that cause this error...

Re: Unexpected error: Wrong formatted data from BGA gameserver 1

Posted: 28 November 2019, 12:05
by Een
Hello, I checked this and there was a non printable character <feff> character in the response.
You used "echo" which is a function writing directly to the response so it messed it up. I commented it out and now it's fine again. If you want to trace some info you should write it to the log, not to the http response.

Re: Unexpected error: Wrong formatted data from BGA gameserver 1

Posted: 28 November 2019, 20:11
by stylix
Hello, Een
My latest commit version do not has 'echo' statement, however, I met that error.
Yesterday, I was testing for all commits. At some commit version that has 'echo' statement, I stopped testing.
You probably saw my old commit version.
Anyway, error message has gone even with latest commit version.
Thank you.

Re: Unexpected error: Wrong formatted data from BGA gameserver 1

Posted: 29 November 2019, 00:41
by Een
It's not the commited version that is executed. Committing is just for saving the state of your work in the source version control.
The code executed is the one in your SFTP folder at the moment you are testing the game. I commented out the echo in that version, then it was fine.