Skip to content

Commit

Permalink
0.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
zyr17 committed May 6, 2019
1 parent 0d286bf commit 3664a63
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 5 deletions.
6 changes: 5 additions & 1 deletion doc/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,8 @@ config.json常用设置
例 略

5. 如果有多个条件,请分别填上
例 "room": [3, 4],"round": [8],"timeafter": "2019-02-02 00:00:00" 分析在19年2月2日以后打的金场南风及玉场南风
例 "room": [3, 4],"round": [8],"timeafter": "2019-02-02 00:00:00" 分析在19年2月2日以后打的金场南风及玉场南风

6. 更多配置请参考https://github.com/zyr17/MajsoulPaipuAnalyzer/blob/master/doc/config.md

7. 若在文件中添加了中文(如name中使用了中文字符串),请确保文件以UTF-8编码保存。例如对于Windows记事本需要另存为并在下方编码选择UTF-8。
2 changes: 2 additions & 0 deletions doc/release-notes.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
0.2.4
1.PaipuAnalyzer运行速度优化
2.支持UTF-8 with BOM的json数据
3.增强错误收集功能

0.2.3
1.重构analyzer.cpp代码
Expand Down
36 changes: 32 additions & 4 deletions lib/majsoul/analyze.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,27 @@ function getstring(arr, start, length){

function analyzelogin(sender, arr, start){
if (arr[start] != 0x12){
console.error('in analyzelogin: not start with 0x12');
reporterror({
position: 'analyzelogin',
message: 'in analyzelogin: not start with 0x12',
data: {
arr: arr.slice(0, arr.length - 36),//为安全考虑,不上传最后36字节的access_token
start
}
});
return;
}
let length;
[length, start] = getnumber(arr, start + 1);
if (arr[start] != 0x10){
console.error('in analyzelogin: not start with 0x10');
reporterror({
position: 'analyzelogin',
message: 'in analyzelogin: not start with 0x10',
data: {
arr: arr.slice(0, arr.length - 36),//为安全考虑,不上传最后36字节的access_token
start
}
});
return;
}
[length, start] = getnumber(arr, start + 1);
Expand All @@ -116,7 +130,14 @@ function analyzelogin(sender, arr, start){

function analyzepaipu(arr, start){
if (arr[start] != 0x12){
console.error('in analyzepaipu: not start with 0x12');
reporterror({
position: 'analyzepaipu',
message: 'in analyzepaipu: not start with 0x12',
data: {
arr,
start
}
});
return;
}
let length;
Expand Down Expand Up @@ -492,7 +513,14 @@ function analyze(sender, data){
let number = arr8[1] + arr8[2] * 256;
let req = clientrequest[number];
if (req == undefined){
console.error('request not find');
reporterror({
position: 'analyze',
message: 'request not find',
data: {
servernumber: number,
clientrequest
}
});
return;
}
if (req == '.lq.Lobby.oauth2Login'){
Expand Down
2 changes: 2 additions & 0 deletions src/algo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ CJsonObject ReadJSON(const std::string &filename){
}
delete[] buffer;
fclose(f);
if ((unsigned char)jsonstr[0] == 0xef && (unsigned char)jsonstr[1] == 0xbb && (unsigned char)jsonstr[2] == 0xbf) jsonstr.erase(0, 3);
return CJsonObject(jsonstr);
}

Expand All @@ -355,6 +356,7 @@ std::vector<CJsonObject> ReadLineJSON(const std::string &filename, const std::st
if (fgets(buf, JSONBUFFERSIZE, f) == NULL) break;
ts += buf;
ts += suffix;
if ((unsigned char)ts[0] == 0xef && (unsigned char)ts[1] == 0xbb && (unsigned char)ts[2] == 0xbf) ts.erase(0, 3);
res.push_back(CJsonObject(ts));
}
fclose(f);
Expand Down

0 comments on commit 3664a63

Please sign in to comment.