Sudden syntax errors just appearing to game when I did not make any changes

Game development with Board Game Arena Studio
Post Reply
User avatar
developgame
Posts: 107
Joined: 15 June 2020, 20:56

Sudden syntax errors just appearing to game when I did not make any changes

Post by developgame »

My game in beta that I have not touch for over a month, is suddenly getting syntax errors for processes that were syntax error and bug free before.
Are there changes being made to the BGA framework that I need to know about?
Should I be trying to fix the errors or wait this out.
Can someone please advice me on how best to proceed?

Thank you for any help and advice you can give me.
User avatar
thoun
Posts: 1619
Joined: 10 December 2020, 22:25

Re: Sudden syntax errors just appearing to game when I did not make any changes

Post by thoun »

Can you give more details, like the project name and the exact error message?
User avatar
abcde
Posts: 28
Joined: 24 January 2014, 18:30

Re: Sudden syntax errors just appearing to game when I did not make any changes

Post by abcde »

Thank you for your reply Thuon,
My game is The BloodyInn
It seems, BGA action.php processes no longer handles single word or short information sent to the server. All my Action.php processes are identical except for the method it calls in game.php. When shorter information is sent, I now get errors - Everything worked fine before.

Here are the action.php methods that are used in my example

Code: Select all

public function admitGuest() 	{
		self::setAjaxMode();
        $info = self::getArg("id", AT_alphanum, true);
        $this->game->admitGuest( $info );
        self::ajaxResponse();
	}
	public function playerAction() 	{
		self::setAjaxMode();
        $info = self::getArg("id", AT_alphanum_dash, true);
        $this->game->playerAction( $info );
        self::ajaxResponse();
	}
	public function getAccomplices() 	{
		self::setAjaxMode();
        $info = self::getArg("id", AT_alphanum, true);
        $this->game->getAccomplices( $info );
        self::ajaxResponse();
	}
    public function unDos() 	{
		self::setAjaxMode();
        $info = self::getArg("id", AT_alphanum, true);
        $this->game->unDos( $info );
        self::ajaxResponse();
	}
	public function confirmSelection()
	{
		self::setAjaxMode();
        $info = self::getArg("id", AT_alphanum, true);
        $this->game->confirmSelection( $info );
        self::ajaxResponse();
	}
All information sent to action.php uses the same javascript method/b]

Code: Select all

sendInfo ( method : string) {
console.log( "in SendInfo this.info_sent is %s method is %s", this.info_sent, method)
		if ( this.info_sent ) {
			( this as any ).bgaPerformAction( method, {
				id : this.info_sent 
			});
		}			
	}
From Chrome -console, you can see that all works well for the longer information sent - this is "this.info_sent" . "method"is the action.php method used.
yourgamename constructor
bloodyinn.js:65 yourgamename constructor
bloodyinn.js:1289 in SendInfo this.info_sent is 00 00 00 method is admitGuest
bloodyinn.js:1289 in SendInfo this.info_sent is bribed_2 peasant 2323321 method is playerAction
bloodyinn.js:1289 in SendInfo this.info_sent is killed 5 2323321 method is playerAction
bloodyinn.js:1289 in SendInfo this.info_sent is accomplice 2323321 0 53 66 18 method is getAccomplices
bloodyinn.js:1289 in SendInfo this.info_sent is 00 00 00 method is admitGuest
bloodyinn.js:1289 in SendInfo this.info_sent is bribed_2 peasant 2323321 method is playerAction
bloodyinn.js:1289 in SendInfo this.info_sent is burried 5 2323321 method is playerAction

but for shorter "id"s I get errors
bloodyinn.js:1289 in SendInfo this.info_sent is SO method is unDos
installHook.js:1 Server syntax error: bloodyinn/bloodyinn/unDos.html SyntaxError: Unexpected token '<' / <br />
<b>Fatal error</b>: Uncaught TypeError: preg_match(): Argument #2 ($subject) must be of type string, array given in /var/tournoi/release/tournoi-251212-1111-gs/www/include/APP_Action.inc.php:178
Stack trace:
#0 /var/tournoi/release/tournoi-251212-1111-gs/www/include/APP_Action.inc.php(178): preg_match('...', Array)
#1 /var/tournoi/release/games/bloodyinn/999999-9999/bloodyinn.action.php(64): APP_Action-&gt;getArg('...', 7, true)
#2 /var/tournoi/release/tournoi-251212-1111-gs/www/Bga/GameFramework/GameAction.php(126): action_bloodyinn-&gt;unDos()
#3 /var/tournoi/release/tournoi-251212-1111-gs/www/Bga/GameFramework/GamePageAction.php(346): Bga\GameFramework\GameAction-&gt;performServerAction('...')
#4 /var/tournoi/release/tournoi-251212-1111-gs/www/include/webActionCore.inc.php(175): Bga\GameFramework\GamePageAction-&gt;performServerAction('...')
#5 /var/tournoi/release/tournoi-251212-1111-gs/www/index.php(250): launchWebAction('...', '...', '...', false, false, NULL, true, false)
#6 {main}
thrown in <b>/var/tournoi/release/tournoi-251212-1111-gs/www/include/APP_Action.inc.php</b> on line <b>178</b><br />

overrideMethod @ installHook.js:1
p @ ly_studio.js:1
(anonymous) @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
require.cache.dojo/_base/Deferred.e.Deferred.reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
require.cache.dojo/_base/Deferred.e.Deferred.reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
(anonymous) @ dojo.js:1
(anonymous) @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
i @ dojo.js:1
XMLHttpRequest.send
h @ dojo.js:1
(anonymous) @ dojo.js:1
(anonymous) @ dojo.js:1
ajaxcall @ ly_studio.js:1
(anonymous) @ ly_studio.js:1
bgaPerformAction @ ly_studio.js:1
bloodyinn.sendInfo @ bloodyinn.js:1291
bloodyinn.sendInfoUndo @ bloodyinn.js:1298
bloodyinn.onStartOver @ bloodyinn.js:1849
(anonymous) @ bloodyinn?table=815391:2916
(anonymous) @ dojo.js:1Understand this error
installHook.js:1 SyntaxError: Unexpected token '<'
at Object.fromJson (dojo.js:1:63709)
at Object.json (dojo.js:1:84156)
at y (dojo.js:1:86155)
at y (dojo.js:1:56539)
at v (dojo.js:1:56326)
at Object.<anonymous> (dojo.js:1:57145)
at dojo.js:1:87644
at u (dojo.js:1:58493)
at s (dojo.js:1:58419)
at f.resolve (dojo.js:1:59427)
overrideMethod @ installHook.js:1
b @ dojo.js:1
(anonymous) @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
require.cache.dojo/_base/Deferred.e.Deferred.reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
require.cache.dojo/_base/Deferred.e.Deferred.reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
require.cache.dojo/_base/Deferred.e.Deferred.reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
require.cache.dojo/_base/Deferred.e.Deferred.reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
(anonymous) @ dojo.js:1
(anonymous) @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
i @ dojo.js:1
XMLHttpRequest.send
h @ dojo.js:1
(anonymous) @ dojo.js:1
(anonymous) @ dojo.js:1
ajaxcall @ ly_studio.js:1
(anonymous) @ ly_studio.js:1
bgaPerformAction @ ly_studio.js:1
bloodyinn.sendInfo @ bloodyinn.js:1291
bloodyinn.sendInfoUndo @ bloodyinn.js:1298
bloodyinn.onStartOver @ bloodyinn.js:1849
(anonymous) @ bloodyinn?table=815391:2916
(anonymous) @ dojo.js:1Understand this error
ly_studio.js:1 Uncaught (in promise) undefined
(anonymous) @ ly_studio.js:1
(anonymous) @ dojo.js:1
p @ ly_studio.js:1
(anonymous) @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
require.cache.dojo/_base/Deferred.e.Deferred.reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
require.cache.dojo/_base/Deferred.e.Deferred.reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
(anonymous) @ dojo.js:1
(anonymous) @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
i @ dojo.js:1
XMLHttpRequest.send
h @ dojo.js:1
(anonymous) @ dojo.js:1
(anonymous) @ dojo.js:1
ajaxcall @ ly_studio.js:1
(anonymous) @ ly_studio.js:1
bgaPerformAction @ ly_studio.js:1
bloodyinn.sendInfo @ bloodyinn.js:1291
bloodyinn.sendInfoUndo @ bloodyinn.js:1298
bloodyinn.onStartOver @ bloodyinn.js:1849
(anonymous) @ bloodyinn?table=815391:2916
(anonymous) @ dojo.js:1Understand this error

Something very interesting with method "doneConfirm", if the infomration sent -"id" is just one number, it gives an error. I get no errors when more than 1 number sent.
bloodyinn.js:1289 in SendInfo this.info_sent is 13 method is doneConfirm
installHook.js:1 Server syntax error: bloodyinn/bloodyinn/doneConfirm.html SyntaxError: Unexpected token '<' / <br />
<b>Fatal error</b>: Uncaught TypeError: preg_match(): Argument #2 ($subject) must be of type string, array given in /var/tournoi/release/tournoi-251212-1111-gs/www/include/APP_Action.inc.php:182
Stack trace:
#0 /var/tournoi/release/tournoi-251212-1111-gs/www/include/APP_Action.inc.php(182): preg_match('...', Array)
#1 /var/tournoi/release/games/bloodyinn/999999-9999/bloodyinn.action.php(96): APP_Action-&gt;getArg('...', 27, true)
#2 /var/tournoi/release/tournoi-251212-1111-gs/www/Bga/GameFramework/GameAction.php(126): action_bloodyinn-&gt;doneConfirm()
#3 /var/tournoi/release/tournoi-251212-1111-gs/www/Bga/GameFramework/GamePageAction.php(346): Bga\GameFramework\GameAction-&gt;performServerAction('...')
#4 /var/tournoi/release/tournoi-251212-1111-gs/www/include/webActionCore.inc.php(175): Bga\GameFramework\GamePageAction-&gt;performServerAction('...')
#5 /var/tournoi/release/tournoi-251212-1111-gs/www/index.php(250): launchWebAction('...', '...', '...', false, false, NULL, true, false)
#6 {main}
thrown in <b>/var/tournoi/release/tournoi-251212-1111-gs/www/include/APP_Action.inc.php</b> on line <b>182</b><br />

overrideMethod @ installHook.js:1
p @ ly_studio.js:1
(anonymous) @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
require.cache.dojo/_base/Deferred.e.Deferred.reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
require.cache.dojo/_base/Deferred.e.Deferred.reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
(anonymous) @ dojo.js:1
(anonymous) @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
i @ dojo.js:1
XMLHttpRequest.send
h @ dojo.js:1
(anonymous) @ dojo.js:1
(anonymous) @ dojo.js:1
ajaxcall @ ly_studio.js:1
(anonymous) @ ly_studio.js:1
bgaPerformAction @ ly_studio.js:1
bloodyinn.sendInfo @ bloodyinn.js:1291
bloodyinn.onDone @ bloodyinn.js:2122
(anonymous) @ bloodyinn?table=815391:2916
(anonymous) @ dojo.js:1Understand this error
installHook.js:1 SyntaxError: Unexpected token '<'
at Object.fromJson (dojo.js:1:63709)
at Object.json (dojo.js:1:84156)
at y (dojo.js:1:86155)
at y (dojo.js:1:56539)
at v (dojo.js:1:56326)
at Object.<anonymous> (dojo.js:1:57145)
at dojo.js:1:87644
at u (dojo.js:1:58493)
at s (dojo.js:1:58419)
at f.resolve (dojo.js:1:59427)
overrideMethod @ installHook.js:1
b @ dojo.js:1
(anonymous) @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
require.cache.dojo/_base/Deferred.e.Deferred.reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
require.cache.dojo/_base/Deferred.e.Deferred.reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
require.cache.dojo/_base/Deferred.e.Deferred.reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
require.cache.dojo/_base/Deferred.e.Deferred.reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
(anonymous) @ dojo.js:1
(anonymous) @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
i @ dojo.js:1
XMLHttpRequest.send
h @ dojo.js:1
(anonymous) @ dojo.js:1
(anonymous) @ dojo.js:1
ajaxcall @ ly_studio.js:1
(anonymous) @ ly_studio.js:1
bgaPerformAction @ ly_studio.js:1
bloodyinn.sendInfo @ bloodyinn.js:1291
bloodyinn.onDone @ bloodyinn.js:2122
(anonymous) @ bloodyinn?table=815391:2916
(anonymous) @ dojo.js:1Understand this error
ly_studio.js:1 Uncaught (in promise) undefined
(anonymous) @ ly_studio.js:1
(anonymous) @ dojo.js:1
p @ ly_studio.js:1
(anonymous) @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
require.cache.dojo/_base/Deferred.e.Deferred.reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
require.cache.dojo/_base/Deferred.e.Deferred.reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
(anonymous) @ dojo.js:1
(anonymous) @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
i @ dojo.js:1
XMLHttpRequest.send
h @ dojo.js:1
(anonymous) @ dojo.js:1
(anonymous) @ dojo.js:1
ajaxcall @ ly_studio.js:1
(anonymous) @ ly_studio.js:1
bgaPerformAction @ ly_studio.js:1
bloodyinn.sendInfo @ bloodyinn.js:1291
bloodyinn.onDone @ bloodyinn.js:2122
(anonymous) @ bloodyinn?table=815391:2916
(anonymous) @ dojo.js:1Understand this error
bloodyinn.js:1289 in SendInfo this.info_sent is 13 method is doneConfirm
installHook.js:1 Server syntax error: bloodyinn/bloodyinn/doneConfirm.html SyntaxError: Unexpected token '<' / <br />
<b>Fatal error</b>: Uncaught TypeError: preg_match(): Argument #2 ($subject) must be of type string, array given in /var/tournoi/release/tournoi-251212-1111-gs/www/include/APP_Action.inc.php:182
Stack trace:
#0 /var/tournoi/release/tournoi-251212-1111-gs/www/include/APP_Action.inc.php(182): preg_match('...', Array)
#1 /var/tournoi/release/games/bloodyinn/999999-9999/bloodyinn.action.php(96): APP_Action-&gt;getArg('...', 27, true)
#2 /var/tournoi/release/tournoi-251212-1111-gs/www/Bga/GameFramework/GameAction.php(126): action_bloodyinn-&gt;doneConfirm()
#3 /var/tournoi/release/tournoi-251212-1111-gs/www/Bga/GameFramework/GamePageAction.php(346): Bga\GameFramework\GameAction-&gt;performServerAction('...')
#4 /var/tournoi/release/tournoi-251212-1111-gs/www/include/webActionCore.inc.php(175): Bga\GameFramework\GamePageAction-&gt;performServerAction('...')
#5 /var/tournoi/release/tournoi-251212-1111-gs/www/index.php(250): launchWebAction('...', '...', '...', false, false, NULL, true, false)
#6 {main}
thrown in <b>/var/tournoi/release/tournoi-251212-1111-gs/www/include/APP_Action.inc.php</b> on line <b>182</b><br />

overrideMethod @ installHook.js:1
p @ ly_studio.js:1
(anonymous) @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
require.cache.dojo/_base/Deferred.e.Deferred.reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
require.cache.dojo/_base/Deferred.e.Deferred.reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
(anonymous) @ dojo.js:1
(anonymous) @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
i @ dojo.js:1
XMLHttpRequest.send
h @ dojo.js:1
(anonymous) @ dojo.js:1
(anonymous) @ dojo.js:1
ajaxcall @ ly_studio.js:1
(anonymous) @ ly_studio.js:1
bgaPerformAction @ ly_studio.js:1
bloodyinn.sendInfo @ bloodyinn.js:1291
bloodyinn.onDone @ bloodyinn.js:2122
(anonymous) @ bloodyinn?table=815391:2916
(anonymous) @ dojo.js:1Understand this error
installHook.js:1 SyntaxError: Unexpected token '<'
at Object.fromJson (dojo.js:1:63709)
at Object.json (dojo.js:1:84156)
at y (dojo.js:1:86155)
at y (dojo.js:1:56539)
at v (dojo.js:1:56326)
at Object.<anonymous> (dojo.js:1:57145)
at dojo.js:1:87644
at u (dojo.js:1:58493)
at s (dojo.js:1:58419)
at f.resolve (dojo.js:1:59427)
overrideMethod @ installHook.js:1
b @ dojo.js:1
(anonymous) @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
require.cache.dojo/_base/Deferred.e.Deferred.reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
require.cache.dojo/_base/Deferred.e.Deferred.reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
require.cache.dojo/_base/Deferred.e.Deferred.reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
require.cache.dojo/_base/Deferred.e.Deferred.reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
(anonymous) @ dojo.js:1
(anonymous) @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
(anonymous) @ dojo.js:1
l @ dojo.js:1
i @ dojo.js:1
XMLHttpRequest.send
h @ dojo.js:1
(anonymous) @ dojo.js:1
(anonymous) @ dojo.js:1
ajaxcall @ ly_studio.js:1
(anonymous) @ ly_studio.js:1
bgaPerformAction @ ly_studio.js:1
bloodyinn.sendInfo @ bloodyinn.js:1291
bloodyinn.onDone @ bloodyinn.js:2122
(anonymous) @ bloodyinn?table=815391:2916
(anonymous) @ dojo.js:1Understand this error
ly_studio.js:1 Uncaught (in promise) undefined

ly_studio.js:1 Uncaught (in promise) undefined
(anonymous) @ ly_studio.js:1
(anonymous) @ dojo.js:1
p @ ly_studio.js:1
(anonymous) @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
resolve.callback @ dojo.js:1
(anonymous) @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
i @ dojo.js:1
XMLHttpRequest.send
h @ dojo.js:1
(anonymous) @ dojo.js:1
e.xhrGet @ dojo.js:1
ajaxcall @ ly_studio.js:1
(anonymous) @ ly_studio.js:1
bgaPerformAction @ ly_studio.js:1
bloodyinn.sendInfo @ bloodyinn.js:1291
bloodyinn.sendInfoUndo @ bloodyinn.js:1298
bloodyinn.onStartOver @ bloodyinn.js:1849
(anonymous) @ bloodyinn?table=815391:2916
(anonymous) @ dojo.js:1Understand this error
bloodyinn.js:1289 in SendInfo this.info_sent is method is doneConfirm
ly_studio.js:1 Uncaught (in promise) Failed to get mandatory argument: id
(anonymous) @ ly_studio.js:1
(anonymous) @ dojo.js:1
load @ ly_studio.js:1
(anonymous) @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
resolve.callback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
resolve.callback @ dojo.js:1
(anonymous) @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
i @ dojo.js:1
XMLHttpRequest.send
h @ dojo.js:1
(anonymous) @ dojo.js:1
e.xhrGet @ dojo.js:1
ajaxcall @ ly_studio.js:1
(anonymous) @ ly_studio.js:1
bgaPerformAction @ ly_studio.js:1
bloodyinn.sendInfo @ bloodyinn.js:1291
bloodyinn.onDone @ bloodyinn.js:2122
(anonymous) @ bloodyinn?table=815391:2916
(anonymous) @ dojo.js:1Understand this error
bloodyinn.js:1289 in SendInfo this.info_sent is 13 method is doneConfirm
installHook.js:1 Server syntax error: bloodyinn/bloodyinn/doneConfirm.html SyntaxError: Unexpected token '<' / <br />
<b>Fatal error</b>: Uncaught TypeError: preg_match(): Argument #2 ($subject) must be of type string, array given in /var/tournoi/release/tournoi-251212-1111-gs/www/include/APP_Action.inc.php:182
Stack trace:
#0 /var/tournoi/release/tournoi-251212-1111-gs/www/include/APP_Action.inc.php(182): preg_match('...', Array)
#1 /var/tournoi/release/games/bloodyinn/999999-9999/bloodyinn.action.php(96): APP_Action-&gt;getArg('...', 27, true)
#2 /var/tournoi/release/tournoi-251212-1111-gs/www/Bga/GameFramework/GameAction.php(126): action_bloodyinn-&gt;doneConfirm()
#3 /var/tournoi/release/tournoi-251212-1111-gs/www/Bga/GameFramework/GamePageAction.php(346): Bga\GameFramework\GameAction-&gt;performServerAction('...')
#4 /var/tournoi/release/tournoi-251212-1111-gs/www/include/webActionCore.inc.php(175): Bga\GameFramework\GamePageAction-&gt;performServerAction('...')
#5 /var/tournoi/release/tournoi-251212-1111-gs/www/index.php(250): launchWebAction('...', '...', '...', false, false, NULL, true, false)
#6 {main}
thrown in <b>/var/tournoi/release/tournoi-251212-1111-gs/www/include/APP_Action.inc.php</b> on line <b>182</b><br />

overrideMethod @ installHook.js:1
p @ ly_studio.js:1
(anonymous) @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
resolve.callback @ dojo.js:1
(anonymous) @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
i @ dojo.js:1
XMLHttpRequest.send
h @ dojo.js:1
(anonymous) @ dojo.js:1
e.xhrGet @ dojo.js:1
ajaxcall @ ly_studio.js:1
(anonymous) @ ly_studio.js:1
bgaPerformAction @ ly_studio.js:1
bloodyinn.sendInfo @ bloodyinn.js:1291
bloodyinn.onDone @ bloodyinn.js:2122
(anonymous) @ bloodyinn?table=815391:2916
(anonymous) @ dojo.js:1Understand this error
installHook.js:1 SyntaxError: Unexpected token '<'
at dojo.fromJson (dojo.js:1:63709)
at Object.json (dojo.js:1:84156)
at y (dojo.js:1:86155)
at y (dojo.js:1:56539)
at v (dojo.js:1:56326)
at resolve.callback (dojo.js:1:57145)
at dojo.js:1:87644
at u (dojo.js:1:58493)
at s (dojo.js:1:58419)
at f.resolve (dojo.js:1:59427)
overrideMethod @ installHook.js:1
b @ dojo.js:1
(anonymous) @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
resolve.callback @ dojo.js:1
(anonymous) @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
i @ dojo.js:1
XMLHttpRequest.send
h @ dojo.js:1
(anonymous) @ dojo.js:1
e.xhrGet @ dojo.js:1
ajaxcall @ ly_studio.js:1
(anonymous) @ ly_studio.js:1
bgaPerformAction @ ly_studio.js:1
bloodyinn.sendInfo @ bloodyinn.js:1291
bloodyinn.onDone @ bloodyinn.js:2122
(anonymous) @ bloodyinn?table=815391:2916
(anonymous) @ dojo.js:1Understand this error
ly_studio.js:1 Uncaught (in promise) undefined
(anonymous) @ ly_studio.js:1
(anonymous) @ dojo.js:1
p @ ly_studio.js:1
(anonymous) @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
resolve.callback @ dojo.js:1
(anonymous) @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
i @ dojo.js:1
XMLHttpRequest.send
h @ dojo.js:1
(anonymous) @ dojo.js:1
e.xhrGet @ dojo.js:1
ajaxcall @ ly_studio.js:1
(anonymous) @ ly_studio.js:1
bgaPerformAction @ ly_studio.js:1
bloodyinn.sendInfo @ bloodyinn.js:1291
bloodyinn.onDone @ bloodyinn.js:2122
(anonymous) @ bloodyinn?table=815391:2916
(anonymous) @ dojo.js:1Understand this error

Here no error with action method doneConfirm when more than 1 number is sent
bloodyinn.js:1289 in SendInfo this.info_sent is 13 12 method is doneConfirm

but I cannot get the same thing when add more information using method undo
in SendInfo this.info_sent is test SO method is unDos
installHook.js:1 Server syntax error: bloodyinn/bloodyinn/unDos.html SyntaxError: Unexpected token '<' / <br />
<b>Fatal error</b>: Uncaught TypeError: preg_match(): Argument #2 ($subject) must be of type string, array given in /var/tournoi/release/tournoi-251212-1111-gs/www/include/APP_Action.inc.php:178
Stack trace:
#0 /var/tournoi/release/tournoi-251212-1111-gs/www/include/APP_Action.inc.php(178): preg_match('...', Array)
#1 /var/tournoi/release/games/bloodyinn/999999-9999/bloodyinn.action.php(64): APP_Action-&gt;getArg('...', 7, true)
#2 /var/tournoi/release/tournoi-251212-1111-gs/www/Bga/GameFramework/GameAction.php(126): action_bloodyinn-&gt;unDos()
#3 /var/tournoi/release/tournoi-251212-1111-gs/www/Bga/GameFramework/GamePageAction.php(346): Bga\GameFramework\GameAction-&gt;performServerAction('...')
#4 /var/tournoi/release/tournoi-251212-1111-gs/www/include/webActionCore.inc.php(175): Bga\GameFramework\GamePageAction-&gt;performServerAction('...')
#5 /var/tournoi/release/tournoi-251212-1111-gs/www/index.php(250): launchWebAction('...', '...', '...', false, false, NULL, true, false)
#6 {main}
thrown in <b>/var/tournoi/release/tournoi-251212-1111-gs/www/include/APP_Action.inc.php</b> on line <b>178</b><br />

overrideMethod @ installHook.js:1
p @ ly_studio.js:1
(anonymous) @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
resolve.callback @ dojo.js:1
(anonymous) @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
i @ dojo.js:1
XMLHttpRequest.send
h @ dojo.js:1
(anonymous) @ dojo.js:1
e.xhrGet @ dojo.js:1
ajaxcall @ ly_studio.js:1
(anonymous) @ ly_studio.js:1
bgaPerformAction @ ly_studio.js:1
bloodyinn.sendInfo @ bloodyinn.js:1291
bloodyinn.sendInfoUndo @ bloodyinn.js:1298
bloodyinn.onStartOver @ bloodyinn.js:1849
(anonymous) @ bloodyinn?table=815391:2916
(anonymous) @ dojo.js:1Understand this error
installHook.js:1 SyntaxError: Unexpected token '<'
at dojo.fromJson (dojo.js:1:63709)
at Object.json (dojo.js:1:84156)
at y (dojo.js:1:86155)
at y (dojo.js:1:56539)
at v (dojo.js:1:56326)
at resolve.callback (dojo.js:1:57145)
at dojo.js:1:87644
at u (dojo.js:1:58493)
at s (dojo.js:1:58419)
at f.resolve (dojo.js:1:59427)
overrideMethod @ installHook.js:1
b @ dojo.js:1
(anonymous) @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
reject.errback @ dojo.js:1
y @ dojo.js:1
v @ dojo.js:1
resolve.callback @ dojo.js:1
(anonymous) @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
u @ dojo.js:1
s @ dojo.js:1
resolve @ dojo.js:1
l @ dojo.js:1
i @ dojo.js:1
XMLHttpRequest.send
h @ dojo.js:1
(anonymous) @ dojo.js:1
e.xhrGet @ dojo.js:1
ajaxcall @ ly_studio.js:1
(anonymous) @ ly_studio.js:1
bgaPerformAction @ ly_studio.js:1
bloodyinn.sendInfo @ bloodyinn.js:1291
bloodyinn.sendInfoUndo @ bloodyinn.js:1298
bloodyinn.onStartOver @ bloodyinn.js:1849
(anonymous) @ bloodyinn?table=815391:2916
(anonymous) @ dojo.js:1Understand this error
ly_studio.js:1 Uncaught (in promise) undefined

here are more examples of successful information sent to the server
bloodyinn.js:1289 in SendInfo this.info_sent is 2323321 method is processBurial
bloodyinn.js:1289 in SendInfo this.info_sent is accomplice 2323321 0 false 66 53 54 method is getAccomplices
bloodyinn.js:1289 in SendInfo this.info_sent is 00 00 00 method is admitGuest
bloodyinn.js:1289 in SendInfo this.info_sent is bribed_2 peasant 2323321 method is playerAction
bloodyinn.js:1289 in SendInfo this.info_sent is bribed_2 peasant 2323321 method is playerAction
bloodyinn.js:1289 in SendInfo this.info_sent is 00 00 00 method is admitGuest
bloodyinn.js:1289 in SendInfo this.info_sent is bribed 36 2323321 method is playerAction
bloodyinn.js:1289 in SendInfo this.info_sent is accomplice 2323321 0 66 53 54 method is getAccomplices
bloodyinn.js:1289 in SendInfo this.info_sent is bribed_2 peasant 2323321 method is playerAction
bloodyinn.js:1289 in SendInfo this.info_sent is 00 00 00 method is admitGuest
bloodyinn.js:1289 in SendInfo this.info_sent is bribed 63 2323321 method is playerAction
bloodyinn.js:1289 in SendInfo this.info_sent is accomplice 2323321 0 66 18 method is getAccomplices
bloodyinn.js:1289 in SendInfo this.info_sent is built 63 2323321 method is playerAction
bloodyinn.js:1289 in SendInfo this.info_sent is accomplice 2323321 0 36 54 method is getAccomplices
bloodyinn.js:1289 in SendInfo this.info_sent is confirmRoom top_card2 2323321 method is confirmSelection
bloodyinn.js:1289 in SendInfo this.info_sent is neutral 62 top_card1 method is admitGuest
bloodyinn.js:1289 in SendInfo this.info_sent is neutral 19 top_card2 method is admitGuest
bloodyinn.js:1289 in SendInfo this.info_sent is neutral 60 top_card3 method is admitGuest
bloodyinn.js:1289 in SendInfo this.info_sent is 2323321 38 bottom_card1 method is admitGuest
bloodyinn.js:1289 in SendInfo this.info_sent is bribed_2 peasant 2323321 method is playerAction
bloodyinn.js:1289 in SendInfo this.info_sent is bribed 38 2323321 method is playerAction
bloodyinn.js:1289 in SendInfo this.info_sent is accomplice 2323321 0 66 54 method is getAccomplices
bloodyinn.js:1289 in SendInfo this.info_sent is neutral 78 top_card1 method is admitGuest
bloodyinn.js:1289 in SendInfo this.info_sent is neutral 44 top_card3 method is admitGuest
bloodyinn.js:1289 in SendInfo this.info_sent is neutral 45 top_card2 method is admitGuest
bloodyinn.js:1289 in SendInfo this.info_sent is 00 00 00 method is admitGuest
bloodyinn.js:1289 in SendInfo this.info_sent is bribed_2 peasant 2323321 method is playerAction
bloodyinn.js:1289 in SendInfo this.info_sent is bribed 45 2323321 method is playerAction
bloodyinn.js:1289 in SendInfo this.info_sent is accomplice 2323321 0 54 method is getAccomplices
bloodyinn.js:1289 in SendInfo this.info_sent is neutral 42 top_card2 method is admitGuest
bloodyinn.js:1289 in SendInfo this.info_sent is 00 00 00 method is admitGuest
bloodyinn.js:1289 in SendInfo this.info_sent is built 45 2323321 method is playerAction
bloodyinn.js:1289 in SendInfo this.info_sent is accomplice 2323321 0 method is getAccomplices


Thank you for the help
Last edited by abcde on 13 December 2025, 20:42, edited 3 times in total.
User avatar
GTSchemer
Posts: 1130
Joined: 09 August 2013, 03:26

Re: Sudden syntax errors just appearing to game when I did not make any changes

Post by GTSchemer »

I had something similar happen where I now need to use join() to form a string, instead of sending an array as part of an AJAX call.

This was apparently a recent change in the BGA framework. It would be great if there were a changelog on the forum and/or in a Studio wiki page, so devs who aren't in the Discord can still review the changes with each new version.
User avatar
abcde
Posts: 28
Joined: 24 January 2014, 18:30

Re: Sudden syntax errors just appearing to game when I did not make any changes

Post by abcde »

thanks for your reply and for giving me your fix to the problem GTSchemer! :D
User avatar
thoun
Posts: 1619
Joined: 10 December 2020, 22:25

Re: Sudden syntax errors just appearing to game when I did not make any changes

Post by thoun »

It means you sent arrays from the js side and expected a string in the php side. In that case, Bga was wrongly sending the last element of this array as a string, and it was fixed to correctly send the array.
So it breaks only games that sent arrays and expected to receive a string. Joining the array to create a string will fix the issue indeed.
User avatar
developgame
Posts: 107
Joined: 15 June 2020, 20:56

Re: Sudden syntax errors just appearing to game when I did not make any changes

Post by developgame »

Thank you Thuon and GTSchemer for your help and advice! It was helpful with getting my game fixed
Post Reply

Return to “Developers”