From 8545e419c6ed188076a7e2753715d21b7c116c59 Mon Sep 17 00:00:00 2001 From: TienTN Date: Fri, 2 Sep 2016 19:32:46 +0700 Subject: [PATCH] fix the error when moving by cursor/arrow to the border of the map --- README | 9 +++++++-- unx.js | 6 +++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README b/README index d021cf19..d67e5a40 100644 --- a/README +++ b/README @@ -7,8 +7,13 @@ My changes notes: 0. Change README with new contents 1. Change install/templates/config.tpl to deal with deprecated warning from new PHP version. 2. Fix install/data/sql.sql, to be executable in current MySQL version. -3. Fix to db_MYSQL.php with safe_mysql_fetch_all, and safe_mysql_fetch_array wrappers, to avoid error: fix for Warning: mysql_fetch_all/array() expects parameter 1 to be resource, boolean given -4. Fix to the db_MYSQLi.php in class object declaration(if anybody want to use db_MYSQLi.php again) +3. Fix db_MYSQL.php + with safe_mysql_fetch_all, and safe_mysql_fetch_array wrappers, to avoid error: fix for Warning: mysql_fetch_all/array() expects parameter 1 to be resource, boolean given +4. Fix the db_MYSQLi.php in class object declaration(if anybody want to use db_MYSQLi.php again) +5. Fix the unx.js file for error: + VM5051:1 Uncaught SyntaxError: Unexpected token ) + jd.onreadystatechange @ unx.js?0ac36:170 + This error arises when moving to the border of the map. Note for the original code: The last commit 4372c40 from Shadowss/TravianZ is on Jul 6 2016, with note: diff --git a/unx.js b/unx.js index eef5c17c..80879ea8 100644 --- a/unx.js +++ b/unx.js @@ -166,7 +166,11 @@ function fd(url,gd,hd,id){ var kd=jd.getResponseHeader('Content-Type'); kd=kd.substr(0,kd.indexOf(';')); switch(kd){ - case'application/json':gd((jd.responseText==''?null:eval('('+jd.responseText+')')));break; + case'application/json': + if (jd.responseText.indexOf('[]') < 0) { + gd((jd.responseText==''?null:eval('('+jd.responseText+')'))); + } + break; case'text/plain':case'text/html':gd(jd.responseText);break; default:throw'Illegal content type'; }