feat: add launcher protocol data archive

- Add protocol data for multiple locales and versions
- Implement protocol archiving in archive command
- Update Api types and default settings for protocol support
This commit is contained in:
daydreamer-json
2026-03-12 16:14:29 +09:00
parent 6d0f2e3894
commit b1ed9573e5
62 changed files with 1045 additions and 1 deletions

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:47.298+09:00",
"req": {
"appCode": "abYeZZ16BPluCFyT",
"channel": 1,
"subChannel": 1,
"language": "zh-cn",
"dataVersion": ""
},
"rsp": {
"dataVersion": "074e3f15049ad3f96097a5646de96bb1",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "abYeZZ16BPluCFyT",
"channel": 1,
"subChannel": 1,
"language": "zh-cn",
"dataVersion": ""
},
"rsp": {
"dataVersion": "074e3f15049ad3f96097a5646de96bb1",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:46.887+09:00",
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "de-de",
"dataVersion": ""
},
"rsp": {
"dataVersion": "b5d78c1deffd554759e917aefbfdc6b3",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "de-de",
"dataVersion": ""
},
"rsp": {
"dataVersion": "b5d78c1deffd554759e917aefbfdc6b3",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:46.931+09:00",
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "en-us",
"dataVersion": ""
},
"rsp": {
"dataVersion": "82353569b33f3de83e37ea991f76a5bb",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "en-us",
"dataVersion": ""
},
"rsp": {
"dataVersion": "82353569b33f3de83e37ea991f76a5bb",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:46.887+09:00",
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "es-mx",
"dataVersion": ""
},
"rsp": {
"dataVersion": "b1392599f1f637d750079fd32e676ebb",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "es-mx",
"dataVersion": ""
},
"rsp": {
"dataVersion": "b1392599f1f637d750079fd32e676ebb",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:46.931+09:00",
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "fr-fr",
"dataVersion": ""
},
"rsp": {
"dataVersion": "4f5d9892059d0af72cc0025386145904",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "fr-fr",
"dataVersion": ""
},
"rsp": {
"dataVersion": "4f5d9892059d0af72cc0025386145904",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:47.014+09:00",
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "id-id",
"dataVersion": ""
},
"rsp": {
"dataVersion": "f2b9bd948cd9653c32200804d05147d3",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "id-id",
"dataVersion": ""
},
"rsp": {
"dataVersion": "f2b9bd948cd9653c32200804d05147d3",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:46.938+09:00",
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "it-it",
"dataVersion": ""
},
"rsp": {
"dataVersion": "d0e438955209c88365655534f88dcf22",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "it-it",
"dataVersion": ""
},
"rsp": {
"dataVersion": "d0e438955209c88365655534f88dcf22",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:46.883+09:00",
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "ja-jp",
"dataVersion": ""
},
"rsp": {
"dataVersion": "e7ac89e5b9d1cd0eb8d45e4d490b1119",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "ja-jp",
"dataVersion": ""
},
"rsp": {
"dataVersion": "e7ac89e5b9d1cd0eb8d45e4d490b1119",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:46.931+09:00",
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "ko-kr",
"dataVersion": ""
},
"rsp": {
"dataVersion": "da1955145f6c0cb830ef8340e8cc13b2",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "ko-kr",
"dataVersion": ""
},
"rsp": {
"dataVersion": "da1955145f6c0cb830ef8340e8cc13b2",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:46.945+09:00",
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "pt-br",
"dataVersion": ""
},
"rsp": {
"dataVersion": "df13ecb5ef2bb6007a3cd6adc44b8fb0",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "pt-br",
"dataVersion": ""
},
"rsp": {
"dataVersion": "df13ecb5ef2bb6007a3cd6adc44b8fb0",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:46.887+09:00",
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "ru-ru",
"dataVersion": ""
},
"rsp": {
"dataVersion": "55e1c89ea25657a11d1ceb719c9a5127",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "ru-ru",
"dataVersion": ""
},
"rsp": {
"dataVersion": "55e1c89ea25657a11d1ceb719c9a5127",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:46.938+09:00",
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "th-th",
"dataVersion": ""
},
"rsp": {
"dataVersion": "2f20de6a0609f43b8f1adb72fe984d33",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "th-th",
"dataVersion": ""
},
"rsp": {
"dataVersion": "2f20de6a0609f43b8f1adb72fe984d33",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:46.931+09:00",
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "vi-vn",
"dataVersion": ""
},
"rsp": {
"dataVersion": "3f6367ca745bef75bdfe7540f6bdd445",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "vi-vn",
"dataVersion": ""
},
"rsp": {
"dataVersion": "3f6367ca745bef75bdfe7540f6bdd445",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:46.920+09:00",
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "zh-cn",
"dataVersion": ""
},
"rsp": {
"dataVersion": "e6288bd6c1a9fe88e49be63a355795f8",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "zh-cn",
"dataVersion": ""
},
"rsp": {
"dataVersion": "e6288bd6c1a9fe88e49be63a355795f8",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:46.841+09:00",
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "zh-tw",
"dataVersion": ""
},
"rsp": {
"dataVersion": "1e065d3e8fe1783abbf79767b049baf6",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "TiaytKBUIEdoEwRT",
"channel": 6,
"subChannel": 6,
"language": "zh-tw",
"dataVersion": ""
},
"rsp": {
"dataVersion": "1e065d3e8fe1783abbf79767b049baf6",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:47.019+09:00",
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "de-de",
"dataVersion": ""
},
"rsp": {
"dataVersion": "8b192655651dcce02bad429a97ff2c4c",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "de-de",
"dataVersion": ""
},
"rsp": {
"dataVersion": "8b192655651dcce02bad429a97ff2c4c",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:46.887+09:00",
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "en-us",
"dataVersion": ""
},
"rsp": {
"dataVersion": "ec7901a25d380524306ad1ec84689ada",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "en-us",
"dataVersion": ""
},
"rsp": {
"dataVersion": "ec7901a25d380524306ad1ec84689ada",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:46.995+09:00",
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "es-mx",
"dataVersion": ""
},
"rsp": {
"dataVersion": "fa715055fe7b883cd10aa31d9239ad36",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "es-mx",
"dataVersion": ""
},
"rsp": {
"dataVersion": "fa715055fe7b883cd10aa31d9239ad36",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:46.999+09:00",
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "fr-fr",
"dataVersion": ""
},
"rsp": {
"dataVersion": "c9bdbfcc58422e96f3831ba2ffd76211",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "fr-fr",
"dataVersion": ""
},
"rsp": {
"dataVersion": "c9bdbfcc58422e96f3831ba2ffd76211",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:47.037+09:00",
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "id-id",
"dataVersion": ""
},
"rsp": {
"dataVersion": "945fa633d8b542ef8b39ab920bc196c0",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "id-id",
"dataVersion": ""
},
"rsp": {
"dataVersion": "945fa633d8b542ef8b39ab920bc196c0",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:47.036+09:00",
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "it-it",
"dataVersion": ""
},
"rsp": {
"dataVersion": "9ff22d753e85e6046a80c2b4f96ef5ee",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "it-it",
"dataVersion": ""
},
"rsp": {
"dataVersion": "9ff22d753e85e6046a80c2b4f96ef5ee",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:47.057+09:00",
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "ja-jp",
"dataVersion": ""
},
"rsp": {
"dataVersion": "3eebf96cb9cf96ec376d9bf75466a4bb",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "ja-jp",
"dataVersion": ""
},
"rsp": {
"dataVersion": "3eebf96cb9cf96ec376d9bf75466a4bb",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:47.048+09:00",
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "ko-kr",
"dataVersion": ""
},
"rsp": {
"dataVersion": "c7580e0afc9412efbb5cc286d0335263",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "ko-kr",
"dataVersion": ""
},
"rsp": {
"dataVersion": "c7580e0afc9412efbb5cc286d0335263",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:47.052+09:00",
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "pt-br",
"dataVersion": ""
},
"rsp": {
"dataVersion": "674d3a73cfce7aeca732e6aebac4b1a2",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "pt-br",
"dataVersion": ""
},
"rsp": {
"dataVersion": "674d3a73cfce7aeca732e6aebac4b1a2",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:47.070+09:00",
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "ru-ru",
"dataVersion": ""
},
"rsp": {
"dataVersion": "b3e574088687374dc0c57573888b75ab",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "ru-ru",
"dataVersion": ""
},
"rsp": {
"dataVersion": "b3e574088687374dc0c57573888b75ab",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:47.071+09:00",
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "th-th",
"dataVersion": ""
},
"rsp": {
"dataVersion": "96df92b11d256df956fa5442f75699e7",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "th-th",
"dataVersion": ""
},
"rsp": {
"dataVersion": "96df92b11d256df956fa5442f75699e7",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:47.070+09:00",
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "vi-vn",
"dataVersion": ""
},
"rsp": {
"dataVersion": "74681b13c58e4212fc933e323555413a",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "vi-vn",
"dataVersion": ""
},
"rsp": {
"dataVersion": "74681b13c58e4212fc933e323555413a",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:47.071+09:00",
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "zh-cn",
"dataVersion": ""
},
"rsp": {
"dataVersion": "12a3277b58c03ede203a8ed08481da1a",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "zh-cn",
"dataVersion": ""
},
"rsp": {
"dataVersion": "12a3277b58c03ede203a8ed08481da1a",
"protocol": {
"version": "0"
}
}
}

View File

@@ -0,0 +1,18 @@
[
{
"updatedAt": "2026-03-12T15:26:47.238+09:00",
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "zh-tw",
"dataVersion": ""
},
"rsp": {
"dataVersion": "ac927d4fa96aa584fa34a3957f338ca8",
"protocol": {
"version": "0"
}
}
}
]

View File

@@ -0,0 +1,15 @@
{
"req": {
"appCode": "BBWoqCzuZ2bZ1Dro",
"channel": 6,
"subChannel": 801,
"language": "zh-tw",
"dataVersion": ""
},
"rsp": {
"dataVersion": "ac927d4fa96aa584fa34a3957f338ca8",
"protocol": {
"version": "0"
}
}
}

View File

@@ -531,6 +531,7 @@ async function fetchAndSaveLatestLauncher(launcherTargets: LauncherTarget[]) {
async function fetchAndSaveLatestWebApis(gameTargets: GameTarget[]) {
logger.debug('Fetching latestWebApis ...');
const langs = apiUtils.akEndfield.defaultSettings.launcherWebLang;
const langsCN = apiUtils.akEndfield.defaultSettings.launcherWebLangCN;
const apis = [
{ name: 'sidebar', method: apiUtils.akEndfield.launcherWeb.sidebar, dir: 'sidebar' },
{ name: 'singleEnt', method: apiUtils.akEndfield.launcherWeb.singleEnt, dir: 'single_ent' },
@@ -540,7 +541,7 @@ async function fetchAndSaveLatestWebApis(gameTargets: GameTarget[]) {
] as const;
for (const target of gameTargets) {
for (const lang of langs) {
for (const lang of target.region === 'cn' ? langsCN : langs) {
for (const api of apis) {
networkQueue.add(async () => {
const rsp = await api.method(target.appCode, target.channel, target.subChannel, lang, target.region);
@@ -569,6 +570,50 @@ async function fetchAndSaveLatestWebApis(gameTargets: GameTarget[]) {
await networkQueue.onIdle();
}
async function fetchAndSaveLauncherProtocol(gameTargets: GameTarget[]) {
logger.debug('Fetching launcherProtocol ...');
const langs = apiUtils.akEndfield.defaultSettings.launcherWebLang;
const langsCN = apiUtils.akEndfield.defaultSettings.launcherWebLangCN;
const filterChannel = [
appConfig.network.api.akEndfield.subChannel.cnWinRel,
appConfig.network.api.akEndfield.subChannel.osWinRel,
appConfig.network.api.akEndfield.subChannel.osWinRelEpic,
];
for (const target of gameTargets.filter((e) => filterChannel.includes(e.launcherSubChannel))) {
for (const lang of target.region === 'cn' ? langsCN : langs) {
networkQueue.add(async () => {
const rsp = await apiUtils.akEndfield.launcher.protocol(
target.launcherAppCode,
target.channel,
target.subChannel,
lang,
target.region,
'',
);
if (!rsp) return;
logger.trace(`Found protocol: ${rsp.dataVersion}, ${target.region.toUpperCase()}, ${target.name}, ${lang}`);
const prettyRsp = {
req: {
appCode: target.launcherAppCode,
channel: target.channel,
subChannel: target.subChannel,
language: lang,
dataVersion: '',
},
rsp,
};
await saveResultWithHistory(
['akEndfield', 'launcher', 'protocol', String(target.subChannel), lang],
null,
prettyRsp,
{ ignoreRules: diffIgnoreRules },
);
});
}
}
await networkQueue.onIdle();
}
async function mainCmdHandler() {
const cfg = appConfig.network.api.akEndfield;
const gameTargets: GameTarget[] = [
@@ -638,6 +683,7 @@ async function mainCmdHandler() {
await fetchAndSaveLatestGamePatches(gameTargets);
await fetchAndSaveLatestGameResources(gameTargets);
await fetchAndSaveLatestWebApis(gameTargets);
await fetchAndSaveLauncherProtocol(gameTargets);
await fetchAndSaveLatestLauncher(launcherTargets);
await fetchAndSaveAllGameResRawData(gameTargets);

View File

@@ -1,3 +1,9 @@
type LauncherProtocol = {
dataVersion: string;
protocol: {
version: string;
};
};
type LauncherLatestGame = {
action: number;
version: string; // x.y.z
@@ -549,6 +555,7 @@ type GameHubGiftCodeRedeem = {
};
export type {
LauncherProtocol,
LauncherLatestGame,
LauncherLatestGameResources,
LauncherLatestLauncher,

View File

@@ -24,4 +24,5 @@ export default {
'zh-cn',
'zh-tw',
] as const,
launcherWebLangCN: ['zh-cn'] as const,
};

View File

@@ -7,6 +7,39 @@ import defaultSettings from './defaultSettings.js';
import launcherWeb from './launcherWeb.js';
export default {
protocol: async (
appCode: string,
channel: number,
subChannel: number,
language: (typeof defaultSettings.launcherWebLang)[number],
region: 'os' | 'cn',
dataVersion: string = '',
): Promise<TypesApiAkEndfield.LauncherProtocol> => {
const apiBase =
region === 'cn'
? appConfig.network.api.akEndfield.base.launcherCN
: appConfig.network.api.akEndfield.base.launcher;
const rsp = await ky
.post(`https://${apiBase}/proxy/batch_proxy`, {
...defaultSettings.ky,
json: {
proxy_reqs: [
{
kind: 'get_protocol',
get_protocol_req: {
appcode: appCode,
channel: String(channel),
sub_channel: String(subChannel),
language,
dataVersion,
},
},
],
},
})
.json();
return (rsp as any).proxy_rsps[0].get_protocol as TypesApiAkEndfield.LauncherProtocol;
},
latestGame: async (
appCode: string,
launcherAppCode: string,