Unexpected error: Wrong formatted data from BGA gameserver 1

Game development with Board Game Arena Studio
Post Reply
stylix
Posts: 12
Joined: 16 March 2014, 15:33

Unexpected error: Wrong formatted data from BGA gameserver 1

Post 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.
User avatar
RicardoRix
Posts: 2548
Joined: 29 April 2012, 23:43

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

Post by RicardoRix »

the last thing you changed.

try this:
https://phpcodechecker.com/
User avatar
DrKarotte
Posts: 279
Joined: 22 September 2015, 23:42

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

Post 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:_...
stylix
Posts: 12
Joined: 16 March 2014, 15:33

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

Post 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.
User avatar
RicardoRix
Posts: 2548
Joined: 29 April 2012, 23:43

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

Post 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?
User avatar
DrKarotte
Posts: 279
Joined: 22 September 2015, 23:42

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

Post by DrKarotte »

A var_dump may cause messages like this.
stylix
Posts: 12
Joined: 16 March 2014, 15:33

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

Post 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...
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

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

Post 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.
stylix
Posts: 12
Joined: 16 March 2014, 15:33

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

Post 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.
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

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

Post 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.
Post Reply

Return to “Developers”