build(repo): make source comments and build tools self-contained
This commit is contained in:
1 parent
5b5c59ab08
commit
44190e4544
106 files changed
+152
-183
No files matched your search
@@ -8,6 +8,7 @@
|
||||
|
||||
| 目录 | 内容 |
|
||||
|---|---|
|
||||
| `apps/launcher/` | Electron 安装器与启动器 |
|
||||
| `apps/server/` | 本地服务器(TypeScript):模拟 Gaijin 的登录、档案、匹配、商店等服务器 |
|
||||
| `packages/` | 共用的 TypeScript 库(npm workspace):BLK 编解码(`blk`)、数据包读写(`vromfs`)、JSONC(`jsonc`)、exe 补丁引擎(`exepatch`)、构建游戏副本(`patcher`) |
|
||||
| `patches/exe/` | exe 补丁定义 |
|
||||
@@ -15,3 +16,31 @@
|
||||
| `native/` | 网络钩子与本地对局模块 `wto_ws.dll`(C) |
|
||||
| `scripts/` | 开发用的 TypeScript 脚本(如 `build-game-copy.ts` 构建游戏副本) |
|
||||
| `tools/` | Python 开发端工具:数据包读写、exe 补丁核对(特征码生成、汇编核对)、界面补丁编译检查 |
|
||||
|
||||
## 本地构建
|
||||
|
||||
在 Windows 上使用 Node.js 24 或更新版本,以及 Visual Studio 的 x64 C++ 构建工具。在仓库根目录安装依赖并生成本地库。
|
||||
|
||||
```powershell
|
||||
npm install
|
||||
powershell -NoProfile -File native\wto-net\build.ps1
|
||||
```
|
||||
|
||||
从已安装的游戏读取原版文件,将生成的文件写入独立副本。两个命令使用相同的数据目录和端口。
|
||||
|
||||
```powershell
|
||||
node scripts/build-game-copy.ts --game "<原版游戏目录>" --out "<离线副本目录>" --data "<数据目录>" --port 27015
|
||||
node apps/server/src/cli.ts --game "<离线副本目录>" --data "<数据目录>" --port 27015
|
||||
```
|
||||
|
||||
## 开发检查
|
||||
|
||||
使用 `npm run typecheck` 检查 TypeScript。启动器在 `apps/launcher/` 中运行 `npm run typecheck` 和 `npm run build`。
|
||||
|
||||
使用 Python 3.12 或更新版本安装本地工具 `python -m pip install -e ./tools`。以下命令读取目标版本的原版文件。界面检查的 `--sq` 指定 Quirrel 编译器路径。
|
||||
|
||||
```powershell
|
||||
wtotools check-patches --exe "<原版游戏目录>\win64\aces.exe"
|
||||
wtotools check-gui --gui "<原版游戏目录>\gui.vromfs.bin" --sq "<Quirrel 编译器路径>"
|
||||
wtotools check-offsets --exe "<原版游戏目录>\win64\aces.exe"
|
||||
```
|
||||
@@ -1,8 +1,7 @@
|
||||
import type { TFunction } from 'i18next';
|
||||
|
||||
/**
|
||||
* The player-facing name of a feature tag from a patch definition (a feature inventory row such
|
||||
* as "K-侦察"). Tags without a translation are shown as they are.
|
||||
* Resolves the display name of a patch feature tag. An untranslated tag serves as its own label.
|
||||
*/
|
||||
export function featureName(t: TFunction, tag: string): string {
|
||||
// Tags hold spaces and slashes but never the key separator, so they work as keys as they are.
|
||||
|
||||
@@ -5,7 +5,7 @@ import { missingFeatures } from '../copies/missing-features.ts';
|
||||
|
||||
/**
|
||||
* The bottom bar outside the wizard: install before the first installation, launch after it.
|
||||
* Launching (local verification) is not built yet, so the button stays disabled and the detail says so.
|
||||
* The launch action is disabled until the launcher can start a copy.
|
||||
*/
|
||||
export function homeBar(record: InstallRecord | null, t: TFunction, onInstall: () => void): BarModel {
|
||||
if (!record) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { TFunction } from 'i18next';
|
||||
import type { BackgroundPicture } from '@shared/schemas/background.ts';
|
||||
|
||||
/** "Website · ztz 96b" for a wallpaper, the nation for a picture of the game copy. */
|
||||
/** Uses the website label for wallpapers and the nation name for local game art. */
|
||||
export function backgroundLabel(t: TFunction, picture: BackgroundPicture): string {
|
||||
if (picture.source === 'official') return t('background.officialItem', { name: picture.label });
|
||||
return t(`background.nations.${picture.label}`, { defaultValue: picture.label });
|
||||
|
||||
@@ -53,7 +53,7 @@ export type UnavailablePatch = z.output<typeof UnavailablePatchSchema>;
|
||||
|
||||
/** A feature inventory row the patches cover, with the patches behind it. */
|
||||
export const PatchFeatureSchema = z.object({
|
||||
/** The feature tag, e.g. "K-侦察"; the letter before the dash is the inventory section. */
|
||||
/** Feature tag with a prefix identifying its feature group. */
|
||||
tag: z.string(),
|
||||
/** A copy cannot run, or cannot stay apart from the online game, without it. */
|
||||
essential: z.boolean(),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/** Resolving the player a char request is for (the uidhint header, implementation notes). */
|
||||
/** Resolving the player a char request is for (the uidhint header). */
|
||||
import type { Account, AccountStore } from '../../accounts/account-store.ts';
|
||||
import type { CharAnswer } from '../char-answers.ts';
|
||||
import type { CharActionContext } from '../char-action.ts';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/** Char action names mapped to their protocol handlers (full list of names: implementation notes). */
|
||||
/** Maps each supported char action to its protocol handler. */
|
||||
import type { AccountStore } from '../../accounts/account-store.ts';
|
||||
import type { ClanStore } from '../../clans/clan-store.ts';
|
||||
import type { CloudSettingsStore } from '../../cloud-settings/cloud-settings-store.ts';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Char action handlers for squadron officer moderation, blacklist, and best-rewards metadata
|
||||
* (`ano_clan_*`, `cln_set_clan_best_rewards`; implementation notes; aces.exe 0x29d150, 0x29d540).
|
||||
* (`ano_clan_*`, `cln_set_clan_best_rewards`; aces.exe 0x29d150, 0x29d540).
|
||||
*/
|
||||
import type { AccountStore } from '../../accounts/account-store.ts';
|
||||
import type { ClanStore } from '../../clans/clan-store.ts';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* Char actions for `online_storage` / `generalBlk` cloud settings sync (implementation notes;
|
||||
* aces.exe 2.61.0.37: `cln_get_meta_blk` 0x4662b3f, `cln_get_general_blk` 0x46677df,
|
||||
* Char actions for `online_storage` / `generalBlk` cloud settings sync (aces.exe 2.61.0.37: `cln_get_meta_blk` 0x4662b3f, `cln_get_general_blk` 0x46677df,
|
||||
* `cln_set_general_blk` 0x4666c51, `cln_bulk_set_gblk` 0x4663cfd).
|
||||
*/
|
||||
import { emptyBlock } from '@wto/blk';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* Char actions for external inventory, item recycling, and classic trophies
|
||||
*:
|
||||
* Char actions for external inventory, item recycling, and classic trophies:
|
||||
* - cln_consume_inventory_item itemId:i quantity:i -> full profile
|
||||
* - cln_multi_consume_inventory_item_json text BLK items{ item{ itemId:i quantity:i } } -> JSON {"revertedItems":[]}
|
||||
* - cln_inventory_purchase_item key:t itemDefId:i wpCost:i goldCost:i [amount:i] -> full profile
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* Char actions of the online initialisation after sign-in, up to the profile
|
||||
*.
|
||||
* Char actions of the online initialisation after sign-in, up to the profile.
|
||||
*/
|
||||
import { emptyBlock, setParam } from '@wto/blk';
|
||||
import type { AccountStore } from '../../accounts/account-store.ts';
|
||||
@@ -14,8 +13,7 @@ import { withAccount } from './account-context.ts';
|
||||
* cln_get_initial_meta: server-side metadata the client reads in GameSaveData's initial-meta
|
||||
* handling (aces.exe 0xeb5f60). binaryDataMetainfo lists server-side binary files the client
|
||||
* must fetch and compare by hash; the local server has none, so the list is empty and no
|
||||
* downloads follow. generalBlkMeta carries the cloud-settings schema and saved versions/hashes
|
||||
*.
|
||||
* downloads follow. generalBlkMeta carries the cloud-settings schema and saved versions/hashes.
|
||||
*/
|
||||
export function initialMeta(accounts?: AccountStore, cloudSettings?: CloudSettingsStore): CharActionHandler {
|
||||
return (context) => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* cln_get_price_ex: the price table (implementation notes; char/actions/price-table.ts).
|
||||
* cln_get_price_ex: the price table (char/actions/price-table.ts).
|
||||
* Sent at sign-in with an empty body and again by the stock scripts when a purchase fails
|
||||
* (scripts/unit/unitActions.nut impl_buyUnit: PRICE.update). The table only depends on the
|
||||
* game files and tuning, so it is built once.
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* The price table the char server sends for cln_get_price_ex (implementation notes,
|
||||
* implementation notes).
|
||||
* The price table the char server sends for cln_get_price_ex.
|
||||
*
|
||||
* The client keeps the answer whole as its price table (aces.exe 2.61.0.37 0xeb7a88, job type
|
||||
* 0x21; stored in the save-data object at +0x3f5c0, which warpoints::init makes the price
|
||||
@@ -27,7 +26,7 @@
|
||||
* skills{ <pack>{ costGold:i } } skill point packs (0x916380)
|
||||
* unlocks{ <unlock>{ cost:i costGold:i } } unlocks for sale (0x9170c0)
|
||||
* items{ <item>{ cost:i costGold:i } } classic items for sale, price per piece
|
||||
* (wp_get_item_cost, 0x10531e0; implementation notes)
|
||||
* (wp_get_item_cost, 0x10531e0)
|
||||
* trophy{ <id>{ cost:i costGold:i } } classic trophy prices
|
||||
* }
|
||||
* trophy{ <id>{ ... } } classic trophy definitions & drop weights
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* cln_set_researchable (shop_set_researchable_unit, aces.exe 2.61.0.37 0x17a3e80):
|
||||
* unit:t the vehicle to research
|
||||
* type:i its vehicle type number
|
||||
* or, for a modification (shop_set_researchable_unit_module, 0x17a3e00; implementation notes):
|
||||
* or, for a modification (shop_set_researchable_unit_module, 0x17a3e00):
|
||||
* unit:t the owned vehicle
|
||||
* mod:t the modification to research
|
||||
* cln_reset_researchable (shop_reset_researchable_unit, 0x17a3f00): the player closed the
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Actions that run one rule on the player's profile and answer the whole updated profile
|
||||
* (job types the client applies as profile updates, implementation notes). A refused
|
||||
* (job types the client applies as profile updates). A refused
|
||||
* rule changes nothing and answers "!ERROR:<refusal>".
|
||||
*/
|
||||
import type { BlkBlock } from '@wto/blk';
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
* Char action handlers for squadron (clan) vehicle research and Golden-Eagle buyout
|
||||
* (`cln_set_research_clan_unit`, `cln_flush_clan_exp_to_unit`, `cln_buy_not_researched_clans_unit`;
|
||||
* implementation notes).
|
||||
* (`cln_set_research_clan_unit`, `cln_flush_clan_exp_to_unit`, `cln_buy_not_researched_clans_unit`).
|
||||
*/
|
||||
import type { AccountStore } from '../../accounts/account-store.ts';
|
||||
import type { ClanStore } from '../../clans/clan-store.ts';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* The new player's first choice (implementation notes, step 6).
|
||||
* The new player's first choice (step 6).
|
||||
*
|
||||
* The stock "first choice" window (gui.vromfs.bin scripts/firstChoice/unitTypeChoiceHandler.nut,
|
||||
* clnSetStartingInfo) sends cln_set_starting_info with:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* The char service's answer shapes (implementation notes; aces.exe 2.61.0.37,
|
||||
* The char service's answer shapes (aces.exe 2.61.0.37,
|
||||
* CharServerClient::handleReqResult at 0x336d590):
|
||||
* - data: HTTP 200, a compression marker ('i') and a binary BLK (`loadBlkFromAnswer`, 0x336fd60);
|
||||
* - raw-blk: HTTP 200, a bare binary BLK with no compression marker, for `online_storage`
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
/**
|
||||
* Bodies exchanged with the char service.
|
||||
*
|
||||
* Answers carrying data are a compression marker followed by a binary BLK; the client loads
|
||||
* them with loadBlkFromAnswer (aces.exe 0x336fd60). We always send them uncompressed.
|
||||
*
|
||||
* What the client sends in request bodies is not established yet, so
|
||||
* decoding is attempted in the forms that are plausible (marked or bare binary BLK, form
|
||||
* text) and the traffic log records which form it was.
|
||||
* Encodes uncompressed binary BLK answers and decodes request bodies for the char service.
|
||||
* The traffic log records the detected body format and its readable representation.
|
||||
*/
|
||||
import { decodeBlk, encodeBlk, formatBlkText, type BlkBlock } from '@wto/blk';
|
||||
import { markUncompressed, unpackMarked } from './compression-marker.ts';
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* The client names the action in the request header "action" (request headers assembled at
|
||||
* aces.exe 0x336c590). Requests carry no "userid" header; the player is identified by
|
||||
* "uidhint", the user id from the sign-in answer (implementation notes; added by
|
||||
* "uidhint", the user id from the sign-in answer (added by
|
||||
* EconomicSerializeJob::doJob, 0x2968a5). The local server trusts uidhint as it is: there
|
||||
* is nothing to protect on a single-player machine.
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Protocol-layer wire codecs for `online_storage` (`cln_set_general_blk` and `PBBD` batch
|
||||
* streams on `cln_bulk_set_gblk`; implementation notes; aces.exe 0x4662a70..0x466b2ec,
|
||||
* streams on `cln_bulk_set_gblk`; aces.exe 0x4662a70..0x466b2ec,
|
||||
* 0x41537d0..0x4154020).
|
||||
*/
|
||||
import { createHash } from 'node:crypto';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* Squadron membership, candidate moderation, role changes, blacklist, and event-log helpers
|
||||
*.
|
||||
* Squadron membership, candidate moderation, role changes, blacklist, and event-log helpers.
|
||||
*/
|
||||
import type { ClanTuning } from './clan-tuning.ts';
|
||||
import type { Account } from '../accounts/account-store.ts';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* Read-only search and leaderboard queries over the local squadron directory
|
||||
*.
|
||||
* Read-only search and leaderboard queries over the local squadron directory.
|
||||
*/
|
||||
import type { ClanTuning } from './clan-tuning.ts';
|
||||
import { stripClanDecorators } from './clan-lifecycle.ts';
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
* The preset squadron directory written on first creation of `<data>/clans.json`
|
||||
* (implementation notes section I; implementation notes), and the activity periods a member
|
||||
* starts with. Both are tuning (tuning/clans.jsonc).
|
||||
* Seeds the squadron directory and new members' activity periods from tuning/clans.jsonc.
|
||||
* The directory is written when the server first creates `<data>/clans.json`.
|
||||
*/
|
||||
import type { ClanTuning, PresetClan, PresetMember } from './clan-tuning.ts';
|
||||
import type { ClanActivityPeriodEntry, ClanMemberRecord, ClanRecord } from './clan-types.ts';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Persistent local squadron (clan) directory & state store (`<data>/clans.json`),
|
||||
* delegating queries, lifecycle, and membership rules to `clan-queries.ts`,
|
||||
* `clan-lifecycle.ts`, and `clan-membership.ts` (implementation notes; implementation notes I).
|
||||
* `clan-lifecycle.ts`, and `clan-membership.ts`.
|
||||
*/
|
||||
import { existsSync, readFileSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* Types, binary enum constants, and shared squadron domain constants
|
||||
*.
|
||||
* Types, binary enum constants, and shared squadron domain constants.
|
||||
*/
|
||||
import type { ClanTuning } from './clan-tuning.ts';
|
||||
import type { BlkBlock } from '@wto/blk';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* Per-player cloud settings persistence inside `<data>/saves/<userId>/cloud-settings/`
|
||||
*. Keeping cloud settings inside each player's save directory means copying `saves/<userId>/`
|
||||
* Per-player cloud settings persistence inside `<data>/saves/<userId>/cloud-settings/`. Keeping cloud settings inside each player's save directory means copying `saves/<userId>/`
|
||||
* to another machine or fresh client folder carries all game options, keybinds, HUD settings,
|
||||
* presets, and map preferences along automatically.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Dataset: the battle reward factors the game files carry (implementation notes "3d").
|
||||
* Dataset: the battle reward factors the game files carry.
|
||||
*
|
||||
* char.vromfs.bin config/wpcost.blk, per vehicle:
|
||||
* unitClass, expMul, rewardMul<Arcade|Historical|Simulation>, battleTimeAward<...>, timedAward<...>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Dataset: the battle awards ("streaks") of char.vromfs.bin config/unlocks.blk (implementation notes "3e").
|
||||
* Dataset: the battle awards ("streaks") of char.vromfs.bin config/unlocks.blk.
|
||||
*
|
||||
* unlockable{ id:t type:t="streak" hidden:b isAfterFlight:b isMultiStage:b
|
||||
* amount_warpoints:i|ip3 amount_exp:i|ip3 reward of a single-stage award
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
* Dataset: squadron creation, edit, member-limit upgrade, battalion-to-normal upgrade prices,
|
||||
* and free tag decorators from char.vromfs.bin config/warpoints.blk (implementation notes;
|
||||
* aces.exe 0x906fe0..0x907070; scripts/clans/clanType.nut).
|
||||
* and free tag decorators from char.vromfs.bin config/warpoints.blk (aces.exe 0x906fe0..0x907070; scripts/clans/clanType.nut).
|
||||
*/
|
||||
import { findBlock, type BlkBlock } from '@wto/blk';
|
||||
import { numberField } from './blk-fields.ts';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* Extract datasets once and reuse the result while the game files stay the same
|
||||
*:
|
||||
* Extract datasets once and reuse the result while the game files stay the same:
|
||||
*
|
||||
* 1. every pack the dataset read has the same size and modification time as when it was
|
||||
* extracted: use the cached result;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* A dataset: a set of static facts extracted from the player's game files (implementation notes
|
||||
* 3.4). Each dataset declares what it produces and reads its inputs only through the source
|
||||
* A dataset: a set of static facts extracted from the player's game files. Each dataset declares what it produces and reads its inputs only through the source
|
||||
* it is given, so the cache knows exactly which files the result depends on.
|
||||
*
|
||||
* A dataset only records what the game files say; deciding what the facts mean for a game
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* Dataset: stock game references to external inventory itemdef IDs outside shop.blk vehicles
|
||||
*:
|
||||
* Dataset: stock game references to external inventory itemdef IDs outside shop.blk vehicles:
|
||||
* - Decorator marketplace coupons in char.vromfs.bin config/{skins,decals,attachable}.blk;
|
||||
* - Unlock/pilot-icon marketplace coupons in char.vromfs.bin config/unlocks.blk;
|
||||
* - Workshop referenced itemdef IDs in aces.vromfs.bin config/workshop.blk.
|
||||
|
||||
@@ -106,7 +106,7 @@ export interface ItemDefinition {
|
||||
readonly booster?: BoosterDefinition;
|
||||
readonly wager?: WagerDefinition;
|
||||
readonly discount?: DiscountDefinition;
|
||||
/** External inventory craft-part itemdef id granted on recycling (299000..299004; implementation notes). */
|
||||
/** External inventory craft-part itemdef id granted on recycling (299000..299004). */
|
||||
readonly recycleItemResult?: number;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
* per-difficulty "mission" sub-block) are also kept as written, with their BLK types, for
|
||||
* the mission settings the local server sends when a battle starts.
|
||||
*
|
||||
* 2.61.0.37: 1315 missions, each name matching exactly one mission file (docs/implementation notes).
|
||||
* 2.61.0.37: 1315 missions, each name matching exactly one mission file.
|
||||
*/
|
||||
import type { BlkBlock, BlkParam } from '@wto/blk';
|
||||
import type { Dataset, DatasetSource } from './dataset.ts';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Dataset: how a battle's Research Points reach the researched vehicle (implementation notes "3e").
|
||||
* Dataset: how a battle's Research Points reach the researched vehicle.
|
||||
*
|
||||
* char.vromfs.bin config/rank.blk:
|
||||
* expBonusPercentForChildForMode<N> bonus when the vehicle played precedes the researched one;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Dataset: how many free research points one golden eagle converts into a vehicle's research
|
||||
* points (implementation notes, cln_convert_exp).
|
||||
* points (cln_convert_exp).
|
||||
*
|
||||
* char.vromfs.bin config/warpoints.blk playerExpToCountryFor1Gold:i (2.61.0.37: 45). The
|
||||
* client reads it in wp_get_exp_convert_exp_for_gold_rate (aces.exe 0x1052af0 -> 0x916eb0),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Dataset: entitlement-to-GUID mappings from aces.vromfs.bin config/gui.blk bundles/guid
|
||||
* (gui.vromfs.bin scripts/onlineShop/onlineBundles.nut, implementation notes).
|
||||
* (gui.vromfs.bin scripts/onlineShop/onlineBundles.nut).
|
||||
*/
|
||||
import { findBlock } from '@wto/blk';
|
||||
import type { Dataset } from './dataset.ts';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* Dataset: the game's own names for countries and vehicle types, from lang.vromfs.bin
|
||||
*:
|
||||
* Dataset: the game's own names for countries and vehicle types, from lang.vromfs.bin:
|
||||
* lang/_common_languages.csv: country_usa, country_germany, ... country names
|
||||
* lang/menu.csv: mainmenu/type_aircraft, type_tank, ... vehicle type names
|
||||
*/
|
||||
|
||||
@@ -2,10 +2,9 @@
|
||||
* Dataset: every vehicle's research and purchase facts.
|
||||
*
|
||||
* The client takes a vehicle's economy from char.vromfs.bin config/wpcost.blk (gui.vromfs.bin
|
||||
* scripts/unit/unit.nut initOnce; the native status function reads the same file,
|
||||
* implementation notes): one block per vehicle with
|
||||
* scripts/unit/unit.nut initOnce; the native status function reads the same file): one block per vehicle with
|
||||
* country:t the country whose tech tree and ranks it belongs to
|
||||
* unitClass:t exp_fighter, exp_tank, ... (the vehicle type, implementation notes)
|
||||
* unitClass:t exp_fighter, exp_tank, ... (the vehicle type)
|
||||
* rank:i
|
||||
* reqAir:t the vehicle that has to be researched before it
|
||||
* reqExp:i research points needed
|
||||
@@ -54,11 +53,11 @@ export interface CatalogueVehicle {
|
||||
readonly parts: readonly string[];
|
||||
/** shop.blk showOnlyWhenBought. */
|
||||
readonly onlyShownWhenOwned: boolean;
|
||||
/** shop.blk marketplaceItemdefId (vehicles traded as coupons on the market, implementation notes). */
|
||||
/** shop.blk marketplaceItemdefId (vehicles traded as coupons on the market). */
|
||||
readonly marketplaceItemdefId?: number;
|
||||
/** wpcost.blk openCostGold (early GE buyout price for squadron vehicles, implementation notes). */
|
||||
/** wpcost.blk openCostGold (early GE buyout price for squadron vehicles). */
|
||||
readonly openCostGold: number;
|
||||
/** wpcost.blk minOpenCostGold (minimum GE buyout floor for squadron vehicles, implementation notes). */
|
||||
/** wpcost.blk minOpenCostGold (minimum GE buyout floor for squadron vehicles). */
|
||||
readonly minOpenCostGold: number;
|
||||
/** wpcost.blk economicRank and per-difficulty matchmaking ranks. */
|
||||
readonly economicRank: number;
|
||||
|
||||
@@ -31,7 +31,7 @@ export interface ModificationFacts {
|
||||
readonly researchPoints: number;
|
||||
readonly silverLions: number;
|
||||
readonly goldenEagles: number;
|
||||
/** openCostGold: golden eagles to get it without the research (scaled by progress, implementation notes). */
|
||||
/** openCostGold: golden eagles to get it without the research (scaled by progress). */
|
||||
readonly openGoldenEagles: number;
|
||||
/** reqModification, repeated: modifications that must be bought first. */
|
||||
readonly requires: readonly string[];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Dataset: the game's own SVG icons that the local web pages (store and marketplace, shown in
|
||||
* the in-game browser; implementation notes) display, taken from the player's
|
||||
* the in-game browser) display, taken from the player's
|
||||
* ui/atlases.vromfs.bin at runtime. The dataset uses these entries.
|
||||
* gameuiskin/<vehicle>_ico.svg the tech-tree silhouette of a vehicle
|
||||
* gameuiskin/<country>.svg a country flag (country_usa, ...)
|
||||
|
||||
@@ -15,7 +15,7 @@ export type GamePackName =
|
||||
| 'lang.vromfs.bin'
|
||||
| 'ui/atlases.vromfs.bin';
|
||||
|
||||
/** What identifies one version of a pack file cheaply (implementation notes, first check). */
|
||||
/** Size and modification time provide a quick preliminary check of a pack file. */
|
||||
export interface PackStamp {
|
||||
readonly size: number;
|
||||
readonly mtimeMs: number;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Read BLK documents out of one of the player's game data packs (implementation notes: the
|
||||
* Read BLK documents out of one of the player's game data packs (the
|
||||
* game's own files are the source of every static fact; nothing is shipped with us).
|
||||
*/
|
||||
import { createHash } from 'node:crypto';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/** The offline version's game modes (docs/implementation notes; implementation notes J). */
|
||||
/** Offline game-mode declarations used by the matching service. */
|
||||
import type { GameModeDeclaration } from './game-mode-declaration.ts';
|
||||
import { PVE_BATTLES } from './pve-battles.ts';
|
||||
import { RANDOM_BATTLES } from './random-battles.ts';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* What the offline game-mode catalogue declares about one mode (docs/implementation notes,
|
||||
* 3.3). Everything else in a mode definition is derived from the game's own files.
|
||||
* What the offline game-mode catalogue declares about one mode (3.3). Everything else in a mode definition is derived from the game's own files.
|
||||
*/
|
||||
|
||||
/** Vehicle classes, named as the stock UI names unit types in event craft rules (scripts/unit/baseUnitTypes.nut). */
|
||||
@@ -29,7 +28,7 @@ export interface MissionSelection {
|
||||
export interface GameModeDeclaration {
|
||||
/** Fixed forever: the client remembers modes by it. */
|
||||
readonly gameModeId: number;
|
||||
/** The stock name where the game has one (docs/implementation notes). */
|
||||
/** The stock name where the game has one. */
|
||||
readonly name: string;
|
||||
/**
|
||||
* Sub-mode tag prefix recognized by `scripts/matching/matchinggamemodes.nut:28-42`
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* missions that say the class is allowed.
|
||||
*
|
||||
* Exclude missions whose names contain "newbie" from the standard offline mission pools.
|
||||
* See docs/implementation notes.
|
||||
*
|
||||
*/
|
||||
import type { MissionSelection } from './game-mode-declaration.ts';
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* from the game's own files at start-up. A mode none of whose missions are in the player's
|
||||
* game files is left out (and reported), since it could not be played.
|
||||
*
|
||||
* The same object will serve the battle flow later (docs/implementation notes): which missions
|
||||
* The same object will serve the battle flow later: which missions
|
||||
* and team rules a chosen mode has.
|
||||
*/
|
||||
import type { MissionHeader, MultiplayerMissions } from '../game-data/datasets/multiplayer-missions.ts';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/** Choose a mode's missions from the game's multiplayer missions (docs/implementation notes). */
|
||||
/** Choose a mode's missions from the game's multiplayer missions. */
|
||||
import type { MissionHeader, MultiplayerMissions } from '../game-data/datasets/multiplayer-missions.ts';
|
||||
import type { MissionSelection, UnitClass } from './catalogue/game-mode-declaration.ts';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* A game mode in the form the stock UI reads from the matching server
|
||||
* (match.fetch_game_modes_info, docs/implementation notes):
|
||||
* (match.fetch_game_modes_info):
|
||||
*
|
||||
* - difficulty: the matching name (scripts/difficulty.nut matchingName: arcade, realistic,
|
||||
* simulation); mission_decl.difficulty: the mission name of the same difficulty
|
||||
@@ -13,11 +13,11 @@
|
||||
* - mission_decl.missions_list: mission name -> {} (a value may carry "enableIf" rank
|
||||
* limits, scripts/missions/mapPreferencesParams.nut; none are set).
|
||||
* - tag: required, the script reads it unguarded (scripts/matching/matchingGameModes.nut,
|
||||
* onGameModesUpdated; local verification stopped there without it). Tag prefixes mark sub-modes
|
||||
* onGameModesUpdated). Tag prefixes mark sub-modes
|
||||
* (night battles, small teams, bullet hell, nuclear escalation, naval EC;
|
||||
* SUB_GAME_MODE_TAG_PREFIXES in matchingGameModes.nut:28-42).
|
||||
* - rankCalcMode: required, read unguarded when the slotbar computes the lineup's battle
|
||||
* rating (scripts/slotbar/slotbarPresets/calcRanks.nut calculateBR; local verification).
|
||||
* rating (scripts/slotbar/slotbarPresets/calcRanks.nut calculateBR).
|
||||
* "average" or "maximum" (lang: multiplayer/battleRatingCalcHint/*); random battles
|
||||
* take the highest battle rating of the lineup.
|
||||
*
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* External Silver-Lion supply chests and their keyless open generators (implementation notes sections
|
||||
* 6-8). Which chests exist, their prices and prizes are tuning (tuning/supply-chests.jsonc);
|
||||
* External Silver-Lion supply chests and their keyless open generators. Which chests exist, their prices and prizes are tuning (tuning/supply-chests.jsonc);
|
||||
* prize groups resolve deterministically against the game data.
|
||||
*/
|
||||
import type { CatalogueVehicle } from '../game-data/datasets/vehicle-catalogue.ts';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Marketplace vehicle coupon definitions (`shop.blk` `marketplaceItemdefId`, 233 vehicles in
|
||||
* 2.61.0.37; implementation notes).
|
||||
* 2.61.0.37).
|
||||
*/
|
||||
import type { LocalizedText } from '../../game-data/datasets/unit-names.ts';
|
||||
import type { CatalogueVehicle } from '../../game-data/datasets/vehicle-catalogue.ts';
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
* Pure domain rules for external inventory coupon consumption, item recycling, generator
|
||||
* exchanges (chest opening and workshop/recycle crafting), and GJN marketplace coupon purchases
|
||||
*. Wire JSON formatting lives in `inventory-wire.ts`.
|
||||
* exchanges (chest opening and workshop/recycle crafting), and GJN marketplace coupon purchases. Wire JSON formatting lives in `inventory-wire.ts`.
|
||||
*/
|
||||
import type { BlkBlock, BlkParam } from '@wto/blk';
|
||||
import type { ItemCatalogue } from '../items/item-catalogue.ts';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* External inventory HTTP service (`inventory-proxy-0{1,2}.gaijin.net/char`; implementation notes).
|
||||
* External inventory HTTP service (`inventory-proxy-0{1,2}.gaijin.net/char`).
|
||||
*
|
||||
* Unlike CharService (which prepends the `0x69` uncompressed marker to binary BLK answers),
|
||||
* `charsq` (`0x459cac0 -> 0x459e020`) parses the raw HTTP body directly as UTF-8 JSON unless
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* Local GJN Marketplace web service (`/trade.gaijin.net` and `trade.gaijin.net` host;
|
||||
* implementation notes). Lets players browse and buy all 466 stock marketplace coupons
|
||||
* Local GJN Marketplace web service (`/trade.gaijin.net` and `trade.gaijin.net` host). Lets players browse and buy all 466 stock marketplace coupons
|
||||
* (vehicles, skins, decals, attachables, pilot/unlocks) with GJN, depositing coupons into
|
||||
* `extInventory` and pushing `mrpc.generic_notify` (`inventory.changed`) to active game clients.
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Classic trophies (`cln_get_price_ex` top-level `trophy{}` + `Common/trophy/<id>` prices)
|
||||
* and `cln_buy_trophy` rules (implementation notes; scripts/items/itemsClasses/itemTrophy.nut):
|
||||
* and `cln_buy_trophy` rules (scripts/items/itemsClasses/itemTrophy.nut):
|
||||
* 1. Silver-Lion supply chests with native drop-chance display (`showChances:b=yes`, calculated
|
||||
* by `calcTrophiesDropChance` at 0x1554dc0), using deterministic rank-and-country selection;
|
||||
* 2. Golden-Eagle direct-purchase prize-pool vehicles (`numTotal:i=1`, single `i{ unit:t }` prize,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// Local marketplace page (implementation notes; layout after the official Gaijin Market,
|
||||
// implementation notes), shown in the game's built-in browser.
|
||||
// Local marketplace page (layout after the official Gaijin Market), shown in the game's built-in browser.
|
||||
// The game opens it as <marketplaceURL>?a=<app id>[&viewitem&n=<market_hash_name>] (inventoryClient.nut);
|
||||
// with `n` the page opens that item's card directly.
|
||||
'use strict';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/* Local marketplace page, laid out like the official Gaijin Market (implementation notes
|
||||
section 4; Chromium 100: no :has(), container queries or CSS nesting). Fonts fall back to system fonts. */
|
||||
/* The in-game marketplace runs in Chromium 100. Use compatible CSS and system font fallbacks. */
|
||||
:root {
|
||||
--bg: #1c1f23; --surface: #272a2e; --lift: #2e3238; --cyan: #31e3ee; --red: #bf2d36; --green: #2a826d;
|
||||
--text: #cbd7dc; --muted: #ffffff80; --hair: #ffffff0d; --disabled: #ffffff24;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* Removing classic items whose time is up (items/<uid>/expiredTimeH, implementation notes section
|
||||
* 4.2), together with their place in the active lists. Run whenever a profile is handed out
|
||||
* Removing classic items whose time is up (items/<uid>/expiredTimeH), together with their place in the active lists. Run whenever a profile is handed out
|
||||
* or changed, so the client never gets an expired item.
|
||||
*/
|
||||
import type { BlkBlock } from '@wto/blk';
|
||||
|
||||
@@ -49,7 +49,7 @@ function newItem(item: ItemDefinition, count: number, now: ServerTime): NewItem
|
||||
};
|
||||
}
|
||||
|
||||
/** Per-type fields a new item starts with (the client's readers: implementation notes). */
|
||||
/** Default fields included when creating each item type. */
|
||||
function typeFields(item: ItemDefinition): { params?: BlkParam[]; blocks?: BlkBlock[] } {
|
||||
if (item.type === 'wager') return { params: [intParam('numWins', 0), intParam('numBattles', 0), intParam('wager', 0)] };
|
||||
if (item.type === 'personalDiscounts' && item.discount) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Buying classic items (cln_buy_item, implementation notes; scripts items/itemsBase.nut
|
||||
* Buying classic items (cln_buy_item; scripts items/itemsBase.nut
|
||||
* _requestBuy): name:t count:i cost:i costGold:i.
|
||||
*
|
||||
* The client prices a purchase as the price-table price of one piece times the pieces it buys
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* Matching-server RPC handlers for hangar battle-rating display and battle queueing
|
||||
*:
|
||||
* Matching-server RPC handlers for hangar battle-rating display and battle queueing:
|
||||
* - `wtmm_static.calc_ranks` (scripts/battlerating.nut:179)
|
||||
* - `match.enqueue` (scripts/matching/servicenotifications/match.nut:75)
|
||||
* - `match.leave_queue` (scripts/queue/queuestate.nut:28)
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/**
|
||||
* The game-mode requests of the matching server (gui.vromfs.bin
|
||||
* scripts/matching/matchingGameModes.nut, docs/implementation notes):
|
||||
* scripts/matching/matchingGameModes.nut):
|
||||
*
|
||||
* - wtmm_static.fetch_game_modes_digest {timeout}: answered with "modes", the list of
|
||||
* game-mode ids. After login the script asks for it, then fetches the modes it names.
|
||||
* - match.fetch_game_modes_info {byId: [ids], asString: true, timeout}: the script asks for
|
||||
* at most 5 ids at a time and reads "modes_str", a JSON array of mode definitions
|
||||
* (game-modes/mode-definition.ts). local verification logged exactly these parameters.
|
||||
* (game-modes/mode-definition.ts).
|
||||
*
|
||||
* Five failed digest fetches sign the player out, so both answers must always be well formed.
|
||||
*/
|
||||
|
||||
@@ -90,7 +90,7 @@ export function asRequest(message: MatchingMessage): MatchingRequest | undefined
|
||||
* message's "data" to the request's completion wrapper (0x44f1c00, set by the request sender
|
||||
* 0x44e9bc0), which logs "got response on …" and hands that object's own "data" to the
|
||||
* caller; for script requests (matching_call, 0x46e1e70) that is the table the UI script
|
||||
* receives, with "error" added (0x46e5ee0). local verification: a result placed directly in "data"
|
||||
* receives, with "error" added (0x46e5ee0). A result placed directly in "data"
|
||||
* reached the script as an empty table.
|
||||
*/
|
||||
export function answerTo(request: MatchingRequest, result: Record<string, unknown>): MatchingMessage {
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
* hangar/<vehicle>/tierNumber the highest open tier
|
||||
* modsResearch the status of every modification not owned yet; locked ones
|
||||
* only keep an entry while they hold research points
|
||||
* hangar/<vehicle>/investMode cleared when that modification is no longer researchable
|
||||
*. After a modification finished
|
||||
* hangar/<vehicle>/investMode cleared when that modification is no longer researchable. After a modification finished
|
||||
* (investModePrev set) a new one is picked while some remain, so
|
||||
* the stock prompt opens WeaponsModalHandler in researchMode
|
||||
* (or reports isResearchLast with investMode "" when the vehicle
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Saving, renaming and deleting custom secondary weapon presets (`cln_save_weapon_presets`,
|
||||
* scripts/unit/unitWeaponryCustomPresets.nut `savePresetInProfile`; implementation notes).
|
||||
* scripts/unit/unitWeaponryCustomPresets.nut `savePresetInProfile`).
|
||||
*
|
||||
* Sent via `charSendBlk` (job type 13 -> full profile update). Request payload:
|
||||
* <vehicle>{ <presetId>{ name:t="..." Weapon{ preset:t="..." slot:i=... } ... } }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Buying weapon presets (cln_buy_weapon: aircraft:t weapon:t count:i cost:i costGold:i, scripts
|
||||
* weaponry/weaponsPurchase.nut sendPurchaseWeaponRequest; implementation notes).
|
||||
* weaponry/weaponsPurchase.nut sendPurchaseWeaponRequest).
|
||||
*
|
||||
* Paid presets (bombs, rockets) are bought by the piece: the price is the wpcost.blk value times
|
||||
* the amount, and the player holds at most maxCount pieces (wp_get_weapon_max_count; the client
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* The profile showcase (implementation notes; scripts user/profileShowcase.nut and
|
||||
* The profile showcase (scripts user/profileShowcase.nut and
|
||||
* user/showcase/*.nut).
|
||||
*
|
||||
* cln_save_profile_showcase carries showcaseType:t and that type's choices under the names its
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Squadron (clan) membership and squadron vehicle research fields in `profile.blk`
|
||||
* (implementation notes; aces.exe 0x91fa31..0x91fd00 and 0x906790..0x906ac5).
|
||||
* (aces.exe 0x91fa31..0x91fd00 and 0x906790..0x906ac5).
|
||||
*/
|
||||
import { ensureBlock, findBlock, setParam, type BlkBlock } from '@wto/blk';
|
||||
import { int64Field, intField, removeParam, stringField } from './blk-fields.ts';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* Crew skills, skill points, specializations, and Expert-to-Ace RP inside a crew block
|
||||
*:
|
||||
* Crew skills, skill points, specializations, and Expert-to-Ace RP inside a crew block:
|
||||
*
|
||||
* crews{
|
||||
* c0{
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
/**
|
||||
* The player's money in the profile (implementation notes; read by aces.exe 2.61.0.37
|
||||
* The player's money in the profile (read by aces.exe 2.61.0.37
|
||||
* 0x919060):
|
||||
*
|
||||
* warpointsPos:i64 silver lions earned in total
|
||||
* warpointsNeg:i64 silver lions spent in total
|
||||
* goldBalance:i golden eagles (read and written as a 32-bit integer, 0x91b570 / 0x91b5cb)
|
||||
* gjnBalanceCents:i64 GJN balance in hundredths (GJN prices have two decimals, like the USD
|
||||
* price they equal); offline store and market only (implementation notes section
|
||||
* 5.1), the client ignores it
|
||||
* price they equal); offline store and market only, the client ignores it
|
||||
*
|
||||
* The silver lion balance is warpointsPos - warpointsNeg; setting it keeps the amount spent
|
||||
* and adjusts the amount earned.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Entitlements and Premium Account in the profile (implementation notes; read by aces.exe
|
||||
* Entitlements and Premium Account in the profile (read by aces.exe
|
||||
* 2.61.0.37 0x91daf0..0x91e474, has_entitlement 0x179ec70, entitlement_expires_in 0x179ed60):
|
||||
*
|
||||
* entitlementsInfo{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* The player's classic items in the profile (implementation notes; ItemStorage, aces.exe
|
||||
* The player's classic items in the profile (ItemStorage, aces.exe
|
||||
* 2.61.0.37 0x8f2de0):
|
||||
*
|
||||
* items{
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* Vehicle Research Bonus battles used today, per country and vehicle type (research/
|
||||
* research-efficiency.ts). Kept in a block of the local server's own; the client's profile
|
||||
* Vehicle Research Bonus battles used today, per country and vehicle type (research/research-efficiency.ts). Kept in a block of the local server's own; the client's profile
|
||||
* parser ignores it:
|
||||
*
|
||||
* wtoResearchBonus{ day:i=<days since 1970-01-01 UTC> country_usa{ Tank:i=2 } }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Current research target, just-finished research vehicle, and banked excess RP per country
|
||||
* and vehicle type (implementation notes; `aces.exe` `0x930150`):
|
||||
* and vehicle type (`aces.exe` `0x930150`):
|
||||
*
|
||||
* researchUnits{
|
||||
* country_usa{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Buying a crew slot (cln_buy_slot, implementation notes).
|
||||
* Buying a crew slot (cln_buy_slot).
|
||||
*
|
||||
* The price of a country's next slot is config/rank.blk crew_slots slot<N>, N being the
|
||||
* number of crews the country has, as the client shows it (get_crew_slot_cost, aces.exe
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* Choosing what to research and putting research points into a vehicle (implementation notes
|
||||
* sections 1.2, 4.3 and 5).
|
||||
* Choosing what to research and putting research points into a vehicle.
|
||||
*
|
||||
* - Choosing a research target (cln_set_researchable) makes a researchable vehicle the
|
||||
* target of its country and type and closes the "research finished" prompt.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Static facts used by vehicle research and purchase rules, loaded once at startup from game
|
||||
* files (implementation notes; implementation notes).
|
||||
* files.
|
||||
*/
|
||||
import type { DatasetCache } from '../game-data/datasets/dataset-cache.ts';
|
||||
import { crewSlotPrices, eraRequirements, type CrewSlotPrices, type EraRequirements } from '../game-data/datasets/rank-settings.ts';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Squadron vehicle (`researchType:t="clanVehicle"`) research and Golden-Eagle early purchase
|
||||
* rules (implementation notes; aces.exe 0xec0b70..0xec0c6f; scripts/unit/unitActions.nut).
|
||||
* rules (aces.exe 0xec0b70..0xec0c6f; scripts/unit/unitActions.nut).
|
||||
*/
|
||||
import type { BlkBlock } from '@wto/blk';
|
||||
import { canAfford, pay, type Price } from '../profile/profile-currency.ts';
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
/**
|
||||
* Buying a vehicle (cln_buy_aircraft, implementation notes).
|
||||
* Buying a vehicle (cln_buy_aircraft).
|
||||
*
|
||||
* The vehicle must be buyable (status "can buy"). Its price is config/wpcost.blk value
|
||||
* (silver lions) and costGold (golden eagles), less the best active personal discount: the
|
||||
* client prices it the same way (wp_get_cost / wp_get_cost_gold, aces.exe 2.61.0.37 0x9158a0;
|
||||
* implementation notes; the price table itself has no discounts). The client sends the price
|
||||
* client prices it the same way (wp_get_cost / wp_get_cost_gold, aces.exe 2.61.0.37 0x9158a0; the price table itself has no discounts). The client sends the price
|
||||
* it showed; a different one is refused, as when a discount ended online. A purchase made with
|
||||
* a discount counts against that discount item. The parts of a split vehicle come with it.
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* Development entry point for editing a save (the save editor of docs/implementation notes
|
||||
* section A; the launcher will call the same profile functions).
|
||||
* Command-line editor for local server saves.
|
||||
*
|
||||
* node apps/server/src/save-cli.ts --game <game folder> --data <data folder>
|
||||
* --player <login or user id> [--silver <n>] [--gold <n>] [--gjn <n>] [--free-rp <n>]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Store service (implementation notes; implementation notes): routes the game's
|
||||
* Store service: routes the game's
|
||||
* yuplay2 store requests (yuplay-store-api.ts) and the local store page (/store: its files
|
||||
* from web/, its JSON requests in store-web-api.ts).
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* The JSON requests of the local store page (/store, shown in the game's built-in browser;
|
||||
* implementation notes):
|
||||
* The JSON requests of the local store page (/store, shown in the game's built-in browser):
|
||||
* GET /store/api/state?userId= balances, products and redeem code help for one account
|
||||
* POST /store/api/buy { userId, productId }
|
||||
* POST /store/api/cart { userId, productId, action }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* The game's own store requests (yuplay2, implementation notes), sent to api.gaijinent.com
|
||||
* The game's own store requests (yuplay2), sent to api.gaijinent.com
|
||||
* and routed here by wto_ws.dll:
|
||||
* POST /item_info.php GJN prices of the bundle GUIDs (scripts/onlineShop/entitlementsInfo.nut)
|
||||
* POST /item_purchase.php pay=gjn purchase from the in-game payment window
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
/**
|
||||
* Record of everything the game sent to the local server, so that what the client actually
|
||||
* asks for can be read off instead of guessed (implementation notes, milestone 1 steps 3 and 4).
|
||||
*
|
||||
* <data>/logs/<start time>/requests.jsonl one JSON line per HTTP exchange or raw connection
|
||||
* <data>/logs/<start time>/bodies/ request and response bodies, plus readable text
|
||||
* (decoded BLK) next to them
|
||||
*
|
||||
* Each exchange also prints one line to the console.
|
||||
* Records local server traffic under `<data>/logs/<start time>/`.
|
||||
* `requests.jsonl` stores one record per HTTP exchange or raw connection. `bodies/` holds the
|
||||
* payloads and readable versions of decoded BLK bodies. Each exchange also produces a console line.
|
||||
*/
|
||||
import { appendFileSync, mkdirSync, writeFileSync } from 'node:fs';
|
||||
import type { IncomingHttpHeaders } from 'node:http';
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/**
|
||||
* All tuning values of the offline version, read once at start-up (implementation notes; user
|
||||
* quote 119): values the offline version decides itself (prices, rewards, drop weights,
|
||||
* limits, preset content). Values the game data already has are read from the game files
|
||||
* instead, and protocol constants stay in the code next to their source.
|
||||
* Reads offline prices, rewards, drop weights, limits, and preset content at server startup.
|
||||
* Values defined by the game come from its data files. Protocol constants live with their handlers.
|
||||
*/
|
||||
import { readBattleEconomyTuning, type BattleEconomyTuning } from '../battle/battle-economy-tuning.ts';
|
||||
import { readBattleTuning, type BattleTuning } from '../battle/battle-tuning.ts';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Shared static-asset server, JSON helpers, and explicit account resolution for the local web
|
||||
* pages (`/store`, `/trade.gaijin.net` and the shared `/_wto/ui/` files). The game opens them in
|
||||
* its built-in browser (Chromium 100; implementation notes).
|
||||
* its built-in browser (Chromium 100).
|
||||
*/
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { extname, join } from 'node:path';
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
* common.css, common.js layout and helpers both pages load
|
||||
* official-images.json official image paths (static-ggc.gaijin.net) per vehicle /
|
||||
* decor / item key, from the official market snapshot
|
||||
*
|
||||
* labels.json the game's country and vehicle type names (ui-labels dataset)
|
||||
* vehicle/<vehicle>.svg the game's silhouette icon of a vehicle (web-icons dataset)
|
||||
* flag/<country>.svg the game's country flag (web-icons dataset)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
// Vehicle coupons use vehicles with a marketplaceItemdefId in shop.blk.
|
||||
"vehicleCoupons": {
|
||||
// Per-vehicle GJN prices use implementation notes.
|
||||
// Per-vehicle GJN prices are stored in cents and based on public market listings.
|
||||
// Use the lowest sell listing or the highest buy order when no sell listing exists. Keep the 2026-11-02 reference price for unmatched vehicles.
|
||||
"byVehicle": {
|
||||
"a6m6c": 27.96,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Local store products and prices.
|
||||
// The stock store receives prices from the server. The offline price sources are documented in implementation notes.
|
||||
// The client receives these prices from the local server.
|
||||
{
|
||||
// GJN prices use the official USD prices at 1 GJN per USD.
|
||||
|
||||
@@ -186,7 +186,7 @@
|
||||
{ "upToRank": 99, "gjn": 79.99, "goldenEagles": 3000, "premiumDays": 30 }
|
||||
],
|
||||
// Per-vehicle overrides use vehicle IDs from config/wpcost.blk in char.vromfs.bin.
|
||||
// GJN prices use the official USD prices in implementation notes.
|
||||
// GJN prices use the numeric USD list prices of the corresponding packs.
|
||||
// Golden Eagle and premium time bonuses match the listed pack contents.
|
||||
"byVehicle": {
|
||||
"a-26c-45-dt": {"gjn": 19.99, "goldenEagles": 2000, "premiumDays": 15},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Where a connection may go (redirect_rules.h, implementation notes). */
|
||||
/* Where a connection may go (redirect_rules.h). */
|
||||
#include "redirect_rules.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
* Deterministic GUID derived from a text (SHA-1, formatted 8-4-4-4-12, upper case). The build
|
||||
* registers `stableGuid(<entitlement>)` for the offline vehicle packs in config/gui.blk
|
||||
* `bundles/guid`, and the local server gives the same GUID to the same store product, so the
|
||||
* game's `getBundleId` → `get_url_for_purchase` → `item_info.php` chain finds the pack
|
||||
*. One definition, used by both packages.
|
||||
* game's `getBundleId` → `get_url_for_purchase` → `item_info.php` chain finds the pack. One definition, used by both packages.
|
||||
*/
|
||||
import { createHash } from 'node:crypto';
|
||||
|
||||
|
||||
@@ -10,8 +10,7 @@ export class DefinitionError extends PatchError {
|
||||
|
||||
/**
|
||||
* A patch site could not be found, or was found in more than one place. The caller reports
|
||||
* which patches and features are affected; it never falls back to a guessed address
|
||||
*.
|
||||
* which patches and features are affected; it never falls back to a guessed address.
|
||||
*/
|
||||
export class LocateError extends PatchError {
|
||||
override name = 'LocateError';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
*
|
||||
* PaymentMethods: lets scripts/onlineShop/onlinePurchase.nut offer GJN payment directly
|
||||
* inside the Golden Eagles and Premium Account windows (stock game_settings.blk restricts it
|
||||
* with PS4Access; implementation notes).
|
||||
* with PS4Access).
|
||||
*/
|
||||
import { ensureBlock, setParam, type BlkBlock } from '@wto/blk';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* The game version of a stock folder, and the versions the patches were verified on
|
||||
* (implementation notes: a version that differs is only pointed out, never refused).
|
||||
* (a version that differs is only pointed out, never refused).
|
||||
*
|
||||
* The version is the file version of win64/aces.exe: the VS_FIXEDFILEINFO block in its version
|
||||
* resource, which Windows shows as "File version" (2.61.0.37 for the target build).
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
/**
|
||||
* Rebuild gui.vromfs.bin by applying the script patch definitions in the GUI patch folder
|
||||
* (implementation notes, format in gui-patch-definition.ts).
|
||||
* (format in gui-patch-definition.ts).
|
||||
*
|
||||
* Every edit must find its stock text exactly once in the current script. A patch with an edit
|
||||
* that does not is left out whole, never half applied, and listed with the features it covers
|
||||
*, the same way an unavailable exe patch is; the other patches are applied.
|
||||
* that does not is left out whole, never half applied, and listed with the features it covers, the same way an unavailable exe patch is; the other patches are applied.
|
||||
*/
|
||||
import type { PatchFailure } from '@wto/exepatch';
|
||||
import { getFile, putFile, readArchive, writeArchive, type Archive } from '@wto/vromfs';
|
||||
|
||||
@@ -23,8 +23,7 @@ const NETWORK_BLOCK = 'network';
|
||||
|
||||
/**
|
||||
* GUIDs added to config/gui.blk bundles/guid so scripts/onlineShop/entitlementsInfo.nut
|
||||
* requests GJN prices for GJN-priced Premium Account tiers alongside the stock eagles* packs
|
||||
*.
|
||||
* requests GJN prices for GJN-priced Premium Account tiers alongside the stock eagles* packs.
|
||||
*/
|
||||
export const EXTRA_STORE_BUNDLE_GUIDS: ReadonlyArray<readonly [entitlement: string, guid: string]> = [
|
||||
['wto_prem_20d', 'A1E00020-5754-4F46-8F00-000000000020'],
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
/**
|
||||
* Rebuild a data pack with some of its BLK documents edited and, optionally, new files added.
|
||||
* Every other file of the pack is kept byte for byte. Edited documents are stored self-contained (they no longer depend on
|
||||
* the pack's shared name map), which the game accepts in every loading mode
|
||||
*.
|
||||
* the pack's shared name map), which the game accepts in every loading mode.
|
||||
*/
|
||||
import { decodeBlk, encodeBlk, parseSharedNameMap, type BlkBlock } from '@wto/blk';
|
||||
import { getFile, NAME_MAP_PATH, putFile, readArchive, writeArchive, type Archive } from '@wto/vromfs';
|
||||
|
||||
@@ -7,7 +7,7 @@ import { ESSENTIAL_FEATURES } from './essential-features.ts';
|
||||
import { loadGuiPatches } from './gui-patch-definition.ts';
|
||||
|
||||
export interface PatchFeature {
|
||||
/** The feature tag, e.g. "K-侦察"; the letter before the dash is the inventory section. */
|
||||
/** Feature tag with a prefix identifying its feature group. */
|
||||
readonly tag: string;
|
||||
/** A copy cannot run, or cannot stay apart from the online game, without it. */
|
||||
readonly essential: boolean;
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
// Why the exe: the build drops the dedicated server's script spawn permission, so with a multiplayer
|
||||
// session the function only logs "spawn denied by scripts"; non-host sessions already return at its start.
|
||||
// Without it: no AI vehicle ever spawns in a LocalMP battle.
|
||||
// Kept from the baseline; not re-reviewed in the LocalMP rework.
|
||||
{
|
||||
"id": "battle/allow-local-host-bot-spawns",
|
||||
"title": "Let BotSystem spawn AI vehicles on a LocalMP host",
|
||||
|
||||
Loaded 100 of 106 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user