diff --git a/_server/MotaActionParser.js b/_server/MotaActionParser.js index 6acd654f..e60d61c7 100644 --- a/_server/MotaActionParser.js +++ b/_server/MotaActionParser.js @@ -1256,7 +1256,7 @@ MotaActionFunctions.pattern.replaceStatusList = [ MotaActionFunctions.pattern.replaceItemList = []; for (var id in core.material.items) { var name = core.material.items[id].name; - if (id && name && name != '新物品') { + if (id && name && name != '新物品' && /^[a-zA-Z0-9_\u4E00-\u9FCC]+$/.test(name)) { MotaActionFunctions.pattern.replaceItemList.push([id, name]); } } @@ -1264,7 +1264,7 @@ MotaActionFunctions.pattern.replaceStatusList = [ MotaActionFunctions.pattern.replaceEnemyList = []; for (var id in core.material.enemys) { var name = core.material.enemys[id].name; - if (id && name && name != '新敌人') { + if (id && name && name != '新敌人' && /^[a-zA-Z0-9_\u4E00-\u9FCC]+$/.test(name)) { MotaActionFunctions.pattern.replaceEnemyList.push([id, name]); } } diff --git a/_server/fs.js b/_server/fs.js index 0ece7748..d0110304 100644 --- a/_server/fs.js +++ b/_server/fs.js @@ -56,7 +56,8 @@ callback(null, data); } }, function (e) { - main.log(e); + if (window.main != null && main.log) main.log(e); + else console.log(e); callback(e+":请检查启动服务是否处于正常运行状态。"); }, "text/plain; charset=x-user-defined"); } @@ -153,15 +154,7 @@ throw 'Type Error in fs.readdir'; var data = ''; data += 'name=' + path; - postsomething(data, '/makeDir', function (err, data) { - try { - data = JSON.parse(data); - } catch (e) { - err = "Invalid /makeDir"; - data = null; - } - callback(err, data); - }); + postsomething(data, '/makeDir', callback); return; } @@ -174,15 +167,7 @@ throw 'Type Error in fs.readdir'; var data = ''; data += 'src=' + src + "&dest=" + dest; - postsomething(data, '/moveFile', function (err, data) { - try { - data = JSON.parse(data); - } catch (e) { - err = "Invalid /moveFile"; - data = null; - } - callback(err, data); - }); + postsomething(data, '/moveFile', callback); return; } @@ -195,15 +180,7 @@ throw 'Type Error in fs.readdir'; var data = ''; data += 'name=' + path; - postsomething(data, '/deleteFile', function (err, data) { - try { - data = JSON.parse(data); - } catch (e) { - err = "Invalid /deleteFile"; - data = null; - } - callback(err, data); - }); + postsomething(data, '/deleteFile', callback); return; } })(); \ No newline at end of file diff --git a/_server/fsTest_cs.html b/_server/fsTest_cs.html index 9a392e4a..0da50c14 100644 --- a/_server/fsTest_cs.html +++ b/_server/fsTest_cs.html @@ -7,40 +7,63 @@ diff --git a/_server/table/comment.js b/_server/table/comment.js index 9a88381c..698cf390 100644 --- a/_server/table/comment.js +++ b/_server/table/comment.js @@ -335,7 +335,7 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { "_leaf": true, "_type": "select", "_select": { - "values": [1,2,3,4], + "values": [null,1,2,3,4], }, "_docs": "动画帧数", "_data": "null代表素材默认帧数" diff --git a/main.js b/main.js index 7f502e20..57e258ef 100644 --- a/main.js +++ b/main.js @@ -197,6 +197,13 @@ main.prototype.init = function (mode, callback) { main.mode = mode; main.loadJs('project', main.pureData, function(){ + if (items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a.itemEffect + && items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a.itemEffectTip) { + alert('即将跳转到接档工具...'); + window.location = 'migration.html'; + return; + } + var mainData = data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d.main; for(var ii in mainData)main[ii]=mainData[ii]; diff --git a/migration.html b/migration.html new file mode 100644 index 00000000..7655fda3 --- /dev/null +++ b/migration.html @@ -0,0 +1,587 @@ + + + + + + + + HTML5魔塔样板V2.7接档工具 + + +

HTML5魔塔样板V2.7接档工具

+ + + + + + + + + + + + +

请严格按照如下流程,一步步进行接档操作。请勿随意增删接档过程,以免出现编辑器白屏、闪退等情况。

+ +

+

    +
  1. 做好备份,做好备份,做好备份!!!接档前请一定先做好备份!
  2. +
  3. 使用RM转H5刻塔器所刻的塔不适用于此接档工具。
  4. +
  5. 将V2.6.6样板中project目录下,除了project/functions.jsproject/plugins.js以外的其他文件和文件夹,直接复制到最新的V2.7样板中,然后打开本接档工具。
  6. +
  7. 点击上述的「点此一键接档」,并看到红字提示接档成功。此时编辑器应该可以正常打开。若此时无法打开编辑器请联系小艾处理。
  8. +
  9. 下拉框切到「全塔属性」,并注意以下内容: + +
  10. +
  11. 下拉框切到「楼层属性」,并注意以下内容: + +
  12. +
  13. 素材区的如下图块有所变动: + +
  14. +
  15. 下拉框切换到「脚本编辑」,并请重新编辑各个自己改过的函数(可以双开一个原版V266项目和当前接档的项目进行处理)。 + +
  16. +
  17. 下拉框切换到「插件编写」,并重新新增自己加过的插件。 + +
  18. +
  19. 请仔细检查每个道具的道具效果、每个怪物的属性、每个楼层属性、以及每个点的事件(建议双开对比)。主要变动如下: + +
  20. +
  21. 接档后请做好充分的测试!最好能跑通录像以确认接档无误!
  22. +
+

+ + + + + diff --git a/project/materials/animates.png b/project/materials/animates.png index 01305fd6..811075ea 100644 Binary files a/project/materials/animates.png and b/project/materials/animates.png differ diff --git a/project/materials/npcs.png b/project/materials/npcs.png index 9647d7d9..7cbcb950 100644 Binary files a/project/materials/npcs.png and b/project/materials/npcs.png differ diff --git a/server.py b/server.py index 6aaea881..3c368327 100644 --- a/server.py +++ b/server.py @@ -7,6 +7,7 @@ import sys import json import os +import shutil import base64 isPy3 = sys.version_info > (3, 0) @@ -141,6 +142,46 @@ def listFile(): if os.path.isfile(os.path.join(filename, f))] return "[" + ", ".join(['"'+f+'"' for f in files]) + "]" +@app.route('/makeDir', methods=['POST']) +def makeDir(): + data = process_request() + filename = data.get('name', None) + if filename is None or not is_sub(filename): + abort(403) + return + if not os.path.exists(filename): + os.makedirs(filename) + return 'Success' + +@app.route('/moveFile', methods=['POST']) +def moveFile(): + data = process_request() + src = data.get('src', None) + dest = data.get('dest', None) + if src is None or dest is None or not is_sub(src) or not is_sub(dest): + abort(403) + return + if not os.path.exists(src): + abort(404) + return + if os.path.exists(dest): + os.remove(dest) + os.rename(src, dest) + return 'Success' + +@app.route('/deleteFile', methods=['POST']) +def deleteFile(): + data = process_request() + name = data.get('name', None) + if name is None or not is_sub(name): + abort(403) + return + if os.path.isfile(name): + os.remove(name) + elif os.path.isdir(name): + shutil.rmtree(name) + return 'Success' + def port_used(port): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) result = True