From 4a6c5042ac1fe82c0d6d3ee216d0b82bf70a4c62 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Sat, 23 May 2020 20:26:42 +0800 Subject: [PATCH] =?UTF-8?q?Fix=202.7=20=E6=8E=A5=E6=A1=A3=E5=B7=A5?= =?UTF-8?q?=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- API列表.txt | 4 ---- _docs/api.md | 4 ---- libs/control.js | 2 -- libs/utils.js | 14 -------------- main.js | 4 ++-- migration.html | 6 +++--- project/data.js | 2 +- server.py | 2 ++ v2.x-final更新.txt | 3 ++- 9 files changed, 10 insertions(+), 31 deletions(-) diff --git a/API列表.txt b/API列表.txt index 6140cf9e..2f2bb602 100644 --- a/API列表.txt +++ b/API列表.txt @@ -2142,10 +2142,6 @@ core.showWithAnimate(obj, speed, callback) / core.hideWithAnimate(obj, speed, ca 动画淡入或淡出一个对象。 -core.hashCode(obj) -计算一个对象的哈希值。 - - core.same(a, b) 判定a和b是否相同,包括类型相同和值相同。 如果a和b都是数组,则会递归依次比较数组中的值;如果都是对象亦然。 diff --git a/_docs/api.md b/_docs/api.md index badadd59..78f7c55e 100644 --- a/_docs/api.md +++ b/_docs/api.md @@ -2142,10 +2142,6 @@ core.showWithAnimate(obj, speed, callback) / core.hideWithAnimate(obj, speed, ca 动画淡入或淡出一个对象。 -core.hashCode(obj) -计算一个对象的哈希值。 - - core.same(a, b) 判定a和b是否相同,包括类型相同和值相同。 如果a和b都是数组,则会递归依次比较数组中的值;如果都是对象亦然。 diff --git a/libs/control.js b/libs/control.js index b37438f9..448571c9 100644 --- a/libs/control.js +++ b/libs/control.js @@ -1760,8 +1760,6 @@ control.prototype._doSL_replayLoad_afterGet = function (id, data) { if (!data) return core.drawTip("无效的存档"); if (data.version != core.firstData.version) return core.drawTip("存档版本不匹配"); if (data.hard != core.status.hard) core.drawTip("游戏难度不匹配!"); - if (data.hashCode != null && data.hashCode != core.utils.hashCode(data.hero)) - return alert("存档校验失败,请勿修改存档文件!"); var route = core.subarray(core.status.route, core.decodeRoute(data.route)); if (route == null || data.hero.flags.__seed__ != core.getFlag('__seed__')) return core.drawTip("无法从此存档回放录像"); diff --git a/libs/utils.js b/libs/utils.js index cc8ac172..a4f7171f 100644 --- a/libs/utils.js +++ b/libs/utils.js @@ -1091,20 +1091,6 @@ utils.prototype._decodeCanvas = function (arr, width, height) { tempCanvas.putImageData(imgData, 0, 0); } -utils.prototype.hashCode = function (obj) { - if (typeof obj == 'string') { - var hash = 0, i, chr; - if (obj.length === 0) return hash; - for (i = 0; i < obj.length; i++) { - chr = obj.charCodeAt(i); - hash = ((hash << 5) - hash) + chr; - hash |= 0; - } - return hash; - } - return this.hashCode(JSON.stringify(obj).split("").sort().join("")); -} - utils.prototype.same = function (a, b) { if (a == null && b == null) return true; if (a == null || b == null) return false; diff --git a/main.js b/main.js index 57e258ef..90b360f0 100644 --- a/main.js +++ b/main.js @@ -186,8 +186,8 @@ function main() { this.floors = {} this.canvas = {}; - this.__VERSION__ = "2.6.6"; - this.__VERSION_CODE__ = 99; + this.__VERSION__ = "2.7"; + this.__VERSION_CODE__ = 127; } main.prototype.init = function (mode, callback) { diff --git a/migration.html b/migration.html index 7655fda3..1cbc9670 100644 --- a/migration.html +++ b/migration.html @@ -118,7 +118,7 @@ function action_data(callback) { // Step 0: 移动目录 // materials - ['animates', 'enemys', 'items', 'npcs', 'terrains', 'enemy48', 'npc48', 'icons'].forEach(function (one) { + ['animates', 'enemys', 'items', 'npcs', 'terrains', 'enemy48', 'npc48', 'icons', 'airwall', 'fog', 'keyboard'].forEach(function (one) { fs.moveFile('project/images/'+one+".png", 'project/materials/'+one+'.png', function (e, d) {}); }); main.tilesets.forEach(function (one) { @@ -127,7 +127,7 @@ function action_data(callback) { }); // bgms main.bgms.forEach(function (one) { - fs.moveFile('project/bgms/'+one, 'project/bgms/'+one, function (e,d) {}); + fs.moveFile('project/sounds/'+one, 'project/bgms/'+one, function (e,d) {}); }) // Step 1: 重置levelChoose和shop @@ -308,7 +308,7 @@ function action_items(callback) { var data = items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a[one]; if (!data) return; for (var id in data) { - if (data[id] != null) + if (data[id] != null && items[id]) items[id][one] = data[id]; } }); diff --git a/project/data.js b/project/data.js index 40c16e7d..c77e5f3b 100644 --- a/project/data.js +++ b/project/data.js @@ -87,7 +87,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "firstData": { "title": "魔塔样板", "name": "template", - "version": "Ver 2.6.6", + "version": "Ver 2.7", "floorId": "sample0", "hero": { "image": "hero.png", diff --git a/server.py b/server.py index 3c368327..04533e94 100644 --- a/server.py +++ b/server.py @@ -164,6 +164,8 @@ def moveFile(): if not os.path.exists(src): abort(404) return + if src == dest: + return 'Success' if os.path.exists(dest): os.remove(dest) os.rename(src, dest) diff --git a/v2.x-final更新.txt b/v2.x-final更新.txt index 5f0b5cc9..df7659ea 100644 --- a/v2.x-final更新.txt +++ b/v2.x-final更新.txt @@ -54,7 +54,7 @@ (已完成!) 大屏幕下放大游戏界面 (已完成!) 最近使用/最常使用的图块 (已完成!) loader并行加载 -合并items.js +(已完成!) 合并items.js (已完成!) 增加fonts目录,全塔属性增加fonts引用 (已完成!) 右边框输入完后解析按钮高亮 (已完成!) 32x48的门 @@ -68,6 +68,7 @@ (不处理;现在静止状态可以有帧动画了,所以不考虑行走过程动画) 行走动画 (已完成!) 合并main中一些设置内容 (已完成!) \t[this], 勇士朝下,flag:arg清理,瞬移扣血 +nowLoc;同步存档合并;右键反复弹出;失去焦点右键;地图编辑框无效 -------------