Skip to content

Commit

Permalink
新的格式已经出现
Browse files Browse the repository at this point in the history
  • Loading branch information
zyr17 committed Apr 22, 2019
1 parent be4a140 commit d737425
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 20 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ Ubuntu高版本中可能会出现GUI将可执行文件当做动态链接库的

由于设计时从未参加过比赛场,发现问题后开了个比赛场测试并发现比赛场数据和想象中有较大出入,目前会直接忽略比赛场牌谱数据,在以后做了相关实现后加入。

出现部分牌谱的和牌数据采用新格式,出现原因和时机不明。目前先忽略这些牌谱。

由于本人较菜没有上圣没法打王座,相关牌谱可能会出现bug。

## 联系
Expand Down
48 changes: 30 additions & 18 deletions SimpleMahjong/paipu.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,22 +528,29 @@ class majsoulpaipuanalyze{
}
else if (arr[start] == 0x62){
//番种
////TODO: 出现牌谱使用编号代替役名。找到役和编号对应列表。
let len6, len, name;
[len6, start] = this.getnumber(arr, start + 1);
[len, start] = this.getnumber(arr, start + 1);
[name, start] = this.decodeUTF8(arr, start, len);
let han = arr[start + 1];
if (
name == '四暗刻单骑' ||
name == '国士无双十三面' ||
name == '大四喜' ||
name == '纯正九莲宝灯'
)
han = 2;
if (yakumanyaku)
han *= 13;
agarires.han.push([name, han]);
start += 2;
if (arr[start] == 0x0a){
[len, start] = this.getnumber(arr, start + 1);
[name, start] = this.decodeUTF8(arr, start, len);
let han = arr[start + 1];
if (
name == '四暗刻单骑' ||
name == '国士无双十三面' ||
name == '大四喜' ||
name == '纯正九莲宝灯'
)
han = 2;
if (yakumanyaku)
han *= 13;
agarires.han.push([name, han]);
start += 2;
}
else{
start += len6;
this.rawdata = undefined;
}
}
else if (arr[start] == 0x68){
//符
Expand Down Expand Up @@ -863,20 +870,25 @@ class majsoulpaipuanalyze{
arr.push(data[i]);
//console.log(arr, this.nowgamedata, this.gamedatas[this.nowgamedata].extra.id, this.gamedatas[this.nowgamedata]);
let d = new Date();
d.setTime(this.gamedatas[this.nowgamedata].endtime * 1000);
if (this.paipus != undefined) d.setTime(this.gamedatas[this.nowgamedata].endtime * 1000);
if (arr.length > 99){
//太短是因为牌谱未被归档导致返回错误信息
this.paipuanalyze(arr);
this.onepaipu.record = JSON.parse(JSON.stringify(View.gamerecord));
this.paipus.push(JSON.parse(JSON.stringify(this.onepaipu)));
if (this.paipus != undefined){
this.onepaipu.record = JSON.parse(JSON.stringify(View.gamerecord));
this.paipus.push(JSON.parse(JSON.stringify(this.onepaipu)));
}
console.log('paipu #' + this.nowgamedata + ' complete. ' + d.toString());
if (this.rawdata == undefined){
console.log("but it's new type paipu, skip it for now.");
}
}
else{
this.rawdata = undefined;
console.log('paipu #' + this.nowgamedata + ' download failed. ' + d.toString());
}
this.nowgamedata ++ ;
this.converttoonepaipu();
if (this.paipus != undefined) this.converttoonepaipu();
}
reader.onload = rloadfunc.bind(this);
}
Expand Down
2 changes: 1 addition & 1 deletion appveyor-linux.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 0.1.4.{build}
version: 0.1.5.{build}
image: Ubuntu1804
branches:
only:
Expand Down
2 changes: 1 addition & 1 deletion appveyor-win.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 0.1.4.{build}
version: 0.1.5.{build}
branches:
only:
- master
Expand Down

0 comments on commit d737425

Please sign in to comment.