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 @@
++
project/functions.js和project/plugins.js以外的其他文件和文件夹,直接复制到最新的V2.7样板中,然后打开本接档工具。item_ratio被重命名为ratio,请自行修改。noPass:false都改成canPass:true;请仔细检查可通行性。${}计算,ratio需写明全称(参见宝石血瓶写法),请自行处理。null改回为4;如需静止状态请手动改成1。experience替换成简写的exp;写伤害计算等时请尤其注意。snipe改名repulse,shoes改名amulet等等,请自行处理。setInitData已被删除,请将需要的额外初始化代码写入startText中。afterChangeLight, afterUseBomb, afterPassNet已被删除,请去对应图块属性内修改。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 @@ + + +
+ + + + +
+ +
+ 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