mirror of
https://gitee.com/dgflash/oops-framework.git
synced 2026-05-31 18:59:19 +08:00
修复游戏数据生成插件第一条记录未生成的问题
This commit is contained in:
@@ -227,7 +227,7 @@
|
||||
"_priority": 1073741824,
|
||||
"_fov": 45,
|
||||
"_fovAxis": 0,
|
||||
"_orthoHeight": 435.75652173913045,
|
||||
"_orthoHeight": 450.15468607825295,
|
||||
"_near": 1,
|
||||
"_far": 2000,
|
||||
"_color": {
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
{
|
||||
"ver": "1.1.38",
|
||||
"importer": "scene",
|
||||
"imported": false,
|
||||
"imported": true,
|
||||
"uuid": "ba0b085f-f8d5-40b0-9964-2fd25728d707",
|
||||
"files": [],
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"2":{"1":{"title":"断网提示","describe":"网络异常","array":{"a":1},"hp":2}}}
|
||||
{"1":{"2":{"3":{"title":"系统提示","describe":"服务器正在更新,请稍后!","array":{"a":1,"b":"abc"},"hp":1}}},"2":{"1":{"1":{"title":"断网提示","describe":"网络异常","array":{"a":1},"hp":2}}}}
|
||||
@@ -1 +1 @@
|
||||
{"5":{"armsName":"刺客","weaponType":[10,11,12],"power":5,"agile":10},"9":{"armsName":"长弓手","weaponType":[5],"power":5,"agile":8}}
|
||||
{"1":{"armsName":"剑客","weaponType":[1],"power":8,"agile":2},"5":{"armsName":"刺客","weaponType":[10,11,12],"power":5,"agile":10},"9":{"armsName":"长弓手","weaponType":[5],"power":5,"agile":8}}
|
||||
@@ -1 +1 @@
|
||||
{"2":{"needexp":10,"hp":6},"3":{"needexp":30,"hp":6},"4":{"needexp":70,"hp":7},"5":{"needexp":110,"hp":7},"6":{"needexp":170,"hp":8},"7":{"needexp":240,"hp":8},"8":{"needexp":320,"hp":9},"9":{"needexp":420,"hp":9},"10":{"needexp":520,"hp":10},"11":{"needexp":640,"hp":10},"12":{"needexp":770,"hp":11},"13":{"needexp":920,"hp":11},"14":{"needexp":1080,"hp":12},"15":{"needexp":1250,"hp":13},"16":{"needexp":1440,"hp":14},"17":{"needexp":1640,"hp":15},"18":{"needexp":1860,"hp":16},"19":{"needexp":2090,"hp":17},"20":{"needexp":2330,"hp":18},"21":{"needexp":2590,"hp":19},"22":{"needexp":2870,"hp":20},"23":{"needexp":3150,"hp":21},"24":{"needexp":3460,"hp":22},"25":{"needexp":3770,"hp":23},"26":{"needexp":4110,"hp":24},"27":{"needexp":4450,"hp":25},"28":{"needexp":4820,"hp":26},"29":{"needexp":5190,"hp":27},"30":{"needexp":5590,"hp":28},"31":{"needexp":5990,"hp":29},"32":{"needexp":6420,"hp":31},"33":{"needexp":6860,"hp":32},"34":{"needexp":7310,"hp":34},"35":{"needexp":7780,"hp":35},"36":{"needexp":8270,"hp":37},"37":{"needexp":8770,"hp":38},"38":{"needexp":9290,"hp":40},"39":{"needexp":9820,"hp":41},"40":{"needexp":10370,"hp":43},"41":{"needexp":10940,"hp":44},"42":{"needexp":11520,"hp":46},"43":{"needexp":12120,"hp":47},"44":{"needexp":12730,"hp":49},"45":{"needexp":13360,"hp":50},"46":{"needexp":14010,"hp":52},"47":{"needexp":14670,"hp":53},"48":{"needexp":15350,"hp":55},"49":{"needexp":16050,"hp":56},"50":{"needexp":16760,"hp":58},"51":{"needexp":17490,"hp":59},"52":{"needexp":18240,"hp":61},"53":{"needexp":19000,"hp":63},"54":{"needexp":19780,"hp":64},"55":{"needexp":20580,"hp":66},"56":{"needexp":21390,"hp":68},"57":{"needexp":22220,"hp":69},"58":{"needexp":23070,"hp":71},"59":{"needexp":23930,"hp":73},"60":{"needexp":24810,"hp":74},"61":{"needexp":25710,"hp":76},"62":{"needexp":26620,"hp":78},"63":{"needexp":27560,"hp":79},"64":{"needexp":28500,"hp":81},"65":{"needexp":29470,"hp":83},"66":{"needexp":30450,"hp":84},"67":{"needexp":31460,"hp":86},"68":{"needexp":32470,"hp":88},"69":{"needexp":33510,"hp":90},"70":{"needexp":34560,"hp":92},"71":{"needexp":35630,"hp":94},"72":{"needexp":36720,"hp":96},"73":{"needexp":37830,"hp":98},"74":{"needexp":38950,"hp":100},"75":{"needexp":40090,"hp":102},"76":{"needexp":41250,"hp":104},"77":{"needexp":42420,"hp":106},"78":{"needexp":43620,"hp":108},"79":{"needexp":44830,"hp":110},"80":{"needexp":46060,"hp":112},"81":{"needexp":47300,"hp":114},"82":{"needexp":48570,"hp":116},"83":{"needexp":49850,"hp":118},"84":{"needexp":51150,"hp":120},"85":{"needexp":52470,"hp":122},"86":{"needexp":53810,"hp":125},"87":{"needexp":55160,"hp":128},"88":{"needexp":56530,"hp":131},"89":{"needexp":57920,"hp":134},"90":{"needexp":59330,"hp":137},"91":{"needexp":60760,"hp":140},"92":{"needexp":62200,"hp":143},"93":{"needexp":63670,"hp":146},"94":{"needexp":65150,"hp":149},"95":{"needexp":66650,"hp":152},"96":{"needexp":68160,"hp":155},"97":{"needexp":69700,"hp":158},"98":{"needexp":71250,"hp":161},"99":{"needexp":72830,"hp":164},"100":{"needexp":74420,"hp":167}}
|
||||
{"1":{"needexp":0,"hp":5},"2":{"needexp":10,"hp":6},"3":{"needexp":30,"hp":6},"4":{"needexp":70,"hp":7},"5":{"needexp":110,"hp":7},"6":{"needexp":170,"hp":8},"7":{"needexp":240,"hp":8},"8":{"needexp":320,"hp":9},"9":{"needexp":420,"hp":9},"10":{"needexp":520,"hp":10},"11":{"needexp":640,"hp":10},"12":{"needexp":770,"hp":11},"13":{"needexp":920,"hp":11},"14":{"needexp":1080,"hp":12},"15":{"needexp":1250,"hp":13},"16":{"needexp":1440,"hp":14},"17":{"needexp":1640,"hp":15},"18":{"needexp":1860,"hp":16},"19":{"needexp":2090,"hp":17},"20":{"needexp":2330,"hp":18},"21":{"needexp":2590,"hp":19},"22":{"needexp":2870,"hp":20},"23":{"needexp":3150,"hp":21},"24":{"needexp":3460,"hp":22},"25":{"needexp":3770,"hp":23},"26":{"needexp":4110,"hp":24},"27":{"needexp":4450,"hp":25},"28":{"needexp":4820,"hp":26},"29":{"needexp":5190,"hp":27},"30":{"needexp":5590,"hp":28},"31":{"needexp":5990,"hp":29},"32":{"needexp":6420,"hp":31},"33":{"needexp":6860,"hp":32},"34":{"needexp":7310,"hp":34},"35":{"needexp":7780,"hp":35},"36":{"needexp":8270,"hp":37},"37":{"needexp":8770,"hp":38},"38":{"needexp":9290,"hp":40},"39":{"needexp":9820,"hp":41},"40":{"needexp":10370,"hp":43},"41":{"needexp":10940,"hp":44},"42":{"needexp":11520,"hp":46},"43":{"needexp":12120,"hp":47},"44":{"needexp":12730,"hp":49},"45":{"needexp":13360,"hp":50},"46":{"needexp":14010,"hp":52},"47":{"needexp":14670,"hp":53},"48":{"needexp":15350,"hp":55},"49":{"needexp":16050,"hp":56},"50":{"needexp":16760,"hp":58},"51":{"needexp":17490,"hp":59},"52":{"needexp":18240,"hp":61},"53":{"needexp":19000,"hp":63},"54":{"needexp":19780,"hp":64},"55":{"needexp":20580,"hp":66},"56":{"needexp":21390,"hp":68},"57":{"needexp":22220,"hp":69},"58":{"needexp":23070,"hp":71},"59":{"needexp":23930,"hp":73},"60":{"needexp":24810,"hp":74},"61":{"needexp":25710,"hp":76},"62":{"needexp":26620,"hp":78},"63":{"needexp":27560,"hp":79},"64":{"needexp":28500,"hp":81},"65":{"needexp":29470,"hp":83},"66":{"needexp":30450,"hp":84},"67":{"needexp":31460,"hp":86},"68":{"needexp":32470,"hp":88},"69":{"needexp":33510,"hp":90},"70":{"needexp":34560,"hp":92},"71":{"needexp":35630,"hp":94},"72":{"needexp":36720,"hp":96},"73":{"needexp":37830,"hp":98},"74":{"needexp":38950,"hp":100},"75":{"needexp":40090,"hp":102},"76":{"needexp":41250,"hp":104},"77":{"needexp":42420,"hp":106},"78":{"needexp":43620,"hp":108},"79":{"needexp":44830,"hp":110},"80":{"needexp":46060,"hp":112},"81":{"needexp":47300,"hp":114},"82":{"needexp":48570,"hp":116},"83":{"needexp":49850,"hp":118},"84":{"needexp":51150,"hp":120},"85":{"needexp":52470,"hp":122},"86":{"needexp":53810,"hp":125},"87":{"needexp":55160,"hp":128},"88":{"needexp":56530,"hp":131},"89":{"needexp":57920,"hp":134},"90":{"needexp":59330,"hp":137},"91":{"needexp":60760,"hp":140},"92":{"needexp":62200,"hp":143},"93":{"needexp":63670,"hp":146},"94":{"needexp":65150,"hp":149},"95":{"needexp":66650,"hp":152},"96":{"needexp":68160,"hp":155},"97":{"needexp":69700,"hp":158},"98":{"needexp":71250,"hp":161},"99":{"needexp":72830,"hp":164},"100":{"needexp":74420,"hp":167}}
|
||||
@@ -6,13 +6,13 @@ export class TablePromptWindow {
|
||||
|
||||
private data: any;
|
||||
|
||||
init(id: number, id_double: number) {
|
||||
init(id: number, id1: number, id2: number) {
|
||||
var table = JsonUtil.get(TablePromptWindow.TableName);
|
||||
this.data = table[id][id_double];
|
||||
this.id = id;
|
||||
this.data = table[id][id1][id2];
|
||||
this.id = id;
|
||||
this.id1 = id1;
|
||||
this.id2 = id2;
|
||||
|
||||
}
|
||||
|
||||
id: number = 0;
|
||||
id1: number = 0;
|
||||
|
||||
@@ -77,27 +77,28 @@ async function convert(src, dst, name, isClient) {
|
||||
}
|
||||
});
|
||||
// 生成数据(多主键)
|
||||
if (rowNumber > 6) {
|
||||
if (rowNumber > 5) {
|
||||
let temp = null;
|
||||
for (var i = 0; i < primary.length; i++) {
|
||||
let k = primary[i];
|
||||
let id = data[k];
|
||||
delete data[k]; // 主键数据删除
|
||||
if (temp == null) {
|
||||
if (i == primary.length - 1) {
|
||||
r[id] = data;
|
||||
}
|
||||
else {
|
||||
r[id] = {};
|
||||
temp = r[id];
|
||||
}
|
||||
if (primary.length == 1) {
|
||||
r[id] = data;
|
||||
}
|
||||
else {
|
||||
if (i == primary.length - 1) {
|
||||
temp[id] = data;
|
||||
}
|
||||
else if (i == 0) {
|
||||
if (r[id] == undefined) {
|
||||
r[id] = {};
|
||||
}
|
||||
temp = r[id];
|
||||
}
|
||||
else {
|
||||
temp[id] = {};
|
||||
temp = temp[id];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -54,7 +54,6 @@ async function convert(src: string, dst: string, name: string, isClient: boolean
|
||||
let isWrite = isClient && client === "client" || isClient == false && server === "server";
|
||||
if (isWrite) {
|
||||
let key = keys[index];
|
||||
|
||||
switch (type) {
|
||||
case "int":
|
||||
data[key] = parseInt(value);
|
||||
@@ -78,28 +77,29 @@ async function convert(src: string, dst: string, name: string, isClient: boolean
|
||||
});
|
||||
|
||||
// 生成数据(多主键)
|
||||
if (rowNumber > 6) {
|
||||
if (rowNumber > 5) {
|
||||
let temp: any = null;
|
||||
for (var i = 0; i < primary.length; i++) {
|
||||
let k = primary[i];
|
||||
let id = data[k];
|
||||
delete data[k]; // 主键数据删除
|
||||
|
||||
if (temp == null) {
|
||||
if (i == primary.length - 1) {
|
||||
r[id] = data;
|
||||
}
|
||||
else {
|
||||
r[id] = {};
|
||||
temp = r[id];
|
||||
}
|
||||
if (primary.length == 1) {
|
||||
r[id] = data;
|
||||
}
|
||||
else {
|
||||
if (i == primary.length - 1) {
|
||||
temp[id] = data;
|
||||
}
|
||||
else if (i == 0) {
|
||||
if (r[id] == undefined) {
|
||||
r[id] = {};
|
||||
}
|
||||
temp = r[id];
|
||||
}
|
||||
else {
|
||||
temp[id] = {};
|
||||
temp = temp[id];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -111,7 +111,6 @@ async function convert(src: string, dst: string, name: string, isClient: boolean
|
||||
await fs.writeFileSync(dst, JSON.stringify(r));
|
||||
|
||||
// 生成客户端脚本
|
||||
|
||||
if (isClient) createTs(name, types_client, r, primary);
|
||||
console.log(isClient ? "客户端数据" : "服务器数据", "生成成功", dst);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user