fortnite-replay-analysis 1.1.1 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +20 -0
- package/README.md +20 -0
- package/index.js +1 -1
- package/package.json +2 -1
package/README.ja.md
CHANGED
|
@@ -108,6 +108,26 @@ const {
|
|
|
108
108
|
* 複数マッチ分のスコア配列をパーティ単位でマージします。
|
|
109
109
|
* 引数: ソート済みスコア配列の配列(例: `[sorted1, sorted2, ...]`)
|
|
110
110
|
* 戻り値: マージ後のスコア配列
|
|
111
|
+
* `mergeScores` を使用する際は、各スコアデータに `matchName` プロパティを含めてください。これがないと、一部の処理で正しく動作しない可能性があります。
|
|
112
|
+
|
|
113
|
+
```javascript
|
|
114
|
+
function loadScores(matchNames) {
|
|
115
|
+
return matchNames.map(name => {
|
|
116
|
+
const raw = fs.readFileSync(
|
|
117
|
+
path.join(outputDir, name, `${name}.json`),
|
|
118
|
+
'utf8'
|
|
119
|
+
);
|
|
120
|
+
const arr = JSON.parse(raw);
|
|
121
|
+
return arr.map(p => ({ ...p, matchName: name })); // 各マッチデータに対してマッチ名を追加
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
(async () => {
|
|
126
|
+
const scores = loadScores(['match4','match5']);
|
|
127
|
+
let merged = mergeScores(scores);
|
|
128
|
+
merged = sortScores(merged);
|
|
129
|
+
})();
|
|
130
|
+
```
|
|
111
131
|
|
|
112
132
|
## 注意事項
|
|
113
133
|
|
package/README.md
CHANGED
|
@@ -100,6 +100,26 @@ Sorts scores according to official Fortnite rules:
|
|
|
100
100
|
* Merges multiple sorted score arrays by party.
|
|
101
101
|
* `scoreArrays`: Array of sorted score arrays (e.g., `[sorted1, sorted2, ...]`).
|
|
102
102
|
* Returns: Merged score array.
|
|
103
|
+
* ※When using `mergeScores`, ensure each entry includes a `matchName` property. Omitting this field may lead to unexpected behavior.
|
|
104
|
+
|
|
105
|
+
```javascript
|
|
106
|
+
function loadScores(matchNames) {
|
|
107
|
+
return matchNames.map(name => {
|
|
108
|
+
const raw = fs.readFileSync(
|
|
109
|
+
path.join(outputDir, name, `${name}.json`),
|
|
110
|
+
'utf8'
|
|
111
|
+
);
|
|
112
|
+
const arr = JSON.parse(raw);
|
|
113
|
+
return arr.map(p => ({ ...p, matchName: name })); // 各マッチデータに対してマッチ名を追加
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
(async () => {
|
|
118
|
+
const scores = loadScores(['match1','match2']);
|
|
119
|
+
let merged = mergeScores(scores);
|
|
120
|
+
merged = sortScores(merged);
|
|
121
|
+
})();
|
|
122
|
+
```
|
|
103
123
|
|
|
104
124
|
## Notes
|
|
105
125
|
|
package/index.js
CHANGED
|
@@ -40,7 +40,7 @@ function ReplayAnalysis(inputPath, { bot = false, sort = true } = {}) { // Fortn
|
|
|
40
40
|
}
|
|
41
41
|
const binPath = getBinaryPath();
|
|
42
42
|
|
|
43
|
-
execFile(binPath, [replayFilePath], (error, stdout, stderr) => {
|
|
43
|
+
execFile(binPath, [replayFilePath], { maxBuffer: 1024 * 1024 * 20 }, (error, stdout, stderr) => {
|
|
44
44
|
if (error) {
|
|
45
45
|
reject(new Error(`Execution error: ${error.message}`));
|
|
46
46
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fortnite-replay-analysis",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Fortnite replay analysis tool (Node.js用Fortniteリプレイ解析バイナリラッパー)",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"files": [
|
|
35
35
|
"index.js",
|
|
36
36
|
"README.md",
|
|
37
|
+
"README.ja.md",
|
|
37
38
|
"CSproj/bin/Release/net8.0/"
|
|
38
39
|
],
|
|
39
40
|
"dependencies": {
|