From 930ea07630faca2f3edab043d63532b2f93c5af4 Mon Sep 17 00:00:00 2001 From: N0VAN0M4LY <224130499+N0VAN0M4LY@users.noreply.github.com> Date: Sun, 29 Nov 2026 03:20:54 +0800 Subject: [PATCH] refactor(repo)!: move apps, shared packages, and patch definitions Everything sat in packages/: two programs next to the small libraries they use, and the patch data loose at the root. The programs now live in apps/ and the shared libraries in packages/: apps/server the local server (was packages/local-service), package @wto/server packages/patcher builds the game copy (was packages/build), package @wto/patcher patches/exe exe patch definitions (was exe-patches) patches/gui GUI script patches (was gui-patches) Inside the server, the network layer folder becomes transport/ so it is not server/server/, the entry module is server.ts, and startLocalService and its types become startServer, ServerOptions and RunningServer. The health answer names the app wto-server, and the TLS files in the data folder are server.key and server.crt (made again on the next start). Comments, logs and tool texts say "local server". The patcher no longer reaches into the server's folder. It read the default tuning/store.jsonc by a relative path to register bundle GUIDs for the multi-vehicle packs, which also ignored the player's overrides in /tuning/. It now takes the pack ids from its caller; the server exports multiVehiclePackIds(dataFolder), which reads them the way the running server does. rebuildGuiPack takes the patch folder from its caller as well. The development build moves out of the patcher to scripts/build-game-copy.ts, since it uses both the server and the patcher. It needs --data (the folder the server will run with) and defaults the patch folders and the hook library to this repository. Checked with the root typecheck, check-patches, check-gui, check-offsets, the native build, a run of build-game-copy.ts into a scratch folder (12 exe patches, 35 GUI patches, 496 bundle GUIDs as before) and a server start from apps/server answering wto-server. BREAKING CHANGE: Use @wto/server and @wto/patcher from the new workspace paths. Run the development build with scripts/build-game-copy.ts and pass --data. --- README.md | 12 ++-- .../server}/package.json | 4 +- .../server}/src/accounts/account-store.ts | 0 .../server}/src/accounts/password.ts | 0 .../server}/src/asset-pack-cli.ts | 2 +- .../server}/src/battle/battle-boosters.ts | 0 .../server}/src/battle/battle-coalitions.ts | 0 .../server}/src/battle/battle-debriefing.ts | 0 .../src/battle/battle-economy-tuning.ts | 0 .../server}/src/battle/battle-economy.ts | 2 +- .../server}/src/battle/battle-extra-slots.ts | 0 .../server}/src/battle/battle-items.ts | 0 .../server}/src/battle/battle-live-log.ts | 0 .../server}/src/battle/battle-matchmaker.ts | 0 .../src/battle/battle-mission-settings.ts | 0 .../server}/src/battle/battle-ranks.ts | 0 .../server}/src/battle/battle-repair.ts | 0 .../server}/src/battle/battle-report.ts | 4 +- .../server}/src/battle/battle-result-log.ts | 0 .../server}/src/battle/battle-rewards.ts | 0 .../src/battle/battle-rp-investment.ts | 0 .../src/battle/battle-session-store.ts | 0 .../server}/src/battle/battle-settlement.ts | 0 .../server}/src/battle/battle-spawn-score.ts | 0 .../server}/src/battle/battle-streak-log.ts | 0 .../server}/src/battle/battle-streaks.ts | 0 .../src/battle/battle-support-planes.ts | 0 .../server}/src/battle/battle-tuning.ts | 0 .../server}/src/battle/battle-wager.ts | 0 .../src/char/actions/account-context.ts | 0 .../server}/src/char/actions/action-table.ts | 0 .../src/char/actions/agreement-actions.ts | 0 .../src/char/actions/battle-actions.ts | 0 .../server}/src/char/actions/clan-actions.ts | 0 .../char/actions/clan-moderation-actions.ts | 0 .../src/char/actions/client-update-actions.ts | 0 .../char/actions/cloud-settings-actions.ts | 0 .../server}/src/char/actions/crew-actions.ts | 0 .../src/char/actions/crew-skill-actions.ts | 0 .../src/char/actions/crew-slots-payload.ts | 0 .../server}/src/char/actions/decor-actions.ts | 0 .../src/char/actions/decor-layout-actions.ts | 0 .../src/char/actions/hangar-misc-actions.ts | 0 .../src/char/actions/inventory-actions.ts | 0 .../server}/src/char/actions/item-actions.ts | 0 .../src/char/actions/modification-actions.ts | 0 .../src/char/actions/online-init-actions.ts | 2 +- .../src/char/actions/payload-params.ts | 0 .../src/char/actions/player-card-actions.ts | 0 .../server}/src/char/actions/price-actions.ts | 0 .../server}/src/char/actions/price-table.ts | 0 .../src/char/actions/purchase-actions.ts | 0 .../src/char/actions/research-actions.ts | 0 .../server}/src/char/actions/rule-answer.ts | 0 .../char/actions/squadron-research-actions.ts | 0 .../src/char/actions/starting-info-actions.ts | 0 .../server}/src/char/actions/store-actions.ts | 0 .../src/char/actions/unlock-actions.ts | 0 .../server}/src/char/char-action.ts | 0 .../server}/src/char/char-answers.ts | 2 +- .../server}/src/char/char-payload.ts | 0 .../server}/src/char/char-service.ts | 4 +- .../server}/src/char/compression-marker.ts | 0 .../server}/src/char/pbbd-stream.ts | 0 .../server}/src/chat/irc-protocol.ts | 0 .../server}/src/chat/irc-server.ts | 0 .../server}/src/clans/clan-blk.ts | 0 .../server}/src/clans/clan-lifecycle.ts | 0 .../server}/src/clans/clan-membership.ts | 0 .../server}/src/clans/clan-queries.ts | 0 .../server}/src/clans/clan-seeds.ts | 0 .../server}/src/clans/clan-store.ts | 0 .../server}/src/clans/clan-tuning.ts | 0 .../server}/src/clans/clan-types.ts | 0 .../local-service => apps/server}/src/cli.ts | 12 ++-- .../cloud-settings/cloud-settings-store.ts | 0 .../server}/src/crew/crew-skill-rules.ts | 0 .../server}/src/crew/crew-training.ts | 0 .../server}/src/decor/decor-purchase.ts | 0 .../downloadable-content-service.ts | 4 +- .../src/game-data/datasets/battle-economy.ts | 0 .../game-data/datasets/battle-spawn-rules.ts | 0 .../src/game-data/datasets/battle-streaks.ts | 0 .../src/game-data/datasets/blk-fields.ts | 0 .../src/game-data/datasets/clan-economy.ts | 0 .../src/game-data/datasets/crew-skills.ts | 0 .../src/game-data/datasets/dataset-cache.ts | 0 .../server}/src/game-data/datasets/dataset.ts | 0 .../src/game-data/datasets/decor-catalogue.ts | 0 .../datasets/external-item-sources.ts | 0 .../src/game-data/datasets/item-catalogue.ts | 0 .../src/game-data/datasets/lang-csv.ts | 0 .../datasets/multiplayer-missions.ts | 2 +- .../src/game-data/datasets/rank-settings.ts | 0 .../game-data/datasets/research-efficiency.ts | 0 .../game-data/datasets/research-point-rate.ts | 2 +- .../game-data/datasets/reserve-vehicles.ts | 0 .../src/game-data/datasets/shop-branches.ts | 0 .../src/game-data/datasets/shop-countries.ts | 0 .../src/game-data/datasets/shop-tree.ts | 0 .../src/game-data/datasets/store-bundles.ts | 0 .../src/game-data/datasets/ui-labels.ts | 0 .../src/game-data/datasets/unit-names.ts | 0 .../src/game-data/datasets/unlock-prices.ts | 0 .../game-data/datasets/vehicle-catalogue.ts | 2 +- .../game-data/datasets/vehicle-equipment.ts | 0 .../src/game-data/datasets/vehicle-repair.ts | 0 .../src/game-data/datasets/vehicle-unlocks.ts | 0 .../src/game-data/datasets/web-icons.ts | 0 .../server}/src/game-data/game-files.ts | 4 +- .../server}/src/game-data/game-pack.ts | 0 .../src/game-modes/catalogue/catalogue.ts | 0 .../catalogue/game-mode-declaration.ts | 0 .../src/game-modes/catalogue/mission-pools.ts | 0 .../src/game-modes/catalogue/pve-battles.ts | 0 .../game-modes/catalogue/random-battles.ts | 0 .../game-modes/catalogue/simulator-battles.ts | 0 .../game-modes/catalogue/special-events.ts | 0 .../game-modes/catalogue/sub-game-modes.ts | 0 .../server}/src/game-modes/game-modes.ts | 0 .../server}/src/game-modes/mission-pool.ts | 0 .../server}/src/game-modes/mode-definition.ts | 0 apps/server/src/index.ts | 7 ++ .../server}/src/inventory/chest-defs.ts | 0 .../content-sign/content-signature.ts | 2 +- .../local-inventory-content.key.pem | 0 .../src/inventory/coupons/cosmetic-coupons.ts | 0 .../src/inventory/coupons/vehicle-coupons.ts | 0 .../server}/src/inventory/inventory-rules.ts | 0 .../src/inventory/inventory-service.ts | 2 +- .../server}/src/inventory/inventory-wire.ts | 0 .../src/inventory/itemdef-catalogue.ts | 0 .../server}/src/inventory/itemdef-types.ts | 0 .../server}/src/inventory/marketplace-sell.ts | 0 .../src/inventory/marketplace-service.ts | 2 +- .../src/inventory/marketplace-tuning.ts | 0 .../server}/src/inventory/recycling-defs.ts | 0 .../server}/src/inventory/recycling-tuning.ts | 0 .../src/inventory/supply-chest-tuning.ts | 0 .../server}/src/inventory/trophy-catalogue.ts | 0 .../server}/src/inventory/trophy-tuning.ts | 0 .../server}/src/inventory/web/app.js | 0 .../server}/src/inventory/web/index.html | 0 .../server}/src/inventory/web/styles.css | 0 .../server}/src/items/item-activation.ts | 0 .../server}/src/items/item-catalogue.ts | 0 .../server}/src/items/item-expiry.ts | 0 .../server}/src/items/item-grants.ts | 0 .../server}/src/items/item-purchase.ts | 0 .../server}/src/items/personal-discounts.ts | 0 .../server}/src/items/universal-spares.ts | 0 .../server}/src/login/form-redaction.ts | 0 .../server}/src/login/login-service.ts | 2 +- .../server}/src/login/session-credentials.ts | 0 .../server}/src/login/yuplay-answer.ts | 2 +- .../src/matching/battle-launch-notify.ts | 2 +- .../src/matching/battle-live-requests.ts | 2 +- .../src/matching/battle-queue-requests.ts | 0 .../server}/src/matching/cluster-list.ts | 0 .../src/matching/game-modes-requests.ts | 0 .../server}/src/matching/game-settings.ts | 0 .../server}/src/matching/lz4-block.ts | 0 .../server}/src/matching/matching-frame.ts | 0 .../server}/src/matching/matching-message.ts | 0 .../server}/src/matching/matching-requests.ts | 0 .../server}/src/matching/matching-service.ts | 2 +- .../server}/src/matching/message-redaction.ts | 0 .../session-crypto/encrypted-envelope.ts | 0 .../local-matching-server.key.pem | 0 .../matching/session-crypto/session-key.ts | 4 +- .../server}/src/modifications/ammo-refill.ts | 0 .../src/modifications/equipment-catalogue.ts | 0 .../modifications/modification-purchase.ts | 0 .../modifications/module-research-target.ts | 0 .../server}/src/modifications/module-state.ts | 0 .../src/modifications/module-status.ts | 0 .../src/modifications/spare-purchase.ts | 0 .../support-plane-modifications.ts | 0 .../src/modifications/weapon-presets.ts | 0 .../src/modifications/weapon-purchase.ts | 0 .../src/player-card/player-card-rules.ts | 0 .../server}/src/player-card/showcase-rules.ts | 0 .../server}/src/profile/blk-fields.ts | 0 .../server}/src/profile/client-profile.ts | 0 .../server}/src/profile/crew-slots.ts | 0 .../server}/src/profile/new-profile-tuning.ts | 0 .../server}/src/profile/new-profile.ts | 0 .../server}/src/profile/player-profiles.ts | 0 .../server}/src/profile/profile-appearance.ts | 2 +- .../server}/src/profile/profile-clan.ts | 0 .../src/profile/profile-client-settings.ts | 0 .../src/profile/profile-crew-skills.ts | 2 +- .../server}/src/profile/profile-crews.ts | 0 .../server}/src/profile/profile-currency.ts | 0 .../src/profile/profile-decor-layouts.ts | 2 +- .../server}/src/profile/profile-dest-rp.ts | 0 .../src/profile/profile-entitlements.ts | 0 .../server}/src/profile/profile-eras.ts | 0 .../src/profile/profile-external-inventory.ts | 0 .../server}/src/profile/profile-hangar.ts | 0 .../server}/src/profile/profile-items.ts | 0 .../src/profile/profile-mission-progress.ts | 0 .../src/profile/profile-modifications.ts | 0 .../src/profile/profile-module-research.ts | 0 .../src/profile/profile-research-bonus.ts | 2 +- .../src/profile/profile-research-points.ts | 0 .../src/profile/profile-research-targets.ts | 0 .../server}/src/profile/profile-resources.ts | 0 .../server}/src/profile/profile-showcase.ts | 0 .../server}/src/profile/profile-store-cart.ts | 0 .../src/profile/profile-trophies-log.ts | 0 .../server}/src/profile/profile-unlocks.ts | 0 .../server}/src/profile/profile-upgrades.ts | 0 .../src/profile/profile-vehicle-condition.ts | 0 .../src/profile/profile-vehicle-research.ts | 0 .../src/profile/profile-vehicle-state.ts | 2 +- .../src/profile/profile-weapon-presets.ts | 0 .../server}/src/profile/profile-weapons.ts | 0 .../server}/src/profile/profile-wishlist.ts | 0 .../server}/src/profile/server-time.ts | 0 .../server}/src/profile/starting-content.ts | 0 .../server}/src/profiles-setup.ts | 0 .../server}/src/repair/repair-over-time.ts | 2 +- .../server}/src/repair/repair-rules.ts | 2 +- .../src/research/auto-research-target.ts | 0 .../src/research/crew-slot-purchase.ts | 0 .../server}/src/research/era-progress.ts | 0 .../src/research/research-efficiency.ts | 0 .../server}/src/research/research-progress.ts | 0 .../server}/src/research/research-rules.ts | 0 .../server}/src/research/research-state.ts | 2 +- .../server}/src/research/research-tuning.ts | 0 .../server}/src/research/rule-outcome.ts | 0 .../server}/src/research/squadron-research.ts | 0 .../server}/src/research/tech-tree.ts | 0 .../server}/src/research/vehicle-purchase.ts | 0 .../server}/src/research/vehicle-status.ts | 0 .../server}/src/research/vehicle-types.ts | 0 .../src/research/vehicle-unlock-rules.ts | 0 .../server}/src/save-cli.ts | 2 +- .../server}/src/saves/save-store.ts | 0 .../server}/src/saves/save-upgrades.ts | 0 .../server/src/server.ts | 14 ++-- .../server}/src/storage/atomic-file.ts | 0 .../server}/src/store/redeem-codes.ts | 0 .../server}/src/store/redeem-tuning.ts | 0 .../server}/src/store/store-catalogue.ts | 0 apps/server/src/store/store-pack-ids.ts | 14 ++++ .../server}/src/store/store-purchase.ts | 0 .../server}/src/store/store-service.ts | 2 +- .../server}/src/store/store-tuning.ts | 0 .../server}/src/store/store-web-api.ts | 2 +- .../server}/src/store/web/app.js | 0 .../server}/src/store/web/checkout.css | 0 .../server}/src/store/web/checkout.js | 0 .../server}/src/store/web/gallery.js | 0 .../server}/src/store/web/index.html | 0 .../server}/src/store/web/product.css | 0 .../server}/src/store/web/products.js | 0 .../server}/src/store/web/styles.css | 0 .../server}/src/store/yuplay-store-api.ts | 2 +- .../server}/src/traffic-log/first-bytes.ts | 0 .../server}/src/traffic-log/traffic-log.ts | 4 +- .../server/src/transport}/exchange.ts | 4 +- .../server/src/transport}/http-listener.ts | 6 +- .../server/src/transport}/port-listener.ts | 2 +- .../server/src/transport}/request-target.ts | 2 +- .../server/src/transport}/router.ts | 4 +- .../server/src/transport}/tls/der.ts | 0 .../src/transport}/tls/tls-certificate.ts | 12 ++-- .../server}/src/tuning/limits-tuning.ts | 0 .../server}/src/tuning/tuning-loader.ts | 2 +- .../server}/src/tuning/tuning-reader.ts | 0 .../server}/src/tuning/tuning.ts | 0 .../server}/src/unlocks/unlock-purchase.ts | 0 .../server}/src/web-ui/game-artwork.ts | 0 .../server}/src/web-ui/store-media-cache.ts | 4 +- .../server}/src/web-ui/web-helpers.ts | 2 +- .../server}/src/web-ui/web-ui-service.ts | 2 +- .../server}/src/web-ui/web/common.css | 0 .../server}/src/web-ui/web/common.js | 2 +- .../src/web-ui/web/official-images.json | 0 .../src/web-ui/web/official-store-media.json | 0 .../server}/tuning/battle-economy.jsonc | 0 .../server}/tuning/battle.jsonc | 0 .../server}/tuning/clans.jsonc | 0 .../server}/tuning/limits.jsonc | 0 .../server}/tuning/marketplace.jsonc | 0 .../server}/tuning/new-profile.jsonc | 0 .../server}/tuning/recycling.jsonc | 0 .../server}/tuning/redeem-codes.jsonc | 0 .../server}/tuning/research.jsonc | 0 .../server}/tuning/store.jsonc | 0 .../server}/tuning/supply-chests.jsonc | 0 .../server}/tuning/trophies.jsonc | 0 native/wto-net/src/connection_hooks.c | 4 +- native/wto-net/src/dll_main.c | 2 +- native/wto-net/src/hook_config.c | 4 +- native/wto-net/src/local_mp_awards.c | 4 +- native/wto-net/src/local_mp_offsets.h | 2 +- native/wto-net/src/local_mp_scores.c | 2 +- native/wto-net/src/redirect_rules.c | 2 +- native/wto-net/src/redirect_rules.h | 8 +-- package-lock.json | 34 +++++----- package.json | 5 +- packages/blk/src/stable-guid.ts | 2 +- packages/build/src/store/offline-bundles.ts | 42 ------------ packages/exepatch/src/definition.ts | 2 +- packages/exepatch/src/index.ts | 2 +- packages/local-service/src/index.ts | 6 -- packages/{build => patcher}/package.json | 9 ++- packages/{build => patcher}/src/char-pack.ts | 2 +- .../src/decals/offline-decal-index.ts | 0 .../src/decals/player-decal-cache.ts | 2 +- packages/{build => patcher}/src/executable.ts | 2 +- .../src/features/offline-features.ts | 0 packages/{build => patcher}/src/game-copy.ts | 0 packages/{build => patcher}/src/gui-pack.ts | 6 +- .../src/gui-patch-definition.ts | 4 +- packages/{build => patcher}/src/index.ts | 9 ++- packages/{build => patcher}/src/main-pack.ts | 2 +- .../src/network/address-rewrite.ts | 2 +- .../src/network/local-endpoint.ts | 6 +- .../src/network/login-overrides.ts | 4 +- .../src/network/network-hook.ts | 0 .../src/network/redirect-network-config.ts | 6 +- packages/{build => patcher}/src/pack-edit.ts | 0 packages/patcher/src/store/offline-bundles.ts | 25 ++++++++ .../src/tech-tree/reveal-hidden-vehicles.ts | 0 .../allow-local-host-bot-spawns/locate.jsonc | 0 .../allow-local-host-bot-spawns/patch.jsonc | 0 .../locate.jsonc | 0 .../patch.jsonc | 0 .../allow-local-host-ucav-launch/locate.jsonc | 0 .../allow-local-host-ucav-launch/patch.jsonc | 0 .../count-bots-as-active-players/locate.jsonc | 0 .../count-bots-as-active-players/patch.jsonc | 0 .../never-load-battleye/locate.jsonc | 0 .../isolation/never-load-battleye/patch.jsonc | 0 .../never-upload-crash-reports/locate.jsonc | 0 .../never-upload-crash-reports/patch.jsonc | 0 .../exe}/isolation/registry-key/locate.jsonc | 0 .../exe}/isolation/registry-key/patch.jsonc | 0 .../user-data-folder-name/locate.jsonc | 0 .../user-data-folder-name/patch.jsonc | 0 .../accept-local-tls-certificate/locate.jsonc | 0 .../accept-local-tls-certificate/patch.jsonc | 0 .../matching-server-public-key/locate.jsonc | 0 .../matching-server-public-key/patch.jsonc | 2 +- .../online/network-hook-library/locate.jsonc | 0 .../online/network-hook-library/patch.jsonc | 2 +- .../locate.jsonc | 0 .../patch.jsonc | 0 .../battle/append-extra-battle-slots/find.nut | 0 .../append-extra-battle-slots/patch.jsonc | 2 +- .../append-extra-battle-slots/replace.nut | 0 .../battle/force-extra-slot-weapons/find.nut | 0 .../force-extra-slot-weapons/patch.jsonc | 4 +- .../force-extra-slot-weapons/replace.nut | 2 +- .../launch-local-battle-from-queue/find.nut | 0 .../patch.jsonc | 2 +- .../replace.nut | 4 +- .../battle/lineup-br-for-submodes/find.nut | 0 .../battle/lineup-br-for-submodes/patch.jsonc | 0 .../battle/lineup-br-for-submodes/replace.nut | 2 +- .../battle/local-host-spawn-score/find.nut | 0 .../battle/local-host-spawn-score/patch.jsonc | 0 .../battle/local-host-spawn-score/replace.nut | 0 .../find-room-check.nut | 0 .../match-settled-battle-room-logs/find.nut | 0 .../patch.jsonc | 0 .../replace-room-check.nut | 0 .../replace.nut | 0 .../pass-spawn-modifications-blk/find.nut | 0 .../pass-spawn-modifications-blk/patch.jsonc | 0 .../pass-spawn-modifications-blk/replace.nut | 0 .../find.nut | 0 .../patch.jsonc | 0 .../replace.nut | 0 .../quit-local-host-to-debriefing/find.nut | 0 .../quit-local-host-to-debriefing/patch.jsonc | 0 .../quit-local-host-to-debriefing/replace.nut | 0 .../battle/ready-local-host-respawn/find.nut | 0 .../ready-local-host-respawn/patch.jsonc | 0 .../ready-local-host-respawn/replace.nut | 0 .../record-local-battle-awards/find.nut | 0 .../record-local-battle-awards/patch.jsonc | 2 +- .../record-local-battle-awards/replace.nut | 6 +- .../find-summary-layout.nut | 0 .../report-local-battle-settlement/find.nut | 0 .../patch.jsonc | 4 +- .../replace-summary-layout.nut | 0 .../replace.nut | 2 +- .../scoreboard-team-country-flags/find.nut | 0 .../scoreboard-team-country-flags/patch.jsonc | 0 .../scoreboard-team-country-flags/replace.nut | 0 .../find.nut | 0 .../patch.jsonc | 0 .../replace.nut | 0 .../find-after-exp.nut | 0 .../find-gather.nut | 0 .../use-settled-debriefing-stats/find.nut | 0 .../use-settled-debriefing-stats/patch.jsonc | 4 +- .../replace-after-exp.nut | 0 .../replace-gather.nut | 0 .../use-settled-debriefing-stats/replace.nut | 0 .../local-content-public-key/find.nut | 0 .../local-content-public-key/patch.jsonc | 2 +- .../local-content-public-key/replace.nut | 0 .../show-coupon-redemption-reward/find.nut | 0 .../show-coupon-redemption-reward/patch.jsonc | 0 .../show-coupon-redemption-reward/replace.nut | 0 .../find.nut | 0 .../patch.jsonc | 2 +- .../replace.nut | 0 .../find.nut | 0 .../patch.jsonc | 0 .../replace.nut | 0 .../find.nut | 0 .../patch.jsonc | 0 .../replace.nut | 0 .../free-offline-payment-method/find.nut | 0 .../free-offline-payment-method/patch.jsonc | 0 .../free-offline-payment-method/replace.nut | 0 .../localize-vehicle-pack-titles/find.nut | 0 .../localize-vehicle-pack-titles/patch.jsonc | 0 .../localize-vehicle-pack-titles/replace.nut | 0 .../find.nut | 0 .../patch.jsonc | 0 .../replace.nut | 0 .../present-saved-entitlement-grants/find.nut | 0 .../patch.jsonc | 0 .../replace.nut | 0 .../find.nut | 0 .../patch.jsonc | 0 .../replace.nut | 0 .../find.nut | 0 .../patch.jsonc | 0 .../replace.nut | 0 .../find.nut | 0 .../patch.jsonc | 0 .../replace.nut | 0 .../render-retired-entitlement-log/find.nut | 0 .../patch.jsonc | 0 .../replace.nut | 0 .../find.nut | 0 .../patch.jsonc | 0 .../replace.nut | 0 .../find.nut | 0 .../patch.jsonc | 0 .../replace.nut | 0 .../find.nut | 0 .../patch.jsonc | 0 .../replace.nut | 0 .../show-direct-entitlement-gifts/find.nut | 0 .../show-direct-entitlement-gifts/patch.jsonc | 0 .../show-direct-entitlement-gifts/replace.nut | 0 .../find.nut | 0 .../patch.jsonc | 0 .../replace.nut | 0 .../find.nut | 0 .../patch.jsonc | 0 .../replace.nut | 0 .../immediate-save-skip-tutorial/find.nut | 0 .../immediate-save-skip-tutorial/patch.jsonc | 0 .../immediate-save-skip-tutorial/replace.nut | 0 .../src/cli.ts => scripts/build-game-copy.ts | 64 +++++++++++-------- tools/src/wtotools/__init__.py | 2 +- tools/src/wtotools/cli/exe_commands.py | 6 +- tools/src/wtotools/cli/gui_commands.py | 10 +-- tools/src/wtotools/exepatch/__init__.py | 2 +- tools/src/wtotools/exepatch/definition.py | 2 +- tools/src/wtotools/gui_check.py | 2 +- tools/src/wtotools/guipatch.py | 6 +- tools/src/wtotools/jsonc.py | 2 +- tsconfig.json | 5 +- 476 files changed, 275 insertions(+), 251 deletions(-) rename {packages/local-service => apps/server}/package.json (85%) rename {packages/local-service => apps/server}/src/accounts/account-store.ts (100%) rename {packages/local-service => apps/server}/src/accounts/password.ts (100%) rename {packages/local-service => apps/server}/src/asset-pack-cli.ts (97%) rename {packages/local-service => apps/server}/src/battle/battle-boosters.ts (100%) rename {packages/local-service => apps/server}/src/battle/battle-coalitions.ts (100%) rename {packages/local-service => apps/server}/src/battle/battle-debriefing.ts (100%) rename {packages/local-service => apps/server}/src/battle/battle-economy-tuning.ts (100%) rename {packages/local-service => apps/server}/src/battle/battle-economy.ts (99%) rename {packages/local-service => apps/server}/src/battle/battle-extra-slots.ts (100%) rename {packages/local-service => apps/server}/src/battle/battle-items.ts (100%) rename {packages/local-service => apps/server}/src/battle/battle-live-log.ts (100%) rename {packages/local-service => apps/server}/src/battle/battle-matchmaker.ts (100%) rename {packages/local-service => apps/server}/src/battle/battle-mission-settings.ts (100%) rename {packages/local-service => apps/server}/src/battle/battle-ranks.ts (100%) rename {packages/local-service => apps/server}/src/battle/battle-repair.ts (100%) rename {packages/local-service => apps/server}/src/battle/battle-report.ts (98%) rename {packages/local-service => apps/server}/src/battle/battle-result-log.ts (100%) rename {packages/local-service => apps/server}/src/battle/battle-rewards.ts (100%) rename {packages/local-service => apps/server}/src/battle/battle-rp-investment.ts (100%) rename {packages/local-service => apps/server}/src/battle/battle-session-store.ts (100%) rename {packages/local-service => apps/server}/src/battle/battle-settlement.ts (100%) rename {packages/local-service => apps/server}/src/battle/battle-spawn-score.ts (100%) rename {packages/local-service => apps/server}/src/battle/battle-streak-log.ts (100%) rename {packages/local-service => apps/server}/src/battle/battle-streaks.ts (100%) rename {packages/local-service => apps/server}/src/battle/battle-support-planes.ts (100%) rename {packages/local-service => apps/server}/src/battle/battle-tuning.ts (100%) rename {packages/local-service => apps/server}/src/battle/battle-wager.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/account-context.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/action-table.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/agreement-actions.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/battle-actions.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/clan-actions.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/clan-moderation-actions.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/client-update-actions.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/cloud-settings-actions.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/crew-actions.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/crew-skill-actions.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/crew-slots-payload.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/decor-actions.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/decor-layout-actions.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/hangar-misc-actions.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/inventory-actions.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/item-actions.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/modification-actions.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/online-init-actions.ts (96%) rename {packages/local-service => apps/server}/src/char/actions/payload-params.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/player-card-actions.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/price-actions.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/price-table.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/purchase-actions.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/research-actions.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/rule-answer.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/squadron-research-actions.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/starting-info-actions.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/store-actions.ts (100%) rename {packages/local-service => apps/server}/src/char/actions/unlock-actions.ts (100%) rename {packages/local-service => apps/server}/src/char/char-action.ts (100%) rename {packages/local-service => apps/server}/src/char/char-answers.ts (96%) rename {packages/local-service => apps/server}/src/char/char-payload.ts (100%) rename {packages/local-service => apps/server}/src/char/char-service.ts (95%) rename {packages/local-service => apps/server}/src/char/compression-marker.ts (100%) rename {packages/local-service => apps/server}/src/char/pbbd-stream.ts (100%) rename {packages/local-service => apps/server}/src/chat/irc-protocol.ts (100%) rename {packages/local-service => apps/server}/src/chat/irc-server.ts (100%) rename {packages/local-service => apps/server}/src/clans/clan-blk.ts (100%) rename {packages/local-service => apps/server}/src/clans/clan-lifecycle.ts (100%) rename {packages/local-service => apps/server}/src/clans/clan-membership.ts (100%) rename {packages/local-service => apps/server}/src/clans/clan-queries.ts (100%) rename {packages/local-service => apps/server}/src/clans/clan-seeds.ts (100%) rename {packages/local-service => apps/server}/src/clans/clan-store.ts (100%) rename {packages/local-service => apps/server}/src/clans/clan-tuning.ts (100%) rename {packages/local-service => apps/server}/src/clans/clan-types.ts (100%) rename {packages/local-service => apps/server}/src/cli.ts (70%) rename {packages/local-service => apps/server}/src/cloud-settings/cloud-settings-store.ts (100%) rename {packages/local-service => apps/server}/src/crew/crew-skill-rules.ts (100%) rename {packages/local-service => apps/server}/src/crew/crew-training.ts (100%) rename {packages/local-service => apps/server}/src/decor/decor-purchase.ts (100%) rename {packages/local-service => apps/server}/src/downloadable-content/downloadable-content-service.ts (97%) rename {packages/local-service => apps/server}/src/game-data/datasets/battle-economy.ts (100%) rename {packages/local-service => apps/server}/src/game-data/datasets/battle-spawn-rules.ts (100%) rename {packages/local-service => apps/server}/src/game-data/datasets/battle-streaks.ts (100%) rename {packages/local-service => apps/server}/src/game-data/datasets/blk-fields.ts (100%) rename {packages/local-service => apps/server}/src/game-data/datasets/clan-economy.ts (100%) rename {packages/local-service => apps/server}/src/game-data/datasets/crew-skills.ts (100%) rename {packages/local-service => apps/server}/src/game-data/datasets/dataset-cache.ts (100%) rename {packages/local-service => apps/server}/src/game-data/datasets/dataset.ts (100%) rename {packages/local-service => apps/server}/src/game-data/datasets/decor-catalogue.ts (100%) rename {packages/local-service => apps/server}/src/game-data/datasets/external-item-sources.ts (100%) rename {packages/local-service => apps/server}/src/game-data/datasets/item-catalogue.ts (100%) rename {packages/local-service => apps/server}/src/game-data/datasets/lang-csv.ts (100%) rename {packages/local-service => apps/server}/src/game-data/datasets/multiplayer-missions.ts (98%) rename {packages/local-service => apps/server}/src/game-data/datasets/rank-settings.ts (100%) rename {packages/local-service => apps/server}/src/game-data/datasets/research-efficiency.ts (100%) rename {packages/local-service => apps/server}/src/game-data/datasets/research-point-rate.ts (95%) rename {packages/local-service => apps/server}/src/game-data/datasets/reserve-vehicles.ts (100%) rename {packages/local-service => apps/server}/src/game-data/datasets/shop-branches.ts (100%) rename {packages/local-service => apps/server}/src/game-data/datasets/shop-countries.ts (100%) rename {packages/local-service => apps/server}/src/game-data/datasets/shop-tree.ts (100%) rename {packages/local-service => apps/server}/src/game-data/datasets/store-bundles.ts (100%) rename {packages/local-service => apps/server}/src/game-data/datasets/ui-labels.ts (100%) rename {packages/local-service => apps/server}/src/game-data/datasets/unit-names.ts (100%) rename {packages/local-service => apps/server}/src/game-data/datasets/unlock-prices.ts (100%) rename {packages/local-service => apps/server}/src/game-data/datasets/vehicle-catalogue.ts (98%) rename {packages/local-service => apps/server}/src/game-data/datasets/vehicle-equipment.ts (100%) rename {packages/local-service => apps/server}/src/game-data/datasets/vehicle-repair.ts (100%) rename {packages/local-service => apps/server}/src/game-data/datasets/vehicle-unlocks.ts (100%) rename {packages/local-service => apps/server}/src/game-data/datasets/web-icons.ts (100%) rename {packages/local-service => apps/server}/src/game-data/game-files.ts (90%) rename {packages/local-service => apps/server}/src/game-data/game-pack.ts (100%) rename {packages/local-service => apps/server}/src/game-modes/catalogue/catalogue.ts (100%) rename {packages/local-service => apps/server}/src/game-modes/catalogue/game-mode-declaration.ts (100%) rename {packages/local-service => apps/server}/src/game-modes/catalogue/mission-pools.ts (100%) rename {packages/local-service => apps/server}/src/game-modes/catalogue/pve-battles.ts (100%) rename {packages/local-service => apps/server}/src/game-modes/catalogue/random-battles.ts (100%) rename {packages/local-service => apps/server}/src/game-modes/catalogue/simulator-battles.ts (100%) rename {packages/local-service => apps/server}/src/game-modes/catalogue/special-events.ts (100%) rename {packages/local-service => apps/server}/src/game-modes/catalogue/sub-game-modes.ts (100%) rename {packages/local-service => apps/server}/src/game-modes/game-modes.ts (100%) rename {packages/local-service => apps/server}/src/game-modes/mission-pool.ts (100%) rename {packages/local-service => apps/server}/src/game-modes/mode-definition.ts (100%) create mode 100644 apps/server/src/index.ts rename {packages/local-service => apps/server}/src/inventory/chest-defs.ts (100%) rename {packages/local-service => apps/server}/src/inventory/content-sign/content-signature.ts (96%) rename {packages/local-service => apps/server}/src/inventory/content-sign/local-inventory-content.key.pem (100%) rename {packages/local-service => apps/server}/src/inventory/coupons/cosmetic-coupons.ts (100%) rename {packages/local-service => apps/server}/src/inventory/coupons/vehicle-coupons.ts (100%) rename {packages/local-service => apps/server}/src/inventory/inventory-rules.ts (100%) rename {packages/local-service => apps/server}/src/inventory/inventory-service.ts (99%) rename {packages/local-service => apps/server}/src/inventory/inventory-wire.ts (100%) rename {packages/local-service => apps/server}/src/inventory/itemdef-catalogue.ts (100%) rename {packages/local-service => apps/server}/src/inventory/itemdef-types.ts (100%) rename {packages/local-service => apps/server}/src/inventory/marketplace-sell.ts (100%) rename {packages/local-service => apps/server}/src/inventory/marketplace-service.ts (99%) rename {packages/local-service => apps/server}/src/inventory/marketplace-tuning.ts (100%) rename {packages/local-service => apps/server}/src/inventory/recycling-defs.ts (100%) rename {packages/local-service => apps/server}/src/inventory/recycling-tuning.ts (100%) rename {packages/local-service => apps/server}/src/inventory/supply-chest-tuning.ts (100%) rename {packages/local-service => apps/server}/src/inventory/trophy-catalogue.ts (100%) rename {packages/local-service => apps/server}/src/inventory/trophy-tuning.ts (100%) rename {packages/local-service => apps/server}/src/inventory/web/app.js (100%) rename {packages/local-service => apps/server}/src/inventory/web/index.html (100%) rename {packages/local-service => apps/server}/src/inventory/web/styles.css (100%) rename {packages/local-service => apps/server}/src/items/item-activation.ts (100%) rename {packages/local-service => apps/server}/src/items/item-catalogue.ts (100%) rename {packages/local-service => apps/server}/src/items/item-expiry.ts (100%) rename {packages/local-service => apps/server}/src/items/item-grants.ts (100%) rename {packages/local-service => apps/server}/src/items/item-purchase.ts (100%) rename {packages/local-service => apps/server}/src/items/personal-discounts.ts (100%) rename {packages/local-service => apps/server}/src/items/universal-spares.ts (100%) rename {packages/local-service => apps/server}/src/login/form-redaction.ts (100%) rename {packages/local-service => apps/server}/src/login/login-service.ts (98%) rename {packages/local-service => apps/server}/src/login/session-credentials.ts (100%) rename {packages/local-service => apps/server}/src/login/yuplay-answer.ts (91%) rename {packages/local-service => apps/server}/src/matching/battle-launch-notify.ts (98%) rename {packages/local-service => apps/server}/src/matching/battle-live-requests.ts (98%) rename {packages/local-service => apps/server}/src/matching/battle-queue-requests.ts (100%) rename {packages/local-service => apps/server}/src/matching/cluster-list.ts (100%) rename {packages/local-service => apps/server}/src/matching/game-modes-requests.ts (100%) rename {packages/local-service => apps/server}/src/matching/game-settings.ts (100%) rename {packages/local-service => apps/server}/src/matching/lz4-block.ts (100%) rename {packages/local-service => apps/server}/src/matching/matching-frame.ts (100%) rename {packages/local-service => apps/server}/src/matching/matching-message.ts (100%) rename {packages/local-service => apps/server}/src/matching/matching-requests.ts (100%) rename {packages/local-service => apps/server}/src/matching/matching-service.ts (98%) rename {packages/local-service => apps/server}/src/matching/message-redaction.ts (100%) rename {packages/local-service => apps/server}/src/matching/session-crypto/encrypted-envelope.ts (100%) rename {packages/local-service => apps/server}/src/matching/session-crypto/local-matching-server.key.pem (100%) rename {packages/local-service => apps/server}/src/matching/session-crypto/session-key.ts (97%) rename {packages/local-service => apps/server}/src/modifications/ammo-refill.ts (100%) rename {packages/local-service => apps/server}/src/modifications/equipment-catalogue.ts (100%) rename {packages/local-service => apps/server}/src/modifications/modification-purchase.ts (100%) rename {packages/local-service => apps/server}/src/modifications/module-research-target.ts (100%) rename {packages/local-service => apps/server}/src/modifications/module-state.ts (100%) rename {packages/local-service => apps/server}/src/modifications/module-status.ts (100%) rename {packages/local-service => apps/server}/src/modifications/spare-purchase.ts (100%) rename {packages/local-service => apps/server}/src/modifications/support-plane-modifications.ts (100%) rename {packages/local-service => apps/server}/src/modifications/weapon-presets.ts (100%) rename {packages/local-service => apps/server}/src/modifications/weapon-purchase.ts (100%) rename {packages/local-service => apps/server}/src/player-card/player-card-rules.ts (100%) rename {packages/local-service => apps/server}/src/player-card/showcase-rules.ts (100%) rename {packages/local-service => apps/server}/src/profile/blk-fields.ts (100%) rename {packages/local-service => apps/server}/src/profile/client-profile.ts (100%) rename {packages/local-service => apps/server}/src/profile/crew-slots.ts (100%) rename {packages/local-service => apps/server}/src/profile/new-profile-tuning.ts (100%) rename {packages/local-service => apps/server}/src/profile/new-profile.ts (100%) rename {packages/local-service => apps/server}/src/profile/player-profiles.ts (100%) rename {packages/local-service => apps/server}/src/profile/profile-appearance.ts (96%) rename {packages/local-service => apps/server}/src/profile/profile-clan.ts (100%) rename {packages/local-service => apps/server}/src/profile/profile-client-settings.ts (100%) rename {packages/local-service => apps/server}/src/profile/profile-crew-skills.ts (98%) rename {packages/local-service => apps/server}/src/profile/profile-crews.ts (100%) rename {packages/local-service => apps/server}/src/profile/profile-currency.ts (100%) rename {packages/local-service => apps/server}/src/profile/profile-decor-layouts.ts (97%) rename {packages/local-service => apps/server}/src/profile/profile-dest-rp.ts (100%) rename {packages/local-service => apps/server}/src/profile/profile-entitlements.ts (100%) rename {packages/local-service => apps/server}/src/profile/profile-eras.ts (100%) rename {packages/local-service => apps/server}/src/profile/profile-external-inventory.ts (100%) rename {packages/local-service => apps/server}/src/profile/profile-hangar.ts (100%) rename {packages/local-service => apps/server}/src/profile/profile-items.ts (100%) rename {packages/local-service => apps/server}/src/profile/profile-mission-progress.ts (100%) rename {packages/local-service => apps/server}/src/profile/profile-modifications.ts (100%) rename {packages/local-service => apps/server}/src/profile/profile-module-research.ts (100%) rename {packages/local-service => apps/server}/src/profile/profile-research-bonus.ts (94%) rename {packages/local-service => apps/server}/src/profile/profile-research-points.ts (100%) rename {packages/local-service => apps/server}/src/profile/profile-research-targets.ts (100%) rename {packages/local-service => apps/server}/src/profile/profile-resources.ts (100%) rename {packages/local-service => apps/server}/src/profile/profile-showcase.ts (100%) rename {packages/local-service => apps/server}/src/profile/profile-store-cart.ts (100%) rename {packages/local-service => apps/server}/src/profile/profile-trophies-log.ts (100%) rename {packages/local-service => apps/server}/src/profile/profile-unlocks.ts (100%) rename {packages/local-service => apps/server}/src/profile/profile-upgrades.ts (100%) rename {packages/local-service => apps/server}/src/profile/profile-vehicle-condition.ts (100%) rename {packages/local-service => apps/server}/src/profile/profile-vehicle-research.ts (100%) rename {packages/local-service => apps/server}/src/profile/profile-vehicle-state.ts (98%) rename {packages/local-service => apps/server}/src/profile/profile-weapon-presets.ts (100%) rename {packages/local-service => apps/server}/src/profile/profile-weapons.ts (100%) rename {packages/local-service => apps/server}/src/profile/profile-wishlist.ts (100%) rename {packages/local-service => apps/server}/src/profile/server-time.ts (100%) rename {packages/local-service => apps/server}/src/profile/starting-content.ts (100%) rename {packages/local-service => apps/server}/src/profiles-setup.ts (100%) rename {packages/local-service => apps/server}/src/repair/repair-over-time.ts (95%) rename {packages/local-service => apps/server}/src/repair/repair-rules.ts (99%) rename {packages/local-service => apps/server}/src/research/auto-research-target.ts (100%) rename {packages/local-service => apps/server}/src/research/crew-slot-purchase.ts (100%) rename {packages/local-service => apps/server}/src/research/era-progress.ts (100%) rename {packages/local-service => apps/server}/src/research/research-efficiency.ts (100%) rename {packages/local-service => apps/server}/src/research/research-progress.ts (100%) rename {packages/local-service => apps/server}/src/research/research-rules.ts (100%) rename {packages/local-service => apps/server}/src/research/research-state.ts (98%) rename {packages/local-service => apps/server}/src/research/research-tuning.ts (100%) rename {packages/local-service => apps/server}/src/research/rule-outcome.ts (100%) rename {packages/local-service => apps/server}/src/research/squadron-research.ts (100%) rename {packages/local-service => apps/server}/src/research/tech-tree.ts (100%) rename {packages/local-service => apps/server}/src/research/vehicle-purchase.ts (100%) rename {packages/local-service => apps/server}/src/research/vehicle-status.ts (100%) rename {packages/local-service => apps/server}/src/research/vehicle-types.ts (100%) rename {packages/local-service => apps/server}/src/research/vehicle-unlock-rules.ts (100%) rename {packages/local-service => apps/server}/src/save-cli.ts (99%) rename {packages/local-service => apps/server}/src/saves/save-store.ts (100%) rename {packages/local-service => apps/server}/src/saves/save-upgrades.ts (100%) rename packages/local-service/src/local-service.ts => apps/server/src/server.ts (95%) rename {packages/local-service => apps/server}/src/storage/atomic-file.ts (100%) rename {packages/local-service => apps/server}/src/store/redeem-codes.ts (100%) rename {packages/local-service => apps/server}/src/store/redeem-tuning.ts (100%) rename {packages/local-service => apps/server}/src/store/store-catalogue.ts (100%) create mode 100644 apps/server/src/store/store-pack-ids.ts rename {packages/local-service => apps/server}/src/store/store-purchase.ts (100%) rename {packages/local-service => apps/server}/src/store/store-service.ts (98%) rename {packages/local-service => apps/server}/src/store/store-tuning.ts (100%) rename {packages/local-service => apps/server}/src/store/store-web-api.ts (99%) rename {packages/local-service => apps/server}/src/store/web/app.js (100%) rename {packages/local-service => apps/server}/src/store/web/checkout.css (100%) rename {packages/local-service => apps/server}/src/store/web/checkout.js (100%) rename {packages/local-service => apps/server}/src/store/web/gallery.js (100%) rename {packages/local-service => apps/server}/src/store/web/index.html (100%) rename {packages/local-service => apps/server}/src/store/web/product.css (100%) rename {packages/local-service => apps/server}/src/store/web/products.js (100%) rename {packages/local-service => apps/server}/src/store/web/styles.css (100%) rename {packages/local-service => apps/server}/src/store/yuplay-store-api.ts (98%) rename {packages/local-service => apps/server}/src/traffic-log/first-bytes.ts (100%) rename {packages/local-service => apps/server}/src/traffic-log/traffic-log.ts (97%) rename {packages/local-service/src/server => apps/server/src/transport}/exchange.ts (91%) rename {packages/local-service/src/server => apps/server/src/transport}/http-listener.ts (92%) rename {packages/local-service/src/server => apps/server/src/transport}/port-listener.ts (97%) rename {packages/local-service/src/server => apps/server/src/transport}/request-target.ts (97%) rename {packages/local-service/src/server => apps/server/src/transport}/router.ts (86%) rename {packages/local-service/src/server => apps/server/src/transport}/tls/der.ts (100%) rename {packages/local-service/src/server => apps/server/src/transport}/tls/tls-certificate.ts (89%) rename {packages/local-service => apps/server}/src/tuning/limits-tuning.ts (100%) rename {packages/local-service => apps/server}/src/tuning/tuning-loader.ts (95%) rename {packages/local-service => apps/server}/src/tuning/tuning-reader.ts (100%) rename {packages/local-service => apps/server}/src/tuning/tuning.ts (100%) rename {packages/local-service => apps/server}/src/unlocks/unlock-purchase.ts (100%) rename {packages/local-service => apps/server}/src/web-ui/game-artwork.ts (100%) rename {packages/local-service => apps/server}/src/web-ui/store-media-cache.ts (96%) rename {packages/local-service => apps/server}/src/web-ui/web-helpers.ts (98%) rename {packages/local-service => apps/server}/src/web-ui/web-ui-service.ts (99%) rename {packages/local-service => apps/server}/src/web-ui/web/common.css (100%) rename {packages/local-service => apps/server}/src/web-ui/web/common.js (99%) rename {packages/local-service => apps/server}/src/web-ui/web/official-images.json (100%) rename {packages/local-service => apps/server}/src/web-ui/web/official-store-media.json (100%) rename {packages/local-service => apps/server}/tuning/battle-economy.jsonc (100%) rename {packages/local-service => apps/server}/tuning/battle.jsonc (100%) rename {packages/local-service => apps/server}/tuning/clans.jsonc (100%) rename {packages/local-service => apps/server}/tuning/limits.jsonc (100%) rename {packages/local-service => apps/server}/tuning/marketplace.jsonc (100%) rename {packages/local-service => apps/server}/tuning/new-profile.jsonc (100%) rename {packages/local-service => apps/server}/tuning/recycling.jsonc (100%) rename {packages/local-service => apps/server}/tuning/redeem-codes.jsonc (100%) rename {packages/local-service => apps/server}/tuning/research.jsonc (100%) rename {packages/local-service => apps/server}/tuning/store.jsonc (100%) rename {packages/local-service => apps/server}/tuning/supply-chests.jsonc (100%) rename {packages/local-service => apps/server}/tuning/trophies.jsonc (100%) delete mode 100644 packages/build/src/store/offline-bundles.ts delete mode 100644 packages/local-service/src/index.ts rename packages/{build => patcher}/package.json (52%) rename packages/{build => patcher}/src/char-pack.ts (98%) rename packages/{build => patcher}/src/decals/offline-decal-index.ts (100%) rename packages/{build => patcher}/src/decals/player-decal-cache.ts (97%) rename packages/{build => patcher}/src/executable.ts (89%) rename packages/{build => patcher}/src/features/offline-features.ts (100%) rename packages/{build => patcher}/src/game-copy.ts (100%) rename packages/{build => patcher}/src/gui-pack.ts (93%) rename packages/{build => patcher}/src/gui-patch-definition.ts (98%) rename packages/{build => patcher}/src/index.ts (61%) rename packages/{build => patcher}/src/main-pack.ts (98%) rename packages/{build => patcher}/src/network/address-rewrite.ts (97%) rename packages/{build => patcher}/src/network/local-endpoint.ts (81%) rename packages/{build => patcher}/src/network/login-overrides.ts (89%) rename packages/{build => patcher}/src/network/network-hook.ts (100%) rename packages/{build => patcher}/src/network/redirect-network-config.ts (95%) rename packages/{build => patcher}/src/pack-edit.ts (100%) create mode 100644 packages/patcher/src/store/offline-bundles.ts rename packages/{build => patcher}/src/tech-tree/reveal-hidden-vehicles.ts (100%) rename {exe-patches => patches/exe}/battle/allow-local-host-bot-spawns/locate.jsonc (100%) rename {exe-patches => patches/exe}/battle/allow-local-host-bot-spawns/patch.jsonc (100%) rename {exe-patches => patches/exe}/battle/allow-local-host-player-respawn/locate.jsonc (100%) rename {exe-patches => patches/exe}/battle/allow-local-host-player-respawn/patch.jsonc (100%) rename {exe-patches => patches/exe}/battle/allow-local-host-ucav-launch/locate.jsonc (100%) rename {exe-patches => patches/exe}/battle/allow-local-host-ucav-launch/patch.jsonc (100%) rename {exe-patches => patches/exe}/battle/count-bots-as-active-players/locate.jsonc (100%) rename {exe-patches => patches/exe}/battle/count-bots-as-active-players/patch.jsonc (100%) rename {exe-patches => patches/exe}/isolation/never-load-battleye/locate.jsonc (100%) rename {exe-patches => patches/exe}/isolation/never-load-battleye/patch.jsonc (100%) rename {exe-patches => patches/exe}/isolation/never-upload-crash-reports/locate.jsonc (100%) rename {exe-patches => patches/exe}/isolation/never-upload-crash-reports/patch.jsonc (100%) rename {exe-patches => patches/exe}/isolation/registry-key/locate.jsonc (100%) rename {exe-patches => patches/exe}/isolation/registry-key/patch.jsonc (100%) rename {exe-patches => patches/exe}/isolation/user-data-folder-name/locate.jsonc (100%) rename {exe-patches => patches/exe}/isolation/user-data-folder-name/patch.jsonc (100%) rename {exe-patches => patches/exe}/online/accept-local-tls-certificate/locate.jsonc (100%) rename {exe-patches => patches/exe}/online/accept-local-tls-certificate/patch.jsonc (100%) rename {exe-patches => patches/exe}/online/matching-server-public-key/locate.jsonc (100%) rename {exe-patches => patches/exe}/online/matching-server-public-key/patch.jsonc (97%) rename {exe-patches => patches/exe}/online/network-hook-library/locate.jsonc (100%) rename {exe-patches => patches/exe}/online/network-hook-library/patch.jsonc (93%) rename {exe-patches => patches/exe}/startup/skip-resource-archive-signature-check/locate.jsonc (100%) rename {exe-patches => patches/exe}/startup/skip-resource-archive-signature-check/patch.jsonc (100%) rename {gui-patches => patches/gui}/battle/append-extra-battle-slots/find.nut (100%) rename {gui-patches => patches/gui}/battle/append-extra-battle-slots/patch.jsonc (86%) rename {gui-patches => patches/gui}/battle/append-extra-battle-slots/replace.nut (100%) rename {gui-patches => patches/gui}/battle/force-extra-slot-weapons/find.nut (100%) rename {gui-patches => patches/gui}/battle/force-extra-slot-weapons/patch.jsonc (74%) rename {gui-patches => patches/gui}/battle/force-extra-slot-weapons/replace.nut (86%) rename {gui-patches => patches/gui}/battle/launch-local-battle-from-queue/find.nut (100%) rename {gui-patches => patches/gui}/battle/launch-local-battle-from-queue/patch.jsonc (88%) rename {gui-patches => patches/gui}/battle/launch-local-battle-from-queue/replace.nut (93%) rename {gui-patches => patches/gui}/battle/lineup-br-for-submodes/find.nut (100%) rename {gui-patches => patches/gui}/battle/lineup-br-for-submodes/patch.jsonc (100%) rename {gui-patches => patches/gui}/battle/lineup-br-for-submodes/replace.nut (81%) rename {gui-patches => patches/gui}/battle/local-host-spawn-score/find.nut (100%) rename {gui-patches => patches/gui}/battle/local-host-spawn-score/patch.jsonc (100%) rename {gui-patches => patches/gui}/battle/local-host-spawn-score/replace.nut (100%) rename {gui-patches => patches/gui}/battle/match-settled-battle-room-logs/find-room-check.nut (100%) rename {gui-patches => patches/gui}/battle/match-settled-battle-room-logs/find.nut (100%) rename {gui-patches => patches/gui}/battle/match-settled-battle-room-logs/patch.jsonc (100%) rename {gui-patches => patches/gui}/battle/match-settled-battle-room-logs/replace-room-check.nut (100%) rename {gui-patches => patches/gui}/battle/match-settled-battle-room-logs/replace.nut (100%) rename {gui-patches => patches/gui}/battle/pass-spawn-modifications-blk/find.nut (100%) rename {gui-patches => patches/gui}/battle/pass-spawn-modifications-blk/patch.jsonc (100%) rename {gui-patches => patches/gui}/battle/pass-spawn-modifications-blk/replace.nut (100%) rename {gui-patches => patches/gui}/battle/quit-local-host-spectator-to-debriefing/find.nut (100%) rename {gui-patches => patches/gui}/battle/quit-local-host-spectator-to-debriefing/patch.jsonc (100%) rename {gui-patches => patches/gui}/battle/quit-local-host-spectator-to-debriefing/replace.nut (100%) rename {gui-patches => patches/gui}/battle/quit-local-host-to-debriefing/find.nut (100%) rename {gui-patches => patches/gui}/battle/quit-local-host-to-debriefing/patch.jsonc (100%) rename {gui-patches => patches/gui}/battle/quit-local-host-to-debriefing/replace.nut (100%) rename {gui-patches => patches/gui}/battle/ready-local-host-respawn/find.nut (100%) rename {gui-patches => patches/gui}/battle/ready-local-host-respawn/patch.jsonc (100%) rename {gui-patches => patches/gui}/battle/ready-local-host-respawn/replace.nut (100%) rename {gui-patches => patches/gui}/battle/record-local-battle-awards/find.nut (100%) rename {gui-patches => patches/gui}/battle/record-local-battle-awards/patch.jsonc (96%) rename {gui-patches => patches/gui}/battle/record-local-battle-awards/replace.nut (97%) rename {gui-patches => patches/gui}/battle/report-local-battle-settlement/find-summary-layout.nut (100%) rename {gui-patches => patches/gui}/battle/report-local-battle-settlement/find.nut (100%) rename {gui-patches => patches/gui}/battle/report-local-battle-settlement/patch.jsonc (79%) rename {gui-patches => patches/gui}/battle/report-local-battle-settlement/replace-summary-layout.nut (100%) rename {gui-patches => patches/gui}/battle/report-local-battle-settlement/replace.nut (99%) rename {gui-patches => patches/gui}/battle/scoreboard-team-country-flags/find.nut (100%) rename {gui-patches => patches/gui}/battle/scoreboard-team-country-flags/patch.jsonc (100%) rename {gui-patches => patches/gui}/battle/scoreboard-team-country-flags/replace.nut (100%) rename {gui-patches => patches/gui}/battle/stabilize-respawn-countdown-button/find.nut (100%) rename {gui-patches => patches/gui}/battle/stabilize-respawn-countdown-button/patch.jsonc (100%) rename {gui-patches => patches/gui}/battle/stabilize-respawn-countdown-button/replace.nut (100%) rename {gui-patches => patches/gui}/battle/use-settled-debriefing-stats/find-after-exp.nut (100%) rename {gui-patches => patches/gui}/battle/use-settled-debriefing-stats/find-gather.nut (100%) rename {gui-patches => patches/gui}/battle/use-settled-debriefing-stats/find.nut (100%) rename {gui-patches => patches/gui}/battle/use-settled-debriefing-stats/patch.jsonc (88%) rename {gui-patches => patches/gui}/battle/use-settled-debriefing-stats/replace-after-exp.nut (100%) rename {gui-patches => patches/gui}/battle/use-settled-debriefing-stats/replace-gather.nut (100%) rename {gui-patches => patches/gui}/battle/use-settled-debriefing-stats/replace.nut (100%) rename {gui-patches => patches/gui}/inventory/local-content-public-key/find.nut (100%) rename {gui-patches => patches/gui}/inventory/local-content-public-key/patch.jsonc (93%) rename {gui-patches => patches/gui}/inventory/local-content-public-key/replace.nut (100%) rename {gui-patches => patches/gui}/inventory/show-coupon-redemption-reward/find.nut (100%) rename {gui-patches => patches/gui}/inventory/show-coupon-redemption-reward/patch.jsonc (100%) rename {gui-patches => patches/gui}/inventory/show-coupon-redemption-reward/replace.nut (100%) rename {gui-patches => patches/gui}/online-shop/bypass-external-sso-for-local-urls/find.nut (100%) rename {gui-patches => patches/gui}/online-shop/bypass-external-sso-for-local-urls/patch.jsonc (97%) rename {gui-patches => patches/gui}/online-shop/bypass-external-sso-for-local-urls/replace.nut (100%) rename {gui-patches => patches/gui}/online-shop/collect-entitlement-purchase-rewards/find.nut (100%) rename {gui-patches => patches/gui}/online-shop/collect-entitlement-purchase-rewards/patch.jsonc (100%) rename {gui-patches => patches/gui}/online-shop/collect-entitlement-purchase-rewards/replace.nut (100%) rename {gui-patches => patches/gui}/online-shop/defer-explicit-browser-update-to-close/find.nut (100%) rename {gui-patches => patches/gui}/online-shop/defer-explicit-browser-update-to-close/patch.jsonc (100%) rename {gui-patches => patches/gui}/online-shop/defer-explicit-browser-update-to-close/replace.nut (100%) rename {gui-patches => patches/gui}/online-shop/free-offline-payment-method/find.nut (100%) rename {gui-patches => patches/gui}/online-shop/free-offline-payment-method/patch.jsonc (100%) rename {gui-patches => patches/gui}/online-shop/free-offline-payment-method/replace.nut (100%) rename {gui-patches => patches/gui}/online-shop/localize-vehicle-pack-titles/find.nut (100%) rename {gui-patches => patches/gui}/online-shop/localize-vehicle-pack-titles/patch.jsonc (100%) rename {gui-patches => patches/gui}/online-shop/localize-vehicle-pack-titles/replace.nut (100%) rename {gui-patches => patches/gui}/online-shop/open-entitlement-purchase-receipts/find.nut (100%) rename {gui-patches => patches/gui}/online-shop/open-entitlement-purchase-receipts/patch.jsonc (100%) rename {gui-patches => patches/gui}/online-shop/open-entitlement-purchase-receipts/replace.nut (100%) rename {gui-patches => patches/gui}/online-shop/present-saved-entitlement-grants/find.nut (100%) rename {gui-patches => patches/gui}/online-shop/present-saved-entitlement-grants/patch.jsonc (100%) rename {gui-patches => patches/gui}/online-shop/present-saved-entitlement-grants/replace.nut (100%) rename {gui-patches => patches/gui}/online-shop/refresh-profile-after-browser-close/find.nut (100%) rename {gui-patches => patches/gui}/online-shop/refresh-profile-after-browser-close/patch.jsonc (100%) rename {gui-patches => patches/gui}/online-shop/refresh-profile-after-browser-close/replace.nut (100%) rename {gui-patches => patches/gui}/online-shop/refresh-profile-after-currency-shop-close/find.nut (100%) rename {gui-patches => patches/gui}/online-shop/refresh-profile-after-currency-shop-close/patch.jsonc (100%) rename {gui-patches => patches/gui}/online-shop/refresh-profile-after-currency-shop-close/replace.nut (100%) rename {gui-patches => patches/gui}/online-shop/refresh-profile-after-premium-shop-close/find.nut (100%) rename {gui-patches => patches/gui}/online-shop/refresh-profile-after-premium-shop-close/patch.jsonc (100%) rename {gui-patches => patches/gui}/online-shop/refresh-profile-after-premium-shop-close/replace.nut (100%) rename {gui-patches => patches/gui}/online-shop/render-retired-entitlement-log/find.nut (100%) rename {gui-patches => patches/gui}/online-shop/render-retired-entitlement-log/patch.jsonc (100%) rename {gui-patches => patches/gui}/online-shop/render-retired-entitlement-log/replace.nut (100%) rename {gui-patches => patches/gui}/online-shop/resume-purchase-receipts-after-price-update/find.nut (100%) rename {gui-patches => patches/gui}/online-shop/resume-purchase-receipts-after-price-update/patch.jsonc (100%) rename {gui-patches => patches/gui}/online-shop/resume-purchase-receipts-after-price-update/replace.nut (100%) rename {gui-patches => patches/gui}/online-shop/return-entitlement-reward-handler/find.nut (100%) rename {gui-patches => patches/gui}/online-shop/return-entitlement-reward-handler/patch.jsonc (100%) rename {gui-patches => patches/gui}/online-shop/return-entitlement-reward-handler/replace.nut (100%) rename {gui-patches => patches/gui}/online-shop/show-direct-entitlement-gift-icons/find.nut (100%) rename {gui-patches => patches/gui}/online-shop/show-direct-entitlement-gift-icons/patch.jsonc (100%) rename {gui-patches => patches/gui}/online-shop/show-direct-entitlement-gift-icons/replace.nut (100%) rename {gui-patches => patches/gui}/online-shop/show-direct-entitlement-gifts/find.nut (100%) rename {gui-patches => patches/gui}/online-shop/show-direct-entitlement-gifts/patch.jsonc (100%) rename {gui-patches => patches/gui}/online-shop/show-direct-entitlement-gifts/replace.nut (100%) rename {gui-patches => patches/gui}/online-shop/show-entitlement-purchase-rewards/find.nut (100%) rename {gui-patches => patches/gui}/online-shop/show-entitlement-purchase-rewards/patch.jsonc (100%) rename {gui-patches => patches/gui}/online-shop/show-entitlement-purchase-rewards/replace.nut (100%) rename {gui-patches => patches/gui}/online-shop/use-entitlement-receipt-for-native-payment/find.nut (100%) rename {gui-patches => patches/gui}/online-shop/use-entitlement-receipt-for-native-payment/patch.jsonc (100%) rename {gui-patches => patches/gui}/online-shop/use-entitlement-receipt-for-native-payment/replace.nut (100%) rename {gui-patches => patches/gui}/tutorials/immediate-save-skip-tutorial/find.nut (100%) rename {gui-patches => patches/gui}/tutorials/immediate-save-skip-tutorial/patch.jsonc (100%) rename {gui-patches => patches/gui}/tutorials/immediate-save-skip-tutorial/replace.nut (100%) rename packages/build/src/cli.ts => scripts/build-game-copy.ts (67%) diff --git a/README.md b/README.md index 3bdf393..bba120d 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,16 @@ 《战争雷霆》离线版。目标客户端版本:Steam 2.61.0.37。 -做法和 SPT 一样:客户端的所有联网请求改到本机,由本地服务模拟 Gaijin 的服务器。 +做法和 SPT 一样:客户端的所有联网请求改到本机,由本地服务器模拟 Gaijin 的服务器。 本仓库不包含任何游戏文件。构建时从一个游戏文件夹读取原版文件。 | 目录 | 内容 | |---|---| -| `packages/` | TypeScript(npm workspace):BLK 编解码、数据包读写、exe 补丁应用、构建流程、本地服务,以后还有启动器 | -| `tools/` | Python 开发端工具:数据包读写、exe 补丁引擎(特征码生成、汇编核对) | -| `exe-patches/` | exe 补丁定义 | +| `apps/server/` | 本地服务器(TypeScript):模拟 Gaijin 的登录、档案、匹配、商店等服务器 | +| `packages/` | 共用的 TypeScript 库(npm workspace):BLK 编解码(`blk`)、数据包读写(`vromfs`)、JSONC(`jsonc`)、exe 补丁引擎(`exepatch`)、构建游戏副本(`patcher`) | +| `patches/exe/` | exe 补丁定义 | +| `patches/gui/` | 界面脚本补丁定义 | +| `native/` | 网络钩子与本地对局模块 `wto_ws.dll`(C) | +| `scripts/` | 开发用的 TypeScript 脚本(如 `build-game-copy.ts` 构建游戏副本) | +| `tools/` | Python 开发端工具:数据包读写、exe 补丁核对(特征码生成、汇编核对)、界面补丁编译检查 | diff --git a/packages/local-service/package.json b/apps/server/package.json similarity index 85% rename from packages/local-service/package.json rename to apps/server/package.json index d43cc38..762e9d8 100644 --- a/packages/local-service/package.json +++ b/apps/server/package.json @@ -1,5 +1,5 @@ { - "name": "@wto/local-service", + "name": "@wto/server", "version": "0.1.0", "private": true, "type": "module", @@ -11,4 +11,4 @@ "@wto/jsonc": "*", "@wto/vromfs": "*" } -} +} \ No newline at end of file diff --git a/packages/local-service/src/accounts/account-store.ts b/apps/server/src/accounts/account-store.ts similarity index 100% rename from packages/local-service/src/accounts/account-store.ts rename to apps/server/src/accounts/account-store.ts diff --git a/packages/local-service/src/accounts/password.ts b/apps/server/src/accounts/password.ts similarity index 100% rename from packages/local-service/src/accounts/password.ts rename to apps/server/src/accounts/password.ts diff --git a/packages/local-service/src/asset-pack-cli.ts b/apps/server/src/asset-pack-cli.ts similarity index 97% rename from packages/local-service/src/asset-pack-cli.ts rename to apps/server/src/asset-pack-cli.ts index fb4d752..303877c 100644 --- a/packages/local-service/src/asset-pack-cli.ts +++ b/apps/server/src/asset-pack-cli.ts @@ -4,7 +4,7 @@ * connection. Run it on a machine that can reach the official sites; nothing is shipped with * the project, every player makes their own copy. * - * node packages/local-service/src/asset-pack-cli.ts --data [--concurrency 6] + * node apps/server/src/asset-pack-cli.ts --data [--concurrency 6] * * Sources: official marketplace art and vehicle renders, plus store covers and screenshots. * The storefront links videos directly. diff --git a/packages/local-service/src/battle/battle-boosters.ts b/apps/server/src/battle/battle-boosters.ts similarity index 100% rename from packages/local-service/src/battle/battle-boosters.ts rename to apps/server/src/battle/battle-boosters.ts diff --git a/packages/local-service/src/battle/battle-coalitions.ts b/apps/server/src/battle/battle-coalitions.ts similarity index 100% rename from packages/local-service/src/battle/battle-coalitions.ts rename to apps/server/src/battle/battle-coalitions.ts diff --git a/packages/local-service/src/battle/battle-debriefing.ts b/apps/server/src/battle/battle-debriefing.ts similarity index 100% rename from packages/local-service/src/battle/battle-debriefing.ts rename to apps/server/src/battle/battle-debriefing.ts diff --git a/packages/local-service/src/battle/battle-economy-tuning.ts b/apps/server/src/battle/battle-economy-tuning.ts similarity index 100% rename from packages/local-service/src/battle/battle-economy-tuning.ts rename to apps/server/src/battle/battle-economy-tuning.ts diff --git a/packages/local-service/src/battle/battle-economy.ts b/apps/server/src/battle/battle-economy.ts similarity index 99% rename from packages/local-service/src/battle/battle-economy.ts rename to apps/server/src/battle/battle-economy.ts index 1d26daf..eab0d02 100644 --- a/packages/local-service/src/battle/battle-economy.ts +++ b/apps/server/src/battle/battle-economy.ts @@ -32,7 +32,7 @@ export type DebriefingRow = | 'Assist' | 'AirSevereDamage' | 'ShipSevereDamage' | 'Critical' | 'Hit' | 'Captures' | 'AwardDamage'; -/** What the client reports for one combat event (gui-patches/battle/record-local-battle-awards). */ +/** What the client reports for one combat event (patches/gui/battle/record-local-battle-awards). */ export interface CombatEventFact { readonly code: number; readonly expClass: string; diff --git a/packages/local-service/src/battle/battle-extra-slots.ts b/apps/server/src/battle/battle-extra-slots.ts similarity index 100% rename from packages/local-service/src/battle/battle-extra-slots.ts rename to apps/server/src/battle/battle-extra-slots.ts diff --git a/packages/local-service/src/battle/battle-items.ts b/apps/server/src/battle/battle-items.ts similarity index 100% rename from packages/local-service/src/battle/battle-items.ts rename to apps/server/src/battle/battle-items.ts diff --git a/packages/local-service/src/battle/battle-live-log.ts b/apps/server/src/battle/battle-live-log.ts similarity index 100% rename from packages/local-service/src/battle/battle-live-log.ts rename to apps/server/src/battle/battle-live-log.ts diff --git a/packages/local-service/src/battle/battle-matchmaker.ts b/apps/server/src/battle/battle-matchmaker.ts similarity index 100% rename from packages/local-service/src/battle/battle-matchmaker.ts rename to apps/server/src/battle/battle-matchmaker.ts diff --git a/packages/local-service/src/battle/battle-mission-settings.ts b/apps/server/src/battle/battle-mission-settings.ts similarity index 100% rename from packages/local-service/src/battle/battle-mission-settings.ts rename to apps/server/src/battle/battle-mission-settings.ts diff --git a/packages/local-service/src/battle/battle-ranks.ts b/apps/server/src/battle/battle-ranks.ts similarity index 100% rename from packages/local-service/src/battle/battle-ranks.ts rename to apps/server/src/battle/battle-ranks.ts diff --git a/packages/local-service/src/battle/battle-repair.ts b/apps/server/src/battle/battle-repair.ts similarity index 100% rename from packages/local-service/src/battle/battle-repair.ts rename to apps/server/src/battle/battle-repair.ts diff --git a/packages/local-service/src/battle/battle-report.ts b/apps/server/src/battle/battle-report.ts similarity index 98% rename from packages/local-service/src/battle/battle-report.ts rename to apps/server/src/battle/battle-report.ts index bd918dc..7c815d2 100644 --- a/packages/local-service/src/battle/battle-report.ts +++ b/apps/server/src/battle/battle-report.ts @@ -1,6 +1,6 @@ /** - * The battle report of `cln_wto_finish_battle` (gui-patches/battle/report-local-battle-settlement): - * what happened in the battle, as facts only. The client sends no money; the local service + * The battle report of `cln_wto_finish_battle` (patches/gui/battle/report-local-battle-settlement): + * what happened in the battle, as facts only. The client sends no money; the local server * prices every event (battle-economy.ts). * * sessionId:t outcome:t ("win" | "lose" | "running") localTeam:i diff --git a/packages/local-service/src/battle/battle-result-log.ts b/apps/server/src/battle/battle-result-log.ts similarity index 100% rename from packages/local-service/src/battle/battle-result-log.ts rename to apps/server/src/battle/battle-result-log.ts diff --git a/packages/local-service/src/battle/battle-rewards.ts b/apps/server/src/battle/battle-rewards.ts similarity index 100% rename from packages/local-service/src/battle/battle-rewards.ts rename to apps/server/src/battle/battle-rewards.ts diff --git a/packages/local-service/src/battle/battle-rp-investment.ts b/apps/server/src/battle/battle-rp-investment.ts similarity index 100% rename from packages/local-service/src/battle/battle-rp-investment.ts rename to apps/server/src/battle/battle-rp-investment.ts diff --git a/packages/local-service/src/battle/battle-session-store.ts b/apps/server/src/battle/battle-session-store.ts similarity index 100% rename from packages/local-service/src/battle/battle-session-store.ts rename to apps/server/src/battle/battle-session-store.ts diff --git a/packages/local-service/src/battle/battle-settlement.ts b/apps/server/src/battle/battle-settlement.ts similarity index 100% rename from packages/local-service/src/battle/battle-settlement.ts rename to apps/server/src/battle/battle-settlement.ts diff --git a/packages/local-service/src/battle/battle-spawn-score.ts b/apps/server/src/battle/battle-spawn-score.ts similarity index 100% rename from packages/local-service/src/battle/battle-spawn-score.ts rename to apps/server/src/battle/battle-spawn-score.ts diff --git a/packages/local-service/src/battle/battle-streak-log.ts b/apps/server/src/battle/battle-streak-log.ts similarity index 100% rename from packages/local-service/src/battle/battle-streak-log.ts rename to apps/server/src/battle/battle-streak-log.ts diff --git a/packages/local-service/src/battle/battle-streaks.ts b/apps/server/src/battle/battle-streaks.ts similarity index 100% rename from packages/local-service/src/battle/battle-streaks.ts rename to apps/server/src/battle/battle-streaks.ts diff --git a/packages/local-service/src/battle/battle-support-planes.ts b/apps/server/src/battle/battle-support-planes.ts similarity index 100% rename from packages/local-service/src/battle/battle-support-planes.ts rename to apps/server/src/battle/battle-support-planes.ts diff --git a/packages/local-service/src/battle/battle-tuning.ts b/apps/server/src/battle/battle-tuning.ts similarity index 100% rename from packages/local-service/src/battle/battle-tuning.ts rename to apps/server/src/battle/battle-tuning.ts diff --git a/packages/local-service/src/battle/battle-wager.ts b/apps/server/src/battle/battle-wager.ts similarity index 100% rename from packages/local-service/src/battle/battle-wager.ts rename to apps/server/src/battle/battle-wager.ts diff --git a/packages/local-service/src/char/actions/account-context.ts b/apps/server/src/char/actions/account-context.ts similarity index 100% rename from packages/local-service/src/char/actions/account-context.ts rename to apps/server/src/char/actions/account-context.ts diff --git a/packages/local-service/src/char/actions/action-table.ts b/apps/server/src/char/actions/action-table.ts similarity index 100% rename from packages/local-service/src/char/actions/action-table.ts rename to apps/server/src/char/actions/action-table.ts diff --git a/packages/local-service/src/char/actions/agreement-actions.ts b/apps/server/src/char/actions/agreement-actions.ts similarity index 100% rename from packages/local-service/src/char/actions/agreement-actions.ts rename to apps/server/src/char/actions/agreement-actions.ts diff --git a/packages/local-service/src/char/actions/battle-actions.ts b/apps/server/src/char/actions/battle-actions.ts similarity index 100% rename from packages/local-service/src/char/actions/battle-actions.ts rename to apps/server/src/char/actions/battle-actions.ts diff --git a/packages/local-service/src/char/actions/clan-actions.ts b/apps/server/src/char/actions/clan-actions.ts similarity index 100% rename from packages/local-service/src/char/actions/clan-actions.ts rename to apps/server/src/char/actions/clan-actions.ts diff --git a/packages/local-service/src/char/actions/clan-moderation-actions.ts b/apps/server/src/char/actions/clan-moderation-actions.ts similarity index 100% rename from packages/local-service/src/char/actions/clan-moderation-actions.ts rename to apps/server/src/char/actions/clan-moderation-actions.ts diff --git a/packages/local-service/src/char/actions/client-update-actions.ts b/apps/server/src/char/actions/client-update-actions.ts similarity index 100% rename from packages/local-service/src/char/actions/client-update-actions.ts rename to apps/server/src/char/actions/client-update-actions.ts diff --git a/packages/local-service/src/char/actions/cloud-settings-actions.ts b/apps/server/src/char/actions/cloud-settings-actions.ts similarity index 100% rename from packages/local-service/src/char/actions/cloud-settings-actions.ts rename to apps/server/src/char/actions/cloud-settings-actions.ts diff --git a/packages/local-service/src/char/actions/crew-actions.ts b/apps/server/src/char/actions/crew-actions.ts similarity index 100% rename from packages/local-service/src/char/actions/crew-actions.ts rename to apps/server/src/char/actions/crew-actions.ts diff --git a/packages/local-service/src/char/actions/crew-skill-actions.ts b/apps/server/src/char/actions/crew-skill-actions.ts similarity index 100% rename from packages/local-service/src/char/actions/crew-skill-actions.ts rename to apps/server/src/char/actions/crew-skill-actions.ts diff --git a/packages/local-service/src/char/actions/crew-slots-payload.ts b/apps/server/src/char/actions/crew-slots-payload.ts similarity index 100% rename from packages/local-service/src/char/actions/crew-slots-payload.ts rename to apps/server/src/char/actions/crew-slots-payload.ts diff --git a/packages/local-service/src/char/actions/decor-actions.ts b/apps/server/src/char/actions/decor-actions.ts similarity index 100% rename from packages/local-service/src/char/actions/decor-actions.ts rename to apps/server/src/char/actions/decor-actions.ts diff --git a/packages/local-service/src/char/actions/decor-layout-actions.ts b/apps/server/src/char/actions/decor-layout-actions.ts similarity index 100% rename from packages/local-service/src/char/actions/decor-layout-actions.ts rename to apps/server/src/char/actions/decor-layout-actions.ts diff --git a/packages/local-service/src/char/actions/hangar-misc-actions.ts b/apps/server/src/char/actions/hangar-misc-actions.ts similarity index 100% rename from packages/local-service/src/char/actions/hangar-misc-actions.ts rename to apps/server/src/char/actions/hangar-misc-actions.ts diff --git a/packages/local-service/src/char/actions/inventory-actions.ts b/apps/server/src/char/actions/inventory-actions.ts similarity index 100% rename from packages/local-service/src/char/actions/inventory-actions.ts rename to apps/server/src/char/actions/inventory-actions.ts diff --git a/packages/local-service/src/char/actions/item-actions.ts b/apps/server/src/char/actions/item-actions.ts similarity index 100% rename from packages/local-service/src/char/actions/item-actions.ts rename to apps/server/src/char/actions/item-actions.ts diff --git a/packages/local-service/src/char/actions/modification-actions.ts b/apps/server/src/char/actions/modification-actions.ts similarity index 100% rename from packages/local-service/src/char/actions/modification-actions.ts rename to apps/server/src/char/actions/modification-actions.ts diff --git a/packages/local-service/src/char/actions/online-init-actions.ts b/apps/server/src/char/actions/online-init-actions.ts similarity index 96% rename from packages/local-service/src/char/actions/online-init-actions.ts rename to apps/server/src/char/actions/online-init-actions.ts index 0e52a85..5cbb7f7 100644 --- a/packages/local-service/src/char/actions/online-init-actions.ts +++ b/apps/server/src/char/actions/online-init-actions.ts @@ -13,7 +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 service has none, so the list is empty and no + * 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 *. */ diff --git a/packages/local-service/src/char/actions/payload-params.ts b/apps/server/src/char/actions/payload-params.ts similarity index 100% rename from packages/local-service/src/char/actions/payload-params.ts rename to apps/server/src/char/actions/payload-params.ts diff --git a/packages/local-service/src/char/actions/player-card-actions.ts b/apps/server/src/char/actions/player-card-actions.ts similarity index 100% rename from packages/local-service/src/char/actions/player-card-actions.ts rename to apps/server/src/char/actions/player-card-actions.ts diff --git a/packages/local-service/src/char/actions/price-actions.ts b/apps/server/src/char/actions/price-actions.ts similarity index 100% rename from packages/local-service/src/char/actions/price-actions.ts rename to apps/server/src/char/actions/price-actions.ts diff --git a/packages/local-service/src/char/actions/price-table.ts b/apps/server/src/char/actions/price-table.ts similarity index 100% rename from packages/local-service/src/char/actions/price-table.ts rename to apps/server/src/char/actions/price-table.ts diff --git a/packages/local-service/src/char/actions/purchase-actions.ts b/apps/server/src/char/actions/purchase-actions.ts similarity index 100% rename from packages/local-service/src/char/actions/purchase-actions.ts rename to apps/server/src/char/actions/purchase-actions.ts diff --git a/packages/local-service/src/char/actions/research-actions.ts b/apps/server/src/char/actions/research-actions.ts similarity index 100% rename from packages/local-service/src/char/actions/research-actions.ts rename to apps/server/src/char/actions/research-actions.ts diff --git a/packages/local-service/src/char/actions/rule-answer.ts b/apps/server/src/char/actions/rule-answer.ts similarity index 100% rename from packages/local-service/src/char/actions/rule-answer.ts rename to apps/server/src/char/actions/rule-answer.ts diff --git a/packages/local-service/src/char/actions/squadron-research-actions.ts b/apps/server/src/char/actions/squadron-research-actions.ts similarity index 100% rename from packages/local-service/src/char/actions/squadron-research-actions.ts rename to apps/server/src/char/actions/squadron-research-actions.ts diff --git a/packages/local-service/src/char/actions/starting-info-actions.ts b/apps/server/src/char/actions/starting-info-actions.ts similarity index 100% rename from packages/local-service/src/char/actions/starting-info-actions.ts rename to apps/server/src/char/actions/starting-info-actions.ts diff --git a/packages/local-service/src/char/actions/store-actions.ts b/apps/server/src/char/actions/store-actions.ts similarity index 100% rename from packages/local-service/src/char/actions/store-actions.ts rename to apps/server/src/char/actions/store-actions.ts diff --git a/packages/local-service/src/char/actions/unlock-actions.ts b/apps/server/src/char/actions/unlock-actions.ts similarity index 100% rename from packages/local-service/src/char/actions/unlock-actions.ts rename to apps/server/src/char/actions/unlock-actions.ts diff --git a/packages/local-service/src/char/char-action.ts b/apps/server/src/char/char-action.ts similarity index 100% rename from packages/local-service/src/char/char-action.ts rename to apps/server/src/char/char-action.ts diff --git a/packages/local-service/src/char/char-answers.ts b/apps/server/src/char/char-answers.ts similarity index 96% rename from packages/local-service/src/char/char-answers.ts rename to apps/server/src/char/char-answers.ts index 9447cc1..94c6427 100644 --- a/packages/local-service/src/char/char-answers.ts +++ b/apps/server/src/char/char-answers.ts @@ -9,7 +9,7 @@ * - error: a body starting "!ERROR:" followed by an error code. */ import { encodeBlk, formatBlkText, type BlkBlock } from '@wto/blk'; -import type { ServiceResponse } from '../server/exchange.ts'; +import type { ServiceResponse } from '../transport/exchange.ts'; import { encodeDataAnswer } from './char-payload.ts'; export type CharAnswer = diff --git a/packages/local-service/src/char/char-payload.ts b/apps/server/src/char/char-payload.ts similarity index 100% rename from packages/local-service/src/char/char-payload.ts rename to apps/server/src/char/char-payload.ts diff --git a/packages/local-service/src/char/char-service.ts b/apps/server/src/char/char-service.ts similarity index 95% rename from packages/local-service/src/char/char-service.ts rename to apps/server/src/char/char-service.ts index 63bfbad..08cbcfd 100644 --- a/packages/local-service/src/char/char-service.ts +++ b/apps/server/src/char/char-service.ts @@ -4,7 +4,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 - * EconomicSerializeJob::doJob, 0x2968a5). The local service trusts uidhint as it is: there + * EconomicSerializeJob::doJob, 0x2968a5). The local server trusts uidhint as it is: there * is nothing to protect on a single-player machine. * * An action with no handler yet gets a data answer holding an empty BLK and is marked @@ -13,7 +13,7 @@ * default lets the client continue and reveal what it asks for next. */ import { emptyBlock } from '@wto/blk'; -import type { Service, ServiceRequest, ServiceResponse } from '../server/exchange.ts'; +import type { Service, ServiceRequest, ServiceResponse } from '../transport/exchange.ts'; import type { CharActionHandler } from './char-action.ts'; import { toResponse, type CharAnswer } from './char-answers.ts'; import { decodeRequestPayload } from './char-payload.ts'; diff --git a/packages/local-service/src/char/compression-marker.ts b/apps/server/src/char/compression-marker.ts similarity index 100% rename from packages/local-service/src/char/compression-marker.ts rename to apps/server/src/char/compression-marker.ts diff --git a/packages/local-service/src/char/pbbd-stream.ts b/apps/server/src/char/pbbd-stream.ts similarity index 100% rename from packages/local-service/src/char/pbbd-stream.ts rename to apps/server/src/char/pbbd-stream.ts diff --git a/packages/local-service/src/chat/irc-protocol.ts b/apps/server/src/chat/irc-protocol.ts similarity index 100% rename from packages/local-service/src/chat/irc-protocol.ts rename to apps/server/src/chat/irc-protocol.ts diff --git a/packages/local-service/src/chat/irc-server.ts b/apps/server/src/chat/irc-server.ts similarity index 100% rename from packages/local-service/src/chat/irc-server.ts rename to apps/server/src/chat/irc-server.ts diff --git a/packages/local-service/src/clans/clan-blk.ts b/apps/server/src/clans/clan-blk.ts similarity index 100% rename from packages/local-service/src/clans/clan-blk.ts rename to apps/server/src/clans/clan-blk.ts diff --git a/packages/local-service/src/clans/clan-lifecycle.ts b/apps/server/src/clans/clan-lifecycle.ts similarity index 100% rename from packages/local-service/src/clans/clan-lifecycle.ts rename to apps/server/src/clans/clan-lifecycle.ts diff --git a/packages/local-service/src/clans/clan-membership.ts b/apps/server/src/clans/clan-membership.ts similarity index 100% rename from packages/local-service/src/clans/clan-membership.ts rename to apps/server/src/clans/clan-membership.ts diff --git a/packages/local-service/src/clans/clan-queries.ts b/apps/server/src/clans/clan-queries.ts similarity index 100% rename from packages/local-service/src/clans/clan-queries.ts rename to apps/server/src/clans/clan-queries.ts diff --git a/packages/local-service/src/clans/clan-seeds.ts b/apps/server/src/clans/clan-seeds.ts similarity index 100% rename from packages/local-service/src/clans/clan-seeds.ts rename to apps/server/src/clans/clan-seeds.ts diff --git a/packages/local-service/src/clans/clan-store.ts b/apps/server/src/clans/clan-store.ts similarity index 100% rename from packages/local-service/src/clans/clan-store.ts rename to apps/server/src/clans/clan-store.ts diff --git a/packages/local-service/src/clans/clan-tuning.ts b/apps/server/src/clans/clan-tuning.ts similarity index 100% rename from packages/local-service/src/clans/clan-tuning.ts rename to apps/server/src/clans/clan-tuning.ts diff --git a/packages/local-service/src/clans/clan-types.ts b/apps/server/src/clans/clan-types.ts similarity index 100% rename from packages/local-service/src/clans/clan-types.ts rename to apps/server/src/clans/clan-types.ts diff --git a/packages/local-service/src/cli.ts b/apps/server/src/cli.ts similarity index 70% rename from packages/local-service/src/cli.ts rename to apps/server/src/cli.ts index b4d765f..2d4c45c 100644 --- a/packages/local-service/src/cli.ts +++ b/apps/server/src/cli.ts @@ -1,13 +1,13 @@ /** - * Development entry point of the local service. + * Development entry point of the local server. * - * node packages/local-service/src/cli.ts --game --data --port + * node apps/server/src/cli.ts --game --data --port * - * The port must match the one the game copy was built with (packages/build). The launcher + * The port must match the one the game copy was built with (packages/patcher). The launcher * will start the service the same way. Stops on Ctrl+C. */ import { parseArgs } from 'node:util'; -import { LOOPBACK, startLocalService } from './local-service.ts'; +import { LOOPBACK, startServer } from './server.ts'; async function main(): Promise { const { values } = parseArgs({ @@ -24,13 +24,13 @@ async function main(): Promise { } let service; try { - service = await startLocalService({ gameFolder: values.game, dataFolder: values.data, port, report: (line) => console.log(line) }); + service = await startServer({ gameFolder: values.game, dataFolder: values.data, port, report: (line) => console.log(line) }); } catch (error) { const code = (error as NodeJS.ErrnoException).code; console.error(code === 'EADDRINUSE' ? `port ${port} is already in use; choose another port` : String(error)); return 1; } - console.log(`local service listening on ${LOOPBACK}:${port}`); + console.log(`local server listening on ${LOOPBACK}:${port}`); console.log(`traffic log: ${service.logFolder}`); const running = service; await new Promise((resolve) => process.once('SIGINT', resolve)); diff --git a/packages/local-service/src/cloud-settings/cloud-settings-store.ts b/apps/server/src/cloud-settings/cloud-settings-store.ts similarity index 100% rename from packages/local-service/src/cloud-settings/cloud-settings-store.ts rename to apps/server/src/cloud-settings/cloud-settings-store.ts diff --git a/packages/local-service/src/crew/crew-skill-rules.ts b/apps/server/src/crew/crew-skill-rules.ts similarity index 100% rename from packages/local-service/src/crew/crew-skill-rules.ts rename to apps/server/src/crew/crew-skill-rules.ts diff --git a/packages/local-service/src/crew/crew-training.ts b/apps/server/src/crew/crew-training.ts similarity index 100% rename from packages/local-service/src/crew/crew-training.ts rename to apps/server/src/crew/crew-training.ts diff --git a/packages/local-service/src/decor/decor-purchase.ts b/apps/server/src/decor/decor-purchase.ts similarity index 100% rename from packages/local-service/src/decor/decor-purchase.ts rename to apps/server/src/decor/decor-purchase.ts diff --git a/packages/local-service/src/downloadable-content/downloadable-content-service.ts b/apps/server/src/downloadable-content/downloadable-content-service.ts similarity index 97% rename from packages/local-service/src/downloadable-content/downloadable-content-service.ts rename to apps/server/src/downloadable-content/downloadable-content-service.ts index 28848f3..a5fce38 100644 --- a/packages/local-service/src/downloadable-content/downloadable-content-service.ts +++ b/apps/server/src/downloadable-content/downloadable-content-service.ts @@ -2,7 +2,7 @@ * Downloadable content (dldata): there is no CDN offline, so the index list and every file on * the dldata hosts are answered with 404, each with a note in the traffic log. * - * Where the client gets its decals instead (aces.exe 2.61.0.37; packages/build/src/decals/): + * Where the client gets its decals instead (aces.exe 2.61.0.37; packages/patcher/src/decals/): * - No player decal source: char.vromfs.bin holds dldata/downloadable_skins.blk and * dldata/downloadable_decals.blk, the client loads them at init (0xd3bc40 -> 0xd3cc60) and * never asks for dldata_s.info. @@ -14,7 +14,7 @@ * The client does not download the indexes themselves (0xd3e710 only looks in the cache * folder), so serving them here would have no effect. */ -import type { Service, ServiceRequest, ServiceResponse } from '../server/exchange.ts'; +import type { Service, ServiceRequest, ServiceResponse } from '../transport/exchange.ts'; const INFO_HOST = /^public-configs[a-z0-9-]*\.(warthunder\.com|cdn\.gaijin\.net)$/; const INFO_PATH = /^\/[a-z0-9_-]+\/dldata_s\.info$/; diff --git a/packages/local-service/src/game-data/datasets/battle-economy.ts b/apps/server/src/game-data/datasets/battle-economy.ts similarity index 100% rename from packages/local-service/src/game-data/datasets/battle-economy.ts rename to apps/server/src/game-data/datasets/battle-economy.ts diff --git a/packages/local-service/src/game-data/datasets/battle-spawn-rules.ts b/apps/server/src/game-data/datasets/battle-spawn-rules.ts similarity index 100% rename from packages/local-service/src/game-data/datasets/battle-spawn-rules.ts rename to apps/server/src/game-data/datasets/battle-spawn-rules.ts diff --git a/packages/local-service/src/game-data/datasets/battle-streaks.ts b/apps/server/src/game-data/datasets/battle-streaks.ts similarity index 100% rename from packages/local-service/src/game-data/datasets/battle-streaks.ts rename to apps/server/src/game-data/datasets/battle-streaks.ts diff --git a/packages/local-service/src/game-data/datasets/blk-fields.ts b/apps/server/src/game-data/datasets/blk-fields.ts similarity index 100% rename from packages/local-service/src/game-data/datasets/blk-fields.ts rename to apps/server/src/game-data/datasets/blk-fields.ts diff --git a/packages/local-service/src/game-data/datasets/clan-economy.ts b/apps/server/src/game-data/datasets/clan-economy.ts similarity index 100% rename from packages/local-service/src/game-data/datasets/clan-economy.ts rename to apps/server/src/game-data/datasets/clan-economy.ts diff --git a/packages/local-service/src/game-data/datasets/crew-skills.ts b/apps/server/src/game-data/datasets/crew-skills.ts similarity index 100% rename from packages/local-service/src/game-data/datasets/crew-skills.ts rename to apps/server/src/game-data/datasets/crew-skills.ts diff --git a/packages/local-service/src/game-data/datasets/dataset-cache.ts b/apps/server/src/game-data/datasets/dataset-cache.ts similarity index 100% rename from packages/local-service/src/game-data/datasets/dataset-cache.ts rename to apps/server/src/game-data/datasets/dataset-cache.ts diff --git a/packages/local-service/src/game-data/datasets/dataset.ts b/apps/server/src/game-data/datasets/dataset.ts similarity index 100% rename from packages/local-service/src/game-data/datasets/dataset.ts rename to apps/server/src/game-data/datasets/dataset.ts diff --git a/packages/local-service/src/game-data/datasets/decor-catalogue.ts b/apps/server/src/game-data/datasets/decor-catalogue.ts similarity index 100% rename from packages/local-service/src/game-data/datasets/decor-catalogue.ts rename to apps/server/src/game-data/datasets/decor-catalogue.ts diff --git a/packages/local-service/src/game-data/datasets/external-item-sources.ts b/apps/server/src/game-data/datasets/external-item-sources.ts similarity index 100% rename from packages/local-service/src/game-data/datasets/external-item-sources.ts rename to apps/server/src/game-data/datasets/external-item-sources.ts diff --git a/packages/local-service/src/game-data/datasets/item-catalogue.ts b/apps/server/src/game-data/datasets/item-catalogue.ts similarity index 100% rename from packages/local-service/src/game-data/datasets/item-catalogue.ts rename to apps/server/src/game-data/datasets/item-catalogue.ts diff --git a/packages/local-service/src/game-data/datasets/lang-csv.ts b/apps/server/src/game-data/datasets/lang-csv.ts similarity index 100% rename from packages/local-service/src/game-data/datasets/lang-csv.ts rename to apps/server/src/game-data/datasets/lang-csv.ts diff --git a/packages/local-service/src/game-data/datasets/multiplayer-missions.ts b/apps/server/src/game-data/datasets/multiplayer-missions.ts similarity index 98% rename from packages/local-service/src/game-data/datasets/multiplayer-missions.ts rename to apps/server/src/game-data/datasets/multiplayer-missions.ts index e10fc5a..ee92463 100644 --- a/packages/local-service/src/game-data/datasets/multiplayer-missions.ts +++ b/apps/server/src/game-data/datasets/multiplayer-missions.ts @@ -9,7 +9,7 @@ * vehicle types allowed, per-difficulty overrides, and the players' spawn slots * ("wing" entries of player / player_teamB). Its scalar parameters (and those of each * per-difficulty "mission" sub-block) are also kept as written, with their BLK types, for - * the mission settings the local service sends when a battle starts. + * 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). */ diff --git a/packages/local-service/src/game-data/datasets/rank-settings.ts b/apps/server/src/game-data/datasets/rank-settings.ts similarity index 100% rename from packages/local-service/src/game-data/datasets/rank-settings.ts rename to apps/server/src/game-data/datasets/rank-settings.ts diff --git a/packages/local-service/src/game-data/datasets/research-efficiency.ts b/apps/server/src/game-data/datasets/research-efficiency.ts similarity index 100% rename from packages/local-service/src/game-data/datasets/research-efficiency.ts rename to apps/server/src/game-data/datasets/research-efficiency.ts diff --git a/packages/local-service/src/game-data/datasets/research-point-rate.ts b/apps/server/src/game-data/datasets/research-point-rate.ts similarity index 95% rename from packages/local-service/src/game-data/datasets/research-point-rate.ts rename to apps/server/src/game-data/datasets/research-point-rate.ts index 4fca0f1..53bd223 100644 --- a/packages/local-service/src/game-data/datasets/research-point-rate.ts +++ b/apps/server/src/game-data/datasets/research-point-rate.ts @@ -5,7 +5,7 @@ * 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), * defaulting to 1; the price table can override it per country (exp_to_gold_rate), which the - * local service does not send. + * local server does not send. */ import { numberField } from './blk-fields.ts'; import type { Dataset } from './dataset.ts'; diff --git a/packages/local-service/src/game-data/datasets/reserve-vehicles.ts b/apps/server/src/game-data/datasets/reserve-vehicles.ts similarity index 100% rename from packages/local-service/src/game-data/datasets/reserve-vehicles.ts rename to apps/server/src/game-data/datasets/reserve-vehicles.ts diff --git a/packages/local-service/src/game-data/datasets/shop-branches.ts b/apps/server/src/game-data/datasets/shop-branches.ts similarity index 100% rename from packages/local-service/src/game-data/datasets/shop-branches.ts rename to apps/server/src/game-data/datasets/shop-branches.ts diff --git a/packages/local-service/src/game-data/datasets/shop-countries.ts b/apps/server/src/game-data/datasets/shop-countries.ts similarity index 100% rename from packages/local-service/src/game-data/datasets/shop-countries.ts rename to apps/server/src/game-data/datasets/shop-countries.ts diff --git a/packages/local-service/src/game-data/datasets/shop-tree.ts b/apps/server/src/game-data/datasets/shop-tree.ts similarity index 100% rename from packages/local-service/src/game-data/datasets/shop-tree.ts rename to apps/server/src/game-data/datasets/shop-tree.ts diff --git a/packages/local-service/src/game-data/datasets/store-bundles.ts b/apps/server/src/game-data/datasets/store-bundles.ts similarity index 100% rename from packages/local-service/src/game-data/datasets/store-bundles.ts rename to apps/server/src/game-data/datasets/store-bundles.ts diff --git a/packages/local-service/src/game-data/datasets/ui-labels.ts b/apps/server/src/game-data/datasets/ui-labels.ts similarity index 100% rename from packages/local-service/src/game-data/datasets/ui-labels.ts rename to apps/server/src/game-data/datasets/ui-labels.ts diff --git a/packages/local-service/src/game-data/datasets/unit-names.ts b/apps/server/src/game-data/datasets/unit-names.ts similarity index 100% rename from packages/local-service/src/game-data/datasets/unit-names.ts rename to apps/server/src/game-data/datasets/unit-names.ts diff --git a/packages/local-service/src/game-data/datasets/unlock-prices.ts b/apps/server/src/game-data/datasets/unlock-prices.ts similarity index 100% rename from packages/local-service/src/game-data/datasets/unlock-prices.ts rename to apps/server/src/game-data/datasets/unlock-prices.ts diff --git a/packages/local-service/src/game-data/datasets/vehicle-catalogue.ts b/apps/server/src/game-data/datasets/vehicle-catalogue.ts similarity index 98% rename from packages/local-service/src/game-data/datasets/vehicle-catalogue.ts rename to apps/server/src/game-data/datasets/vehicle-catalogue.ts index 2bb4548..deacc37 100644 --- a/packages/local-service/src/game-data/datasets/vehicle-catalogue.ts +++ b/apps/server/src/game-data/datasets/vehicle-catalogue.ts @@ -17,7 +17,7 @@ * reqUnlock:t an unlock from config/unlocks.blk the player must have earned first * slaveUnit:t the separate part of a split vehicle (a launcher), which comes with it * showOnlyWhenBought:b the stock UI only shows it to players who own it (kept by the build, - * packages/build reveal-hidden-vehicles.ts) + * packages/patcher reveal-hidden-vehicles.ts) * * Only what the files say is recorded; what it means for research is the rules layer's * (research/tech-tree.ts). diff --git a/packages/local-service/src/game-data/datasets/vehicle-equipment.ts b/apps/server/src/game-data/datasets/vehicle-equipment.ts similarity index 100% rename from packages/local-service/src/game-data/datasets/vehicle-equipment.ts rename to apps/server/src/game-data/datasets/vehicle-equipment.ts diff --git a/packages/local-service/src/game-data/datasets/vehicle-repair.ts b/apps/server/src/game-data/datasets/vehicle-repair.ts similarity index 100% rename from packages/local-service/src/game-data/datasets/vehicle-repair.ts rename to apps/server/src/game-data/datasets/vehicle-repair.ts diff --git a/packages/local-service/src/game-data/datasets/vehicle-unlocks.ts b/apps/server/src/game-data/datasets/vehicle-unlocks.ts similarity index 100% rename from packages/local-service/src/game-data/datasets/vehicle-unlocks.ts rename to apps/server/src/game-data/datasets/vehicle-unlocks.ts diff --git a/packages/local-service/src/game-data/datasets/web-icons.ts b/apps/server/src/game-data/datasets/web-icons.ts similarity index 100% rename from packages/local-service/src/game-data/datasets/web-icons.ts rename to apps/server/src/game-data/datasets/web-icons.ts diff --git a/packages/local-service/src/game-data/game-files.ts b/apps/server/src/game-data/game-files.ts similarity index 90% rename from packages/local-service/src/game-data/game-files.ts rename to apps/server/src/game-data/game-files.ts index a3963cc..4aed352 100644 --- a/packages/local-service/src/game-data/game-files.ts +++ b/apps/server/src/game-data/game-files.ts @@ -1,12 +1,12 @@ /** - * The game files the local service reads, opened lazily from the player's game folder. + * The game files the local server reads, opened lazily from the player's game folder. */ import { statSync } from 'node:fs'; import { join } from 'node:path'; import type { BlkBlock } from '@wto/blk'; import { GamePack } from './game-pack.ts'; -/** The data packs the local service reads (file names in the game folder). */ +/** The data packs the local server reads (file names in the game folder). */ export type GamePackName = | 'char.vromfs.bin' | 'mis.vromfs.bin' diff --git a/packages/local-service/src/game-data/game-pack.ts b/apps/server/src/game-data/game-pack.ts similarity index 100% rename from packages/local-service/src/game-data/game-pack.ts rename to apps/server/src/game-data/game-pack.ts diff --git a/packages/local-service/src/game-modes/catalogue/catalogue.ts b/apps/server/src/game-modes/catalogue/catalogue.ts similarity index 100% rename from packages/local-service/src/game-modes/catalogue/catalogue.ts rename to apps/server/src/game-modes/catalogue/catalogue.ts diff --git a/packages/local-service/src/game-modes/catalogue/game-mode-declaration.ts b/apps/server/src/game-modes/catalogue/game-mode-declaration.ts similarity index 100% rename from packages/local-service/src/game-modes/catalogue/game-mode-declaration.ts rename to apps/server/src/game-modes/catalogue/game-mode-declaration.ts diff --git a/packages/local-service/src/game-modes/catalogue/mission-pools.ts b/apps/server/src/game-modes/catalogue/mission-pools.ts similarity index 100% rename from packages/local-service/src/game-modes/catalogue/mission-pools.ts rename to apps/server/src/game-modes/catalogue/mission-pools.ts diff --git a/packages/local-service/src/game-modes/catalogue/pve-battles.ts b/apps/server/src/game-modes/catalogue/pve-battles.ts similarity index 100% rename from packages/local-service/src/game-modes/catalogue/pve-battles.ts rename to apps/server/src/game-modes/catalogue/pve-battles.ts diff --git a/packages/local-service/src/game-modes/catalogue/random-battles.ts b/apps/server/src/game-modes/catalogue/random-battles.ts similarity index 100% rename from packages/local-service/src/game-modes/catalogue/random-battles.ts rename to apps/server/src/game-modes/catalogue/random-battles.ts diff --git a/packages/local-service/src/game-modes/catalogue/simulator-battles.ts b/apps/server/src/game-modes/catalogue/simulator-battles.ts similarity index 100% rename from packages/local-service/src/game-modes/catalogue/simulator-battles.ts rename to apps/server/src/game-modes/catalogue/simulator-battles.ts diff --git a/packages/local-service/src/game-modes/catalogue/special-events.ts b/apps/server/src/game-modes/catalogue/special-events.ts similarity index 100% rename from packages/local-service/src/game-modes/catalogue/special-events.ts rename to apps/server/src/game-modes/catalogue/special-events.ts diff --git a/packages/local-service/src/game-modes/catalogue/sub-game-modes.ts b/apps/server/src/game-modes/catalogue/sub-game-modes.ts similarity index 100% rename from packages/local-service/src/game-modes/catalogue/sub-game-modes.ts rename to apps/server/src/game-modes/catalogue/sub-game-modes.ts diff --git a/packages/local-service/src/game-modes/game-modes.ts b/apps/server/src/game-modes/game-modes.ts similarity index 100% rename from packages/local-service/src/game-modes/game-modes.ts rename to apps/server/src/game-modes/game-modes.ts diff --git a/packages/local-service/src/game-modes/mission-pool.ts b/apps/server/src/game-modes/mission-pool.ts similarity index 100% rename from packages/local-service/src/game-modes/mission-pool.ts rename to apps/server/src/game-modes/mission-pool.ts diff --git a/packages/local-service/src/game-modes/mode-definition.ts b/apps/server/src/game-modes/mode-definition.ts similarity index 100% rename from packages/local-service/src/game-modes/mode-definition.ts rename to apps/server/src/game-modes/mode-definition.ts diff --git a/apps/server/src/index.ts b/apps/server/src/index.ts new file mode 100644 index 0000000..0bc1a41 --- /dev/null +++ b/apps/server/src/index.ts @@ -0,0 +1,7 @@ +/** + * The local server: emulates Gaijin's servers on this machine so the unmodified game logic + * signs in, loads the profile and sends player actions as it would online. + */ +export { LOOPBACK, startServer, type ServerOptions, type RunningServer } from './server.ts'; +export { HEALTH_PATH } from './transport/http-listener.ts'; +export { multiVehiclePackIds } from './store/store-pack-ids.ts'; diff --git a/packages/local-service/src/inventory/chest-defs.ts b/apps/server/src/inventory/chest-defs.ts similarity index 100% rename from packages/local-service/src/inventory/chest-defs.ts rename to apps/server/src/inventory/chest-defs.ts diff --git a/packages/local-service/src/inventory/content-sign/content-signature.ts b/apps/server/src/inventory/content-sign/content-signature.ts similarity index 96% rename from packages/local-service/src/inventory/content-sign/content-signature.ts rename to apps/server/src/inventory/content-sign/content-signature.ts index 895219e..7659972 100644 --- a/packages/local-service/src/inventory/content-sign/content-signature.ts +++ b/apps/server/src/inventory/content-sign/content-signature.ts @@ -18,7 +18,7 @@ import { createPrivateKey, sign, type KeyObject } from 'node:crypto'; import { readFileSync } from 'node:fs'; import { join } from 'node:path'; -import type { ServiceResponse } from '../../server/exchange.ts'; +import type { ServiceResponse } from '../../transport/exchange.ts'; const CONTENT_SIGN_HASH_ALGO = 'SHA256'; const SIGNING_ALGORITHM = 'RSA-SHA256'; diff --git a/packages/local-service/src/inventory/content-sign/local-inventory-content.key.pem b/apps/server/src/inventory/content-sign/local-inventory-content.key.pem similarity index 100% rename from packages/local-service/src/inventory/content-sign/local-inventory-content.key.pem rename to apps/server/src/inventory/content-sign/local-inventory-content.key.pem diff --git a/packages/local-service/src/inventory/coupons/cosmetic-coupons.ts b/apps/server/src/inventory/coupons/cosmetic-coupons.ts similarity index 100% rename from packages/local-service/src/inventory/coupons/cosmetic-coupons.ts rename to apps/server/src/inventory/coupons/cosmetic-coupons.ts diff --git a/packages/local-service/src/inventory/coupons/vehicle-coupons.ts b/apps/server/src/inventory/coupons/vehicle-coupons.ts similarity index 100% rename from packages/local-service/src/inventory/coupons/vehicle-coupons.ts rename to apps/server/src/inventory/coupons/vehicle-coupons.ts diff --git a/packages/local-service/src/inventory/inventory-rules.ts b/apps/server/src/inventory/inventory-rules.ts similarity index 100% rename from packages/local-service/src/inventory/inventory-rules.ts rename to apps/server/src/inventory/inventory-rules.ts diff --git a/packages/local-service/src/inventory/inventory-service.ts b/apps/server/src/inventory/inventory-service.ts similarity index 99% rename from packages/local-service/src/inventory/inventory-service.ts rename to apps/server/src/inventory/inventory-service.ts index 1b6fe9b..9aaa244 100644 --- a/packages/local-service/src/inventory/inventory-service.ts +++ b/apps/server/src/inventory/inventory-service.ts @@ -8,7 +8,7 @@ import type { Account, AccountStore } from '../accounts/account-store.ts'; import { userIdFromToken } from '../login/session-credentials.ts'; import type { PlayerProfiles } from '../profile/player-profiles.ts'; -import type { Service, ServiceRequest, ServiceResponse } from '../server/exchange.ts'; +import type { Service, ServiceRequest, ServiceResponse } from '../transport/exchange.ts'; import { signedInventoryJsonResponse } from './content-sign/content-signature.ts'; import { exchangeInventoryItems, type ExchangeItemDelta } from './inventory-rules.ts'; import { deltaToInventoryJson, parseExchangeItemsRequest, toInventoryJsonList } from './inventory-wire.ts'; diff --git a/packages/local-service/src/inventory/inventory-wire.ts b/apps/server/src/inventory/inventory-wire.ts similarity index 100% rename from packages/local-service/src/inventory/inventory-wire.ts rename to apps/server/src/inventory/inventory-wire.ts diff --git a/packages/local-service/src/inventory/itemdef-catalogue.ts b/apps/server/src/inventory/itemdef-catalogue.ts similarity index 100% rename from packages/local-service/src/inventory/itemdef-catalogue.ts rename to apps/server/src/inventory/itemdef-catalogue.ts diff --git a/packages/local-service/src/inventory/itemdef-types.ts b/apps/server/src/inventory/itemdef-types.ts similarity index 100% rename from packages/local-service/src/inventory/itemdef-types.ts rename to apps/server/src/inventory/itemdef-types.ts diff --git a/packages/local-service/src/inventory/marketplace-sell.ts b/apps/server/src/inventory/marketplace-sell.ts similarity index 100% rename from packages/local-service/src/inventory/marketplace-sell.ts rename to apps/server/src/inventory/marketplace-sell.ts diff --git a/packages/local-service/src/inventory/marketplace-service.ts b/apps/server/src/inventory/marketplace-service.ts similarity index 99% rename from packages/local-service/src/inventory/marketplace-service.ts rename to apps/server/src/inventory/marketplace-service.ts index 954e2af..c9f6dba 100644 --- a/packages/local-service/src/inventory/marketplace-service.ts +++ b/apps/server/src/inventory/marketplace-service.ts @@ -13,7 +13,7 @@ import { externalInventoryItems } from '../profile/profile-external-inventory.ts import { ownsVehicle } from '../profile/profile-hangar.ts'; import { ownsResource } from '../profile/profile-resources.ts'; import { earnedUnlocks } from '../profile/profile-unlocks.ts'; -import type { Service, ServiceRequest, ServiceResponse } from '../server/exchange.ts'; +import type { Service, ServiceRequest, ServiceResponse } from '../transport/exchange.ts'; import { createStaticWebSite, jsonResponse, diff --git a/packages/local-service/src/inventory/marketplace-tuning.ts b/apps/server/src/inventory/marketplace-tuning.ts similarity index 100% rename from packages/local-service/src/inventory/marketplace-tuning.ts rename to apps/server/src/inventory/marketplace-tuning.ts diff --git a/packages/local-service/src/inventory/recycling-defs.ts b/apps/server/src/inventory/recycling-defs.ts similarity index 100% rename from packages/local-service/src/inventory/recycling-defs.ts rename to apps/server/src/inventory/recycling-defs.ts diff --git a/packages/local-service/src/inventory/recycling-tuning.ts b/apps/server/src/inventory/recycling-tuning.ts similarity index 100% rename from packages/local-service/src/inventory/recycling-tuning.ts rename to apps/server/src/inventory/recycling-tuning.ts diff --git a/packages/local-service/src/inventory/supply-chest-tuning.ts b/apps/server/src/inventory/supply-chest-tuning.ts similarity index 100% rename from packages/local-service/src/inventory/supply-chest-tuning.ts rename to apps/server/src/inventory/supply-chest-tuning.ts diff --git a/packages/local-service/src/inventory/trophy-catalogue.ts b/apps/server/src/inventory/trophy-catalogue.ts similarity index 100% rename from packages/local-service/src/inventory/trophy-catalogue.ts rename to apps/server/src/inventory/trophy-catalogue.ts diff --git a/packages/local-service/src/inventory/trophy-tuning.ts b/apps/server/src/inventory/trophy-tuning.ts similarity index 100% rename from packages/local-service/src/inventory/trophy-tuning.ts rename to apps/server/src/inventory/trophy-tuning.ts diff --git a/packages/local-service/src/inventory/web/app.js b/apps/server/src/inventory/web/app.js similarity index 100% rename from packages/local-service/src/inventory/web/app.js rename to apps/server/src/inventory/web/app.js diff --git a/packages/local-service/src/inventory/web/index.html b/apps/server/src/inventory/web/index.html similarity index 100% rename from packages/local-service/src/inventory/web/index.html rename to apps/server/src/inventory/web/index.html diff --git a/packages/local-service/src/inventory/web/styles.css b/apps/server/src/inventory/web/styles.css similarity index 100% rename from packages/local-service/src/inventory/web/styles.css rename to apps/server/src/inventory/web/styles.css diff --git a/packages/local-service/src/items/item-activation.ts b/apps/server/src/items/item-activation.ts similarity index 100% rename from packages/local-service/src/items/item-activation.ts rename to apps/server/src/items/item-activation.ts diff --git a/packages/local-service/src/items/item-catalogue.ts b/apps/server/src/items/item-catalogue.ts similarity index 100% rename from packages/local-service/src/items/item-catalogue.ts rename to apps/server/src/items/item-catalogue.ts diff --git a/packages/local-service/src/items/item-expiry.ts b/apps/server/src/items/item-expiry.ts similarity index 100% rename from packages/local-service/src/items/item-expiry.ts rename to apps/server/src/items/item-expiry.ts diff --git a/packages/local-service/src/items/item-grants.ts b/apps/server/src/items/item-grants.ts similarity index 100% rename from packages/local-service/src/items/item-grants.ts rename to apps/server/src/items/item-grants.ts diff --git a/packages/local-service/src/items/item-purchase.ts b/apps/server/src/items/item-purchase.ts similarity index 100% rename from packages/local-service/src/items/item-purchase.ts rename to apps/server/src/items/item-purchase.ts diff --git a/packages/local-service/src/items/personal-discounts.ts b/apps/server/src/items/personal-discounts.ts similarity index 100% rename from packages/local-service/src/items/personal-discounts.ts rename to apps/server/src/items/personal-discounts.ts diff --git a/packages/local-service/src/items/universal-spares.ts b/apps/server/src/items/universal-spares.ts similarity index 100% rename from packages/local-service/src/items/universal-spares.ts rename to apps/server/src/items/universal-spares.ts diff --git a/packages/local-service/src/login/form-redaction.ts b/apps/server/src/login/form-redaction.ts similarity index 100% rename from packages/local-service/src/login/form-redaction.ts rename to apps/server/src/login/form-redaction.ts diff --git a/packages/local-service/src/login/login-service.ts b/apps/server/src/login/login-service.ts similarity index 98% rename from packages/local-service/src/login/login-service.ts rename to apps/server/src/login/login-service.ts index 9c87c0c..f3c730b 100644 --- a/packages/local-service/src/login/login-service.ts +++ b/apps/server/src/login/login-service.ts @@ -11,7 +11,7 @@ * status ERROR and marked unhandled in the traffic log until they are implemented. */ import type { AccountStore } from '../accounts/account-store.ts'; -import type { LogNotes, Service, ServiceRequest, ServiceResponse } from '../server/exchange.ts'; +import type { LogNotes, Service, ServiceRequest, ServiceResponse } from '../transport/exchange.ts'; import { redactLoginForm } from './form-redaction.ts'; import { issueCredentials } from './session-credentials.ts'; import { yuplayAnswer } from './yuplay-answer.ts'; diff --git a/packages/local-service/src/login/session-credentials.ts b/apps/server/src/login/session-credentials.ts similarity index 100% rename from packages/local-service/src/login/session-credentials.ts rename to apps/server/src/login/session-credentials.ts diff --git a/packages/local-service/src/login/yuplay-answer.ts b/apps/server/src/login/yuplay-answer.ts similarity index 91% rename from packages/local-service/src/login/yuplay-answer.ts rename to apps/server/src/login/yuplay-answer.ts index eccc718..0b1a753 100644 --- a/packages/local-service/src/login/yuplay-answer.ts +++ b/apps/server/src/login/yuplay-answer.ts @@ -3,7 +3,7 @@ * result. Status names are the ones the component maps to its YU2_* codes (DagorEngine * prog/1stPartyLibs/yuplay2auth/session/yu_sessionHttp.cpp, checkJsonAnswer). */ -import type { ServiceResponse } from '../server/exchange.ts'; +import type { ServiceResponse } from '../transport/exchange.ts'; export type YuplayStatus = 'OK' | 'ERROR' | 'LOGINERROR' | 'NOMONEY' | 'ALREADY' | 'NOTFOUND' | 'BADPAYMENT'; diff --git a/packages/local-service/src/matching/battle-launch-notify.ts b/apps/server/src/matching/battle-launch-notify.ts similarity index 98% rename from packages/local-service/src/matching/battle-launch-notify.ts rename to apps/server/src/matching/battle-launch-notify.ts index f2d051f..c081fc1 100644 --- a/packages/local-service/src/matching/battle-launch-notify.ts +++ b/apps/server/src/matching/battle-launch-notify.ts @@ -1,7 +1,7 @@ /** * The `mrpc.generic_notify` message that starts a local battle (`from: "wto_battle"`, * `func: "launch"`), received by the client's launch script patch - * (gui-patches/battle/launch-local-battle-from-queue). + * (patches/gui/battle/launch-local-battle-from-queue). * * - `mission`: the complete mission settings for `select_training_mission`, as a typed tree * `{ p: [[name, type, value], ...], b: [[name, node], ...] }` with type "t", "i", "r" or "b". diff --git a/packages/local-service/src/matching/battle-live-requests.ts b/apps/server/src/matching/battle-live-requests.ts similarity index 98% rename from packages/local-service/src/matching/battle-live-requests.ts rename to apps/server/src/matching/battle-live-requests.ts index 340a17a..0d0607c 100644 --- a/packages/local-service/src/matching/battle-live-requests.ts +++ b/apps/server/src/matching/battle-live-requests.ts @@ -1,5 +1,5 @@ /** - * Matching request `wto_battle.fact` (gui-patches/battle/record-local-battle-awards): one fact of a + * Matching request `wto_battle.fact` (patches/gui/battle/record-local-battle-awards): one fact of a * running LocalMP battle; the answer lists the battle awards it completed, which the client shows * as the stock award banner (scripts/streaks.nut add_streak_message). Online the battle server * sends those banners. diff --git a/packages/local-service/src/matching/battle-queue-requests.ts b/apps/server/src/matching/battle-queue-requests.ts similarity index 100% rename from packages/local-service/src/matching/battle-queue-requests.ts rename to apps/server/src/matching/battle-queue-requests.ts diff --git a/packages/local-service/src/matching/cluster-list.ts b/apps/server/src/matching/cluster-list.ts similarity index 100% rename from packages/local-service/src/matching/cluster-list.ts rename to apps/server/src/matching/cluster-list.ts diff --git a/packages/local-service/src/matching/game-modes-requests.ts b/apps/server/src/matching/game-modes-requests.ts similarity index 100% rename from packages/local-service/src/matching/game-modes-requests.ts rename to apps/server/src/matching/game-modes-requests.ts diff --git a/packages/local-service/src/matching/game-settings.ts b/apps/server/src/matching/game-settings.ts similarity index 100% rename from packages/local-service/src/matching/game-settings.ts rename to apps/server/src/matching/game-settings.ts diff --git a/packages/local-service/src/matching/lz4-block.ts b/apps/server/src/matching/lz4-block.ts similarity index 100% rename from packages/local-service/src/matching/lz4-block.ts rename to apps/server/src/matching/lz4-block.ts diff --git a/packages/local-service/src/matching/matching-frame.ts b/apps/server/src/matching/matching-frame.ts similarity index 100% rename from packages/local-service/src/matching/matching-frame.ts rename to apps/server/src/matching/matching-frame.ts diff --git a/packages/local-service/src/matching/matching-message.ts b/apps/server/src/matching/matching-message.ts similarity index 100% rename from packages/local-service/src/matching/matching-message.ts rename to apps/server/src/matching/matching-message.ts diff --git a/packages/local-service/src/matching/matching-requests.ts b/apps/server/src/matching/matching-requests.ts similarity index 100% rename from packages/local-service/src/matching/matching-requests.ts rename to apps/server/src/matching/matching-requests.ts diff --git a/packages/local-service/src/matching/matching-service.ts b/apps/server/src/matching/matching-service.ts similarity index 98% rename from packages/local-service/src/matching/matching-service.ts rename to apps/server/src/matching/matching-service.ts index 182f25d..22c3a34 100644 --- a/packages/local-service/src/matching/matching-service.ts +++ b/apps/server/src/matching/matching-service.ts @@ -1,6 +1,6 @@ /** * The local matching server: one session per TCP connection the client opens to the - * matching address (network.blk, pointed at the local service's port by the build). + * matching address (network.blk, pointed at the local server's port by the build). * * A connection starts unencrypted; the client sends mlogin.login in clear packets and from * then on encrypts both directions with the session key sealed in that request diff --git a/packages/local-service/src/matching/message-redaction.ts b/apps/server/src/matching/message-redaction.ts similarity index 100% rename from packages/local-service/src/matching/message-redaction.ts rename to apps/server/src/matching/message-redaction.ts diff --git a/packages/local-service/src/matching/session-crypto/encrypted-envelope.ts b/apps/server/src/matching/session-crypto/encrypted-envelope.ts similarity index 100% rename from packages/local-service/src/matching/session-crypto/encrypted-envelope.ts rename to apps/server/src/matching/session-crypto/encrypted-envelope.ts diff --git a/packages/local-service/src/matching/session-crypto/local-matching-server.key.pem b/apps/server/src/matching/session-crypto/local-matching-server.key.pem similarity index 100% rename from packages/local-service/src/matching/session-crypto/local-matching-server.key.pem rename to apps/server/src/matching/session-crypto/local-matching-server.key.pem diff --git a/packages/local-service/src/matching/session-crypto/session-key.ts b/apps/server/src/matching/session-crypto/session-key.ts similarity index 97% rename from packages/local-service/src/matching/session-crypto/session-key.ts rename to apps/server/src/matching/session-crypto/session-key.ts index 72e668f..246f31e 100644 --- a/packages/local-service/src/matching/session-crypto/session-key.ts +++ b/apps/server/src/matching/session-crypto/session-key.ts @@ -9,7 +9,7 @@ * - "auth_jwt_enc" is the sign-in JWT under AES-128-GCM with the session key: base64 of * 12-byte nonce, ciphertext and 16-byte tag (0x44e8d3c..0x44e8e5d). * - * The exe patch online/matching-server-public-key puts the local service's public key in + * The exe patch online/matching-server-public-key puts the local server's public key in * place of Gaijin's; local-matching-server.key.pem is the matching private key. It protects * nothing (both ends run on the player's machine) and is fixed so the patch bytes are fixed. */ @@ -39,7 +39,7 @@ export function unwrapSessionKey(loginField: string): UnwrappedLogin { const sealed = Buffer.from(loginField, 'base64'); // PKCS#1 v1.5 padding is removed here rather than by OpenSSL: Node refuses that padding // for private-key decryption (CVE-2023-46809), which matters only for servers exposed to - // attackers, not for a local service talking to its own client. + // attackers, not for a local server talking to its own client. const padded = privateDecrypt({ key: localServerKey(), padding: constants.RSA_NO_PADDING }, sealed); const text = stripPkcs1Type2(padded).toString('utf8'); const inner: unknown = JSON.parse(text); diff --git a/packages/local-service/src/modifications/ammo-refill.ts b/apps/server/src/modifications/ammo-refill.ts similarity index 100% rename from packages/local-service/src/modifications/ammo-refill.ts rename to apps/server/src/modifications/ammo-refill.ts diff --git a/packages/local-service/src/modifications/equipment-catalogue.ts b/apps/server/src/modifications/equipment-catalogue.ts similarity index 100% rename from packages/local-service/src/modifications/equipment-catalogue.ts rename to apps/server/src/modifications/equipment-catalogue.ts diff --git a/packages/local-service/src/modifications/modification-purchase.ts b/apps/server/src/modifications/modification-purchase.ts similarity index 100% rename from packages/local-service/src/modifications/modification-purchase.ts rename to apps/server/src/modifications/modification-purchase.ts diff --git a/packages/local-service/src/modifications/module-research-target.ts b/apps/server/src/modifications/module-research-target.ts similarity index 100% rename from packages/local-service/src/modifications/module-research-target.ts rename to apps/server/src/modifications/module-research-target.ts diff --git a/packages/local-service/src/modifications/module-state.ts b/apps/server/src/modifications/module-state.ts similarity index 100% rename from packages/local-service/src/modifications/module-state.ts rename to apps/server/src/modifications/module-state.ts diff --git a/packages/local-service/src/modifications/module-status.ts b/apps/server/src/modifications/module-status.ts similarity index 100% rename from packages/local-service/src/modifications/module-status.ts rename to apps/server/src/modifications/module-status.ts diff --git a/packages/local-service/src/modifications/spare-purchase.ts b/apps/server/src/modifications/spare-purchase.ts similarity index 100% rename from packages/local-service/src/modifications/spare-purchase.ts rename to apps/server/src/modifications/spare-purchase.ts diff --git a/packages/local-service/src/modifications/support-plane-modifications.ts b/apps/server/src/modifications/support-plane-modifications.ts similarity index 100% rename from packages/local-service/src/modifications/support-plane-modifications.ts rename to apps/server/src/modifications/support-plane-modifications.ts diff --git a/packages/local-service/src/modifications/weapon-presets.ts b/apps/server/src/modifications/weapon-presets.ts similarity index 100% rename from packages/local-service/src/modifications/weapon-presets.ts rename to apps/server/src/modifications/weapon-presets.ts diff --git a/packages/local-service/src/modifications/weapon-purchase.ts b/apps/server/src/modifications/weapon-purchase.ts similarity index 100% rename from packages/local-service/src/modifications/weapon-purchase.ts rename to apps/server/src/modifications/weapon-purchase.ts diff --git a/packages/local-service/src/player-card/player-card-rules.ts b/apps/server/src/player-card/player-card-rules.ts similarity index 100% rename from packages/local-service/src/player-card/player-card-rules.ts rename to apps/server/src/player-card/player-card-rules.ts diff --git a/packages/local-service/src/player-card/showcase-rules.ts b/apps/server/src/player-card/showcase-rules.ts similarity index 100% rename from packages/local-service/src/player-card/showcase-rules.ts rename to apps/server/src/player-card/showcase-rules.ts diff --git a/packages/local-service/src/profile/blk-fields.ts b/apps/server/src/profile/blk-fields.ts similarity index 100% rename from packages/local-service/src/profile/blk-fields.ts rename to apps/server/src/profile/blk-fields.ts diff --git a/packages/local-service/src/profile/client-profile.ts b/apps/server/src/profile/client-profile.ts similarity index 100% rename from packages/local-service/src/profile/client-profile.ts rename to apps/server/src/profile/client-profile.ts diff --git a/packages/local-service/src/profile/crew-slots.ts b/apps/server/src/profile/crew-slots.ts similarity index 100% rename from packages/local-service/src/profile/crew-slots.ts rename to apps/server/src/profile/crew-slots.ts diff --git a/packages/local-service/src/profile/new-profile-tuning.ts b/apps/server/src/profile/new-profile-tuning.ts similarity index 100% rename from packages/local-service/src/profile/new-profile-tuning.ts rename to apps/server/src/profile/new-profile-tuning.ts diff --git a/packages/local-service/src/profile/new-profile.ts b/apps/server/src/profile/new-profile.ts similarity index 100% rename from packages/local-service/src/profile/new-profile.ts rename to apps/server/src/profile/new-profile.ts diff --git a/packages/local-service/src/profile/player-profiles.ts b/apps/server/src/profile/player-profiles.ts similarity index 100% rename from packages/local-service/src/profile/player-profiles.ts rename to apps/server/src/profile/player-profiles.ts diff --git a/packages/local-service/src/profile/profile-appearance.ts b/apps/server/src/profile/profile-appearance.ts similarity index 96% rename from packages/local-service/src/profile/profile-appearance.ts rename to apps/server/src/profile/profile-appearance.ts index 9645354..f680813 100644 --- a/packages/local-service/src/profile/profile-appearance.ts +++ b/apps/server/src/profile/profile-appearance.ts @@ -5,7 +5,7 @@ * pilotAppearance{ pilotIcon:t background:t frame:t } * what cln_save_pilot_appearance sets; the client itself reads * it back through cln_get_users_terse_info, so the block is the - * local service's own record + * local server's own record */ import { ensureBlock, findBlock, findParam, setParam, type BlkBlock } from '@wto/blk'; diff --git a/packages/local-service/src/profile/profile-clan.ts b/apps/server/src/profile/profile-clan.ts similarity index 100% rename from packages/local-service/src/profile/profile-clan.ts rename to apps/server/src/profile/profile-clan.ts diff --git a/packages/local-service/src/profile/profile-client-settings.ts b/apps/server/src/profile/profile-client-settings.ts similarity index 100% rename from packages/local-service/src/profile/profile-client-settings.ts rename to apps/server/src/profile/profile-client-settings.ts diff --git a/packages/local-service/src/profile/profile-crew-skills.ts b/apps/server/src/profile/profile-crew-skills.ts similarity index 98% rename from packages/local-service/src/profile/profile-crew-skills.ts rename to apps/server/src/profile/profile-crew-skills.ts index e37044c..f8d2c36 100644 --- a/packages/local-service/src/profile/profile-crew-skills.ts +++ b/apps/server/src/profile/profile-crew-skills.ts @@ -15,7 +15,7 @@ * * Skill levels sit in /crewMember_0 as i64 (aces.exe 0x939b40..0x939c62). Skill points are * kept times 100: the client shows (skillPointsStat + skillPointsManualChanges) / 100 - * (get_crew_info, 0x179dbac); the local service books what the player buys and spends in + * (get_crew_info, 0x179dbac); the local server books what the player buys and spends in * skillPointsManualChanges. Every trained vehicle is followed by its spec (0 none, 1 expert, * 2 ace), as the client writes them (0x939ed0..0x939f55), and per-vehicle Expert-to-Ace RP sits * in expertToAceProgress/:i (0x93b0d0..0x93b4eb). diff --git a/packages/local-service/src/profile/profile-crews.ts b/apps/server/src/profile/profile-crews.ts similarity index 100% rename from packages/local-service/src/profile/profile-crews.ts rename to apps/server/src/profile/profile-crews.ts diff --git a/packages/local-service/src/profile/profile-currency.ts b/apps/server/src/profile/profile-currency.ts similarity index 100% rename from packages/local-service/src/profile/profile-currency.ts rename to apps/server/src/profile/profile-currency.ts diff --git a/packages/local-service/src/profile/profile-decor-layouts.ts b/apps/server/src/profile/profile-decor-layouts.ts similarity index 97% rename from packages/local-service/src/profile/profile-decor-layouts.ts rename to apps/server/src/profile/profile-decor-layouts.ts index 8f8c98b..c50e603 100644 --- a/packages/local-service/src/profile/profile-decor-layouts.ts +++ b/apps/server/src/profile/profile-decor-layouts.ts @@ -5,7 +5,7 @@ * attachables{ { { ... } } } * * The client keeps each block whole as its own copy (aces.exe: profile "decals" -> save data - * +0x140, "attachables" -> +0x160) and edits it in the customization window; the local service + * +0x140, "attachables" -> +0x160) and edits it in the customization window; the local server * only stores what the client sends, per vehicle and skin. */ import { ensureBlock, findBlock, type BlkBlock } from '@wto/blk'; diff --git a/packages/local-service/src/profile/profile-dest-rp.ts b/apps/server/src/profile/profile-dest-rp.ts similarity index 100% rename from packages/local-service/src/profile/profile-dest-rp.ts rename to apps/server/src/profile/profile-dest-rp.ts diff --git a/packages/local-service/src/profile/profile-entitlements.ts b/apps/server/src/profile/profile-entitlements.ts similarity index 100% rename from packages/local-service/src/profile/profile-entitlements.ts rename to apps/server/src/profile/profile-entitlements.ts diff --git a/packages/local-service/src/profile/profile-eras.ts b/apps/server/src/profile/profile-eras.ts similarity index 100% rename from packages/local-service/src/profile/profile-eras.ts rename to apps/server/src/profile/profile-eras.ts diff --git a/packages/local-service/src/profile/profile-external-inventory.ts b/apps/server/src/profile/profile-external-inventory.ts similarity index 100% rename from packages/local-service/src/profile/profile-external-inventory.ts rename to apps/server/src/profile/profile-external-inventory.ts diff --git a/packages/local-service/src/profile/profile-hangar.ts b/apps/server/src/profile/profile-hangar.ts similarity index 100% rename from packages/local-service/src/profile/profile-hangar.ts rename to apps/server/src/profile/profile-hangar.ts diff --git a/packages/local-service/src/profile/profile-items.ts b/apps/server/src/profile/profile-items.ts similarity index 100% rename from packages/local-service/src/profile/profile-items.ts rename to apps/server/src/profile/profile-items.ts diff --git a/packages/local-service/src/profile/profile-mission-progress.ts b/apps/server/src/profile/profile-mission-progress.ts similarity index 100% rename from packages/local-service/src/profile/profile-mission-progress.ts rename to apps/server/src/profile/profile-mission-progress.ts diff --git a/packages/local-service/src/profile/profile-modifications.ts b/apps/server/src/profile/profile-modifications.ts similarity index 100% rename from packages/local-service/src/profile/profile-modifications.ts rename to apps/server/src/profile/profile-modifications.ts diff --git a/packages/local-service/src/profile/profile-module-research.ts b/apps/server/src/profile/profile-module-research.ts similarity index 100% rename from packages/local-service/src/profile/profile-module-research.ts rename to apps/server/src/profile/profile-module-research.ts diff --git a/packages/local-service/src/profile/profile-research-bonus.ts b/apps/server/src/profile/profile-research-bonus.ts similarity index 94% rename from packages/local-service/src/profile/profile-research-bonus.ts rename to apps/server/src/profile/profile-research-bonus.ts index 1e8c795..9bed5a0 100644 --- a/packages/local-service/src/profile/profile-research-bonus.ts +++ b/apps/server/src/profile/profile-research-bonus.ts @@ -1,6 +1,6 @@ /** * Vehicle Research Bonus battles used today, per country and vehicle type (research/ - * research-efficiency.ts). Kept in a block of the local service's own; the client's profile + * research-efficiency.ts). Kept in a block of the local server's own; the client's profile * parser ignores it: * * wtoResearchBonus{ day:i= country_usa{ Tank:i=2 } } diff --git a/packages/local-service/src/profile/profile-research-points.ts b/apps/server/src/profile/profile-research-points.ts similarity index 100% rename from packages/local-service/src/profile/profile-research-points.ts rename to apps/server/src/profile/profile-research-points.ts diff --git a/packages/local-service/src/profile/profile-research-targets.ts b/apps/server/src/profile/profile-research-targets.ts similarity index 100% rename from packages/local-service/src/profile/profile-research-targets.ts rename to apps/server/src/profile/profile-research-targets.ts diff --git a/packages/local-service/src/profile/profile-resources.ts b/apps/server/src/profile/profile-resources.ts similarity index 100% rename from packages/local-service/src/profile/profile-resources.ts rename to apps/server/src/profile/profile-resources.ts diff --git a/packages/local-service/src/profile/profile-showcase.ts b/apps/server/src/profile/profile-showcase.ts similarity index 100% rename from packages/local-service/src/profile/profile-showcase.ts rename to apps/server/src/profile/profile-showcase.ts diff --git a/packages/local-service/src/profile/profile-store-cart.ts b/apps/server/src/profile/profile-store-cart.ts similarity index 100% rename from packages/local-service/src/profile/profile-store-cart.ts rename to apps/server/src/profile/profile-store-cart.ts diff --git a/packages/local-service/src/profile/profile-trophies-log.ts b/apps/server/src/profile/profile-trophies-log.ts similarity index 100% rename from packages/local-service/src/profile/profile-trophies-log.ts rename to apps/server/src/profile/profile-trophies-log.ts diff --git a/packages/local-service/src/profile/profile-unlocks.ts b/apps/server/src/profile/profile-unlocks.ts similarity index 100% rename from packages/local-service/src/profile/profile-unlocks.ts rename to apps/server/src/profile/profile-unlocks.ts diff --git a/packages/local-service/src/profile/profile-upgrades.ts b/apps/server/src/profile/profile-upgrades.ts similarity index 100% rename from packages/local-service/src/profile/profile-upgrades.ts rename to apps/server/src/profile/profile-upgrades.ts diff --git a/packages/local-service/src/profile/profile-vehicle-condition.ts b/apps/server/src/profile/profile-vehicle-condition.ts similarity index 100% rename from packages/local-service/src/profile/profile-vehicle-condition.ts rename to apps/server/src/profile/profile-vehicle-condition.ts diff --git a/packages/local-service/src/profile/profile-vehicle-research.ts b/apps/server/src/profile/profile-vehicle-research.ts similarity index 100% rename from packages/local-service/src/profile/profile-vehicle-research.ts rename to apps/server/src/profile/profile-vehicle-research.ts diff --git a/packages/local-service/src/profile/profile-vehicle-state.ts b/apps/server/src/profile/profile-vehicle-state.ts similarity index 98% rename from packages/local-service/src/profile/profile-vehicle-state.ts rename to apps/server/src/profile/profile-vehicle-state.ts index 8936590..c70dbeb 100644 --- a/packages/local-service/src/profile/profile-vehicle-state.ts +++ b/apps/server/src/profile/profile-vehicle-state.ts @@ -1,7 +1,7 @@ /** * Per-vehicle fields of owned vehicles: hangar{ { ... } }, * read by name by AircraftInfo::serialize (aces.exe 2.61.0.37 0x940510). Only the fields the - * local service maintains are handled here: + * local server maintains are handled here: * investMode:t the modification being researched, empty = none (AircraftInfo+0x100) * investModePrev:t the modification whose research just finished (+0x108) * tierNumber:i the highest open modification tier (script is_tier_available) diff --git a/packages/local-service/src/profile/profile-weapon-presets.ts b/apps/server/src/profile/profile-weapon-presets.ts similarity index 100% rename from packages/local-service/src/profile/profile-weapon-presets.ts rename to apps/server/src/profile/profile-weapon-presets.ts diff --git a/packages/local-service/src/profile/profile-weapons.ts b/apps/server/src/profile/profile-weapons.ts similarity index 100% rename from packages/local-service/src/profile/profile-weapons.ts rename to apps/server/src/profile/profile-weapons.ts diff --git a/packages/local-service/src/profile/profile-wishlist.ts b/apps/server/src/profile/profile-wishlist.ts similarity index 100% rename from packages/local-service/src/profile/profile-wishlist.ts rename to apps/server/src/profile/profile-wishlist.ts diff --git a/packages/local-service/src/profile/server-time.ts b/apps/server/src/profile/server-time.ts similarity index 100% rename from packages/local-service/src/profile/server-time.ts rename to apps/server/src/profile/server-time.ts diff --git a/packages/local-service/src/profile/starting-content.ts b/apps/server/src/profile/starting-content.ts similarity index 100% rename from packages/local-service/src/profile/starting-content.ts rename to apps/server/src/profile/starting-content.ts diff --git a/packages/local-service/src/profiles-setup.ts b/apps/server/src/profiles-setup.ts similarity index 100% rename from packages/local-service/src/profiles-setup.ts rename to apps/server/src/profiles-setup.ts diff --git a/packages/local-service/src/repair/repair-over-time.ts b/apps/server/src/repair/repair-over-time.ts similarity index 95% rename from packages/local-service/src/repair/repair-over-time.ts rename to apps/server/src/repair/repair-over-time.ts index 0ecee6b..760b02a 100644 --- a/packages/local-service/src/repair/repair-over-time.ts +++ b/apps/server/src/repair/repair-over-time.ts @@ -4,7 +4,7 @@ * fullRepairHours), part by part: the hangar shows (1 - hp) x the full time as what is left * (shop_time_until_repair, aces.exe 2.61.0.37 0x17a5040). * - * The client never raises hp itself, so the local service does it whenever it hands out or + * The client never raises hp itself, so the local server does it whenever it hands out or * changes a profile: hp grows by the hours since it was last set / the full repair time (with the * crew the vehicle has now), and the damage is cleared once hp reaches 1. The pace following the * current crew and the linear growth are inferred from the client's timer formula; whether a diff --git a/packages/local-service/src/repair/repair-rules.ts b/apps/server/src/repair/repair-rules.ts similarity index 99% rename from packages/local-service/src/repair/repair-rules.ts rename to apps/server/src/repair/repair-rules.ts index 000c60e..0389d6c 100644 --- a/packages/local-service/src/repair/repair-rules.ts +++ b/apps/server/src/repair/repair-rules.ts @@ -10,7 +10,7 @@ * 0x90e0b0): max(1, (1 - hp) x full cost in the mode it was damaged in (lastGameMode)); 0 when * intact or when the full cost is 0 (reserve vehicles). The client would also cap the full cost * at repairCostPerMin x a play time of its own (feature repairCostUsesPlayTime, a per-vehicle - * table at EconomicState+0xe838 whose source was not found; the local service never fills it), + * table at EconomicState+0xe838 whose source was not found; the local server never fills it), * so the battle settlement puts the lifetime rule into hp instead (battle/battle-repair.ts). * - Full repair time (shop_get_full_repair_time_by_mode; 0x937330 with the mode it was damaged in), * in hours; the hangar shows (1 - hp) x it as the time until the free repair is done diff --git a/packages/local-service/src/research/auto-research-target.ts b/apps/server/src/research/auto-research-target.ts similarity index 100% rename from packages/local-service/src/research/auto-research-target.ts rename to apps/server/src/research/auto-research-target.ts diff --git a/packages/local-service/src/research/crew-slot-purchase.ts b/apps/server/src/research/crew-slot-purchase.ts similarity index 100% rename from packages/local-service/src/research/crew-slot-purchase.ts rename to apps/server/src/research/crew-slot-purchase.ts diff --git a/packages/local-service/src/research/era-progress.ts b/apps/server/src/research/era-progress.ts similarity index 100% rename from packages/local-service/src/research/era-progress.ts rename to apps/server/src/research/era-progress.ts diff --git a/packages/local-service/src/research/research-efficiency.ts b/apps/server/src/research/research-efficiency.ts similarity index 100% rename from packages/local-service/src/research/research-efficiency.ts rename to apps/server/src/research/research-efficiency.ts diff --git a/packages/local-service/src/research/research-progress.ts b/apps/server/src/research/research-progress.ts similarity index 100% rename from packages/local-service/src/research/research-progress.ts rename to apps/server/src/research/research-progress.ts diff --git a/packages/local-service/src/research/research-rules.ts b/apps/server/src/research/research-rules.ts similarity index 100% rename from packages/local-service/src/research/research-rules.ts rename to apps/server/src/research/research-rules.ts diff --git a/packages/local-service/src/research/research-state.ts b/apps/server/src/research/research-state.ts similarity index 98% rename from packages/local-service/src/research/research-state.ts rename to apps/server/src/research/research-state.ts index a43c555..31b0fa3 100644 --- a/packages/local-service/src/research/research-state.ts +++ b/apps/server/src/research/research-state.ts @@ -1,6 +1,6 @@ /** * Bringing the research state of a profile up to date. The char - * server keeps it current online; the local service does it whenever a profile is handed out + * server keeps it current online; the local server does it whenever a profile is handed out * or changed (profile/player-profiles.ts), so the state always follows from the facts: * owned vehicles, research points, earned unlocks, banked excess research points. * diff --git a/packages/local-service/src/research/research-tuning.ts b/apps/server/src/research/research-tuning.ts similarity index 100% rename from packages/local-service/src/research/research-tuning.ts rename to apps/server/src/research/research-tuning.ts diff --git a/packages/local-service/src/research/rule-outcome.ts b/apps/server/src/research/rule-outcome.ts similarity index 100% rename from packages/local-service/src/research/rule-outcome.ts rename to apps/server/src/research/rule-outcome.ts diff --git a/packages/local-service/src/research/squadron-research.ts b/apps/server/src/research/squadron-research.ts similarity index 100% rename from packages/local-service/src/research/squadron-research.ts rename to apps/server/src/research/squadron-research.ts diff --git a/packages/local-service/src/research/tech-tree.ts b/apps/server/src/research/tech-tree.ts similarity index 100% rename from packages/local-service/src/research/tech-tree.ts rename to apps/server/src/research/tech-tree.ts diff --git a/packages/local-service/src/research/vehicle-purchase.ts b/apps/server/src/research/vehicle-purchase.ts similarity index 100% rename from packages/local-service/src/research/vehicle-purchase.ts rename to apps/server/src/research/vehicle-purchase.ts diff --git a/packages/local-service/src/research/vehicle-status.ts b/apps/server/src/research/vehicle-status.ts similarity index 100% rename from packages/local-service/src/research/vehicle-status.ts rename to apps/server/src/research/vehicle-status.ts diff --git a/packages/local-service/src/research/vehicle-types.ts b/apps/server/src/research/vehicle-types.ts similarity index 100% rename from packages/local-service/src/research/vehicle-types.ts rename to apps/server/src/research/vehicle-types.ts diff --git a/packages/local-service/src/research/vehicle-unlock-rules.ts b/apps/server/src/research/vehicle-unlock-rules.ts similarity index 100% rename from packages/local-service/src/research/vehicle-unlock-rules.ts rename to apps/server/src/research/vehicle-unlock-rules.ts diff --git a/packages/local-service/src/save-cli.ts b/apps/server/src/save-cli.ts similarity index 99% rename from packages/local-service/src/save-cli.ts rename to apps/server/src/save-cli.ts index 727113a..2088fd6 100644 --- a/packages/local-service/src/save-cli.ts +++ b/apps/server/src/save-cli.ts @@ -2,7 +2,7 @@ * Development entry point for editing a save (the save editor of docs/implementation notes * section A; the launcher will call the same profile functions). * - * node packages/local-service/src/save-cli.ts --game --data + * node apps/server/src/save-cli.ts --game --data * --player [--silver ] [--gold ] [--gjn ] [--free-rp ] * [--squadron-rp ] [--give-item [:]]... [--give-coupon [:]]... */ diff --git a/packages/local-service/src/saves/save-store.ts b/apps/server/src/saves/save-store.ts similarity index 100% rename from packages/local-service/src/saves/save-store.ts rename to apps/server/src/saves/save-store.ts diff --git a/packages/local-service/src/saves/save-upgrades.ts b/apps/server/src/saves/save-upgrades.ts similarity index 100% rename from packages/local-service/src/saves/save-upgrades.ts rename to apps/server/src/saves/save-upgrades.ts diff --git a/packages/local-service/src/local-service.ts b/apps/server/src/server.ts similarity index 95% rename from packages/local-service/src/local-service.ts rename to apps/server/src/server.ts index d7e95e5..b6bc343 100644 --- a/packages/local-service/src/local-service.ts +++ b/apps/server/src/server.ts @@ -1,5 +1,5 @@ /** - * Assemble the local service: data layer, save layer, rules, + * Assemble the local server: data layer, save layer, rules, * protocol-layer services, and the single loopback listening port. */ import type { Server } from 'node:net'; @@ -47,9 +47,9 @@ import { LoginService } from './login/login-service.ts'; import { matchingRequests } from './matching/matching-requests.ts'; import type { MatchingService } from './matching/matching-service.ts'; import { setUpProfiles } from './profiles-setup.ts'; -import { createPortListener } from './server/port-listener.ts'; -import { Router } from './server/router.ts'; -import { loadOrCreateCredentials } from './server/tls/tls-certificate.ts'; +import { createPortListener } from './transport/port-listener.ts'; +import { Router } from './transport/router.ts'; +import { loadOrCreateCredentials } from './transport/tls/tls-certificate.ts'; import { StoreCatalogue } from './store/store-catalogue.ts'; import { StoreService } from './store/store-service.ts'; import { TrafficLog } from './traffic-log/traffic-log.ts'; @@ -58,7 +58,7 @@ import { UnlockShop } from './unlocks/unlock-purchase.ts'; import { GameArtwork } from './web-ui/game-artwork.ts'; import { WebUiService } from './web-ui/web-ui-service.ts'; -export interface LocalServiceOptions { +export interface ServerOptions { /** The player's game folder; its data packs are read, never written. */ readonly gameFolder: string; /** Accounts, saves and logs. */ @@ -70,12 +70,12 @@ export interface LocalServiceOptions { export const LOOPBACK = '127.0.0.1'; -export interface RunningLocalService { +export interface RunningServer { readonly logFolder: string; close(): Promise; } -export async function startLocalService(options: LocalServiceOptions): Promise { +export async function startServer(options: ServerOptions): Promise { const report = options.report ?? (() => {}); const gameFiles = new GameFiles(options.gameFolder); // Static data and stores first, before the port opens. diff --git a/packages/local-service/src/storage/atomic-file.ts b/apps/server/src/storage/atomic-file.ts similarity index 100% rename from packages/local-service/src/storage/atomic-file.ts rename to apps/server/src/storage/atomic-file.ts diff --git a/packages/local-service/src/store/redeem-codes.ts b/apps/server/src/store/redeem-codes.ts similarity index 100% rename from packages/local-service/src/store/redeem-codes.ts rename to apps/server/src/store/redeem-codes.ts diff --git a/packages/local-service/src/store/redeem-tuning.ts b/apps/server/src/store/redeem-tuning.ts similarity index 100% rename from packages/local-service/src/store/redeem-tuning.ts rename to apps/server/src/store/redeem-tuning.ts diff --git a/packages/local-service/src/store/store-catalogue.ts b/apps/server/src/store/store-catalogue.ts similarity index 100% rename from packages/local-service/src/store/store-catalogue.ts rename to apps/server/src/store/store-catalogue.ts diff --git a/apps/server/src/store/store-pack-ids.ts b/apps/server/src/store/store-pack-ids.ts new file mode 100644 index 0000000..c8b17c7 --- /dev/null +++ b/apps/server/src/store/store-pack-ids.ts @@ -0,0 +1,14 @@ +/** + * The ids of the multi-vehicle packs the store sells, from tuning/store.jsonc with the player's + * overrides in /tuning/ laid over it, exactly as the running server reads them. + * + * Whoever builds the game copy needs them: the client looks a pack up only when config/gui.blk + * `bundles/guid` registers a GUID for its id, so the build must register every pack this server + * will sell from the same data folder. + */ +import { tuningFiles } from '../tuning/tuning-loader.ts'; +import { readStoreTuning } from './store-tuning.ts'; + +export function multiVehiclePackIds(dataFolder: string, report: (line: string) => void): string[] { + return readStoreTuning(tuningFiles(dataFolder, report).read('store')).multiVehiclePacks.map((pack) => pack.id); +} diff --git a/packages/local-service/src/store/store-purchase.ts b/apps/server/src/store/store-purchase.ts similarity index 100% rename from packages/local-service/src/store/store-purchase.ts rename to apps/server/src/store/store-purchase.ts diff --git a/packages/local-service/src/store/store-service.ts b/apps/server/src/store/store-service.ts similarity index 98% rename from packages/local-service/src/store/store-service.ts rename to apps/server/src/store/store-service.ts index f1abc54..fcf3d54 100644 --- a/packages/local-service/src/store/store-service.ts +++ b/apps/server/src/store/store-service.ts @@ -6,7 +6,7 @@ import type { AccountStore } from '../accounts/account-store.ts'; import { redactLoginForm } from '../login/form-redaction.ts'; import type { PlayerProfiles } from '../profile/player-profiles.ts'; -import type { Service, ServiceRequest, ServiceResponse } from '../server/exchange.ts'; +import type { Service, ServiceRequest, ServiceResponse } from '../transport/exchange.ts'; import { createStaticWebSite, notFound } from '../web-ui/web-helpers.ts'; import type { RedeemTuning } from './redeem-tuning.ts'; import type { StoreCatalogue } from './store-catalogue.ts'; diff --git a/packages/local-service/src/store/store-tuning.ts b/apps/server/src/store/store-tuning.ts similarity index 100% rename from packages/local-service/src/store/store-tuning.ts rename to apps/server/src/store/store-tuning.ts diff --git a/packages/local-service/src/store/store-web-api.ts b/apps/server/src/store/store-web-api.ts similarity index 99% rename from packages/local-service/src/store/store-web-api.ts rename to apps/server/src/store/store-web-api.ts index fcb863b..32932d4 100644 --- a/packages/local-service/src/store/store-web-api.ts +++ b/apps/server/src/store/store-web-api.ts @@ -15,7 +15,7 @@ import { balanceOf } from '../profile/profile-currency.ts'; import { remainingPremiumDays } from '../profile/profile-entitlements.ts'; import { clearStoreCart, setStoreCart, storeCartIds } from '../profile/profile-store-cart.ts'; import { serverTimeNow } from '../profile/server-time.ts'; -import type { ServiceRequest, ServiceResponse } from '../server/exchange.ts'; +import type { ServiceRequest, ServiceResponse } from '../transport/exchange.ts'; import { jsonResponse, parseJsonBody, requireWebActionAccount, selectWebViewAccount } from '../web-ui/web-helpers.ts'; import { describeRedeemCodes, gjnText, redeemStoreCode, type RedeemOutcome } from './redeem-codes.ts'; import type { RedeemTuning } from './redeem-tuning.ts'; diff --git a/packages/local-service/src/store/web/app.js b/apps/server/src/store/web/app.js similarity index 100% rename from packages/local-service/src/store/web/app.js rename to apps/server/src/store/web/app.js diff --git a/packages/local-service/src/store/web/checkout.css b/apps/server/src/store/web/checkout.css similarity index 100% rename from packages/local-service/src/store/web/checkout.css rename to apps/server/src/store/web/checkout.css diff --git a/packages/local-service/src/store/web/checkout.js b/apps/server/src/store/web/checkout.js similarity index 100% rename from packages/local-service/src/store/web/checkout.js rename to apps/server/src/store/web/checkout.js diff --git a/packages/local-service/src/store/web/gallery.js b/apps/server/src/store/web/gallery.js similarity index 100% rename from packages/local-service/src/store/web/gallery.js rename to apps/server/src/store/web/gallery.js diff --git a/packages/local-service/src/store/web/index.html b/apps/server/src/store/web/index.html similarity index 100% rename from packages/local-service/src/store/web/index.html rename to apps/server/src/store/web/index.html diff --git a/packages/local-service/src/store/web/product.css b/apps/server/src/store/web/product.css similarity index 100% rename from packages/local-service/src/store/web/product.css rename to apps/server/src/store/web/product.css diff --git a/packages/local-service/src/store/web/products.js b/apps/server/src/store/web/products.js similarity index 100% rename from packages/local-service/src/store/web/products.js rename to apps/server/src/store/web/products.js diff --git a/packages/local-service/src/store/web/styles.css b/apps/server/src/store/web/styles.css similarity index 100% rename from packages/local-service/src/store/web/styles.css rename to apps/server/src/store/web/styles.css diff --git a/packages/local-service/src/store/yuplay-store-api.ts b/apps/server/src/store/yuplay-store-api.ts similarity index 98% rename from packages/local-service/src/store/yuplay-store-api.ts rename to apps/server/src/store/yuplay-store-api.ts index 3b332dc..260ac40 100644 --- a/packages/local-service/src/store/yuplay-store-api.ts +++ b/apps/server/src/store/yuplay-store-api.ts @@ -12,7 +12,7 @@ import { userIdFromJwt, userIdFromToken } from '../login/session-credentials.ts' import { yuplayAnswer } from '../login/yuplay-answer.ts'; import type { PlayerProfiles } from '../profile/player-profiles.ts'; import { serverTimeNow } from '../profile/server-time.ts'; -import type { ServiceRequest, ServiceResponse } from '../server/exchange.ts'; +import type { ServiceRequest, ServiceResponse } from '../transport/exchange.ts'; import { gjnText, redeemStoreCode, type RedeemOutcome } from './redeem-codes.ts'; import type { RedeemTuning } from './redeem-tuning.ts'; import type { StoreCatalogue } from './store-catalogue.ts'; diff --git a/packages/local-service/src/traffic-log/first-bytes.ts b/apps/server/src/traffic-log/first-bytes.ts similarity index 100% rename from packages/local-service/src/traffic-log/first-bytes.ts rename to apps/server/src/traffic-log/first-bytes.ts diff --git a/packages/local-service/src/traffic-log/traffic-log.ts b/apps/server/src/traffic-log/traffic-log.ts similarity index 97% rename from packages/local-service/src/traffic-log/traffic-log.ts rename to apps/server/src/traffic-log/traffic-log.ts index cfd9a0d..cbaed7b 100644 --- a/packages/local-service/src/traffic-log/traffic-log.ts +++ b/apps/server/src/traffic-log/traffic-log.ts @@ -1,5 +1,5 @@ /** - * Record of everything the game sent to the local service, so that what the client actually + * 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). * * /logs//requests.jsonl one JSON line per HTTP exchange or raw connection @@ -11,7 +11,7 @@ import { appendFileSync, mkdirSync, writeFileSync } from 'node:fs'; import type { IncomingHttpHeaders } from 'node:http'; import { join } from 'node:path'; -import type { ServiceRequest, ServiceResponse } from '../server/exchange.ts'; +import type { ServiceRequest, ServiceResponse } from '../transport/exchange.ts'; import type { FirstBytesInfo } from './first-bytes.ts'; export interface MatchingLogEntry { diff --git a/packages/local-service/src/server/exchange.ts b/apps/server/src/transport/exchange.ts similarity index 91% rename from packages/local-service/src/server/exchange.ts rename to apps/server/src/transport/exchange.ts index e89cda7..2f4c973 100644 --- a/packages/local-service/src/server/exchange.ts +++ b/apps/server/src/transport/exchange.ts @@ -1,7 +1,7 @@ /** * One HTTP request from the game and the answer to it, as the services see them. * - * The build points every Gaijin URL at the local service with the original host as the first + * The build points every Gaijin URL at the local server with the original host as the first * path segment: https://char-lw-….warthunder.com/char becomes * http://127.0.0.1:/char-lw-….warthunder.com/char. Requests whose host the login * component replaced on its own (YU2_AUTH_HOST and the like keep only the path) arrive @@ -43,7 +43,7 @@ export interface LogNotes { readonly omitResponseBody?: boolean; } -/** A Gaijin service emulated by the local service (one protocol-layer module each). */ +/** A Gaijin service emulated by the local server (one protocol-layer module each). */ export interface Service { readonly name: string; accepts(request: ServiceRequest): boolean; diff --git a/packages/local-service/src/server/http-listener.ts b/apps/server/src/transport/http-listener.ts similarity index 92% rename from packages/local-service/src/server/http-listener.ts rename to apps/server/src/transport/http-listener.ts index ff99fa1..c674dd4 100644 --- a/packages/local-service/src/server/http-listener.ts +++ b/apps/server/src/transport/http-listener.ts @@ -1,5 +1,5 @@ /** - * The HTTP side of the local service's port. port-listener.ts hands it every connection + * The HTTP side of the local server's port. port-listener.ts hands it every connection * that is not the matching protocol (TLS already decrypted); connections in other protocols * (chat) are recorded in the traffic log and left open without an answer. */ @@ -12,7 +12,7 @@ import { parseRequestTarget } from './request-target.ts'; import type { Router } from './router.ts'; const MAX_BODY_BYTES = 64 * 1024 * 1024; -/** Lets a launcher check that this process is the local service and is ready. */ +/** Lets a launcher check that this process is the local server and is ready. */ export const HEALTH_PATH = '/_wto/health'; /** Connection number given by the port listener, for the traffic log. */ @@ -29,7 +29,7 @@ export function createHttpServer(router: Router, log: TrafficLog, connectionOf: async function respond(incoming: IncomingMessage, outgoing: ServerResponse, body: Buffer): Promise { const target = parseRequestTarget(incoming.url ?? '/', incoming.headers.host); if (target.originalHost === undefined && target.path === HEALTH_PATH) { - outgoing.writeHead(200, { 'content-type': 'application/json' }).end(JSON.stringify({ app: 'wto-local-service', pid: process.pid })); + outgoing.writeHead(200, { 'content-type': 'application/json' }).end(JSON.stringify({ app: 'wto-server', pid: process.pid })); return; } const request: ServiceRequest = { method: incoming.method ?? 'GET', ...target, headers: incoming.headers, body }; diff --git a/packages/local-service/src/server/port-listener.ts b/apps/server/src/transport/port-listener.ts similarity index 97% rename from packages/local-service/src/server/port-listener.ts rename to apps/server/src/transport/port-listener.ts index fcfb11f..ab2dec6 100644 --- a/packages/local-service/src/server/port-listener.ts +++ b/apps/server/src/transport/port-listener.ts @@ -1,5 +1,5 @@ /** - * The local service's single listening port. Every address in the game's network.blk points + * The local server's single listening port. Every address in the game's network.blk points * here, and the network hook library routes all other outbound game * connections here as well (5.1). The first bytes of a connection decide which protocol handler * accepts it: diff --git a/packages/local-service/src/server/request-target.ts b/apps/server/src/transport/request-target.ts similarity index 97% rename from packages/local-service/src/server/request-target.ts rename to apps/server/src/transport/request-target.ts index 8e18d1b..311a5e9 100644 --- a/packages/local-service/src/server/request-target.ts +++ b/apps/server/src/transport/request-target.ts @@ -7,7 +7,7 @@ export interface RequestTarget { } /** - * Addresses rewritten by the build carry the original host as the first path segment (packages/build, + * Addresses rewritten by the build carry the original host as the first path segment (packages/patcher, * network/address-rewrite.ts moves only Gaijin hosts and external IPv4 addresses there, so only * those count as a host segment; "/login.php" is a path, not a host). Connections the network * hook library redirected keep their original URL, so their host is the diff --git a/packages/local-service/src/server/router.ts b/apps/server/src/transport/router.ts similarity index 86% rename from packages/local-service/src/server/router.ts rename to apps/server/src/transport/router.ts index 58b5926..9791535 100644 --- a/packages/local-service/src/server/router.ts +++ b/apps/server/src/transport/router.ts @@ -19,13 +19,13 @@ export class Router { async route(request: ServiceRequest): Promise { const service = this.#services.find((candidate) => candidate.accepts(request)); if (!service) { - return { service: 'none', response: { status: 404, body: 'no local service for this request', logNotes: { unhandled: true } } }; + return { service: 'none', response: { status: 404, body: 'no local server for this request', logNotes: { unhandled: true } } }; } try { return { service: service.name, response: await service.handle(request) }; } catch (error) { const message = error instanceof Error ? error.stack ?? error.message : String(error); - return { service: service.name, response: { status: 500, body: 'local service error', logNotes: { summary: 'ERROR', responseText: message } } }; + return { service: service.name, response: { status: 500, body: 'local server error', logNotes: { summary: 'ERROR', responseText: message } } }; } } } diff --git a/packages/local-service/src/server/tls/der.ts b/apps/server/src/transport/tls/der.ts similarity index 100% rename from packages/local-service/src/server/tls/der.ts rename to apps/server/src/transport/tls/der.ts diff --git a/packages/local-service/src/server/tls/tls-certificate.ts b/apps/server/src/transport/tls/tls-certificate.ts similarity index 89% rename from packages/local-service/src/server/tls/tls-certificate.ts rename to apps/server/src/transport/tls/tls-certificate.ts index f86c7cb..0c394f4 100644 --- a/packages/local-service/src/server/tls/tls-certificate.ts +++ b/apps/server/src/transport/tls/tls-certificate.ts @@ -1,10 +1,10 @@ /** - * The local service's TLS certificate: the network hook library sends - * the game's https connections to the local service's port, which answers them with this + * The local server's TLS certificate: the network hook library sends + * the game's https connections to the local server's port, which answers them with this * self-signed certificate. It is made on first start and kept in /tls/; it is * only ever presented to the game, never installed in the system's certificate store. * - * Key: ECDSA P-256. Certificate: X.509 v3, subject and issuer "WTOffline local service", + * Key: ECDSA P-256. Certificate: X.509 v3, subject and issuer "WTOffline local server", * signed with ecdsa-with-SHA256, valid from yesterday for 20 years. */ import { generateKeyPairSync, randomBytes, sign, type KeyObject } from 'node:crypto'; @@ -14,9 +14,9 @@ import { writeFileAtomic } from '../../storage/atomic-file.ts'; import { derBitString, derExplicit, derObjectId, derSequence, derSet, derSmallInteger, derUnsignedInteger, derUtcTime, derUtf8String } from './der.ts'; const FOLDER = 'tls'; -const KEY_FILE = 'local-service.key'; -const CERTIFICATE_FILE = 'local-service.crt'; -const COMMON_NAME = 'WTOffline local service'; +const KEY_FILE = 'server.key'; +const CERTIFICATE_FILE = 'server.crt'; +const COMMON_NAME = 'WTOffline local server'; const ECDSA_WITH_SHA256 = '1.2.840.10045.4.3.2'; const COMMON_NAME_ID = '2.5.4.3'; const VALID_YEARS = 20; diff --git a/packages/local-service/src/tuning/limits-tuning.ts b/apps/server/src/tuning/limits-tuning.ts similarity index 100% rename from packages/local-service/src/tuning/limits-tuning.ts rename to apps/server/src/tuning/limits-tuning.ts diff --git a/packages/local-service/src/tuning/tuning-loader.ts b/apps/server/src/tuning/tuning-loader.ts similarity index 95% rename from packages/local-service/src/tuning/tuning-loader.ts rename to apps/server/src/tuning/tuning-loader.ts index 6231b38..49f833a 100644 --- a/packages/local-service/src/tuning/tuning-loader.ts +++ b/apps/server/src/tuning/tuning-loader.ts @@ -1,6 +1,6 @@ /** * Load one tuning file: the defaults shipped in - * packages/local-service/tuning/.jsonc, with /tuning/.jsonc laid + * apps/server/tuning/.jsonc, with /tuning/.jsonc laid * over them field by field when the player or a developer put one there. Objects merge key * by key; any other value (numbers, texts, lists) in the override replaces the default. */ diff --git a/packages/local-service/src/tuning/tuning-reader.ts b/apps/server/src/tuning/tuning-reader.ts similarity index 100% rename from packages/local-service/src/tuning/tuning-reader.ts rename to apps/server/src/tuning/tuning-reader.ts diff --git a/packages/local-service/src/tuning/tuning.ts b/apps/server/src/tuning/tuning.ts similarity index 100% rename from packages/local-service/src/tuning/tuning.ts rename to apps/server/src/tuning/tuning.ts diff --git a/packages/local-service/src/unlocks/unlock-purchase.ts b/apps/server/src/unlocks/unlock-purchase.ts similarity index 100% rename from packages/local-service/src/unlocks/unlock-purchase.ts rename to apps/server/src/unlocks/unlock-purchase.ts diff --git a/packages/local-service/src/web-ui/game-artwork.ts b/apps/server/src/web-ui/game-artwork.ts similarity index 100% rename from packages/local-service/src/web-ui/game-artwork.ts rename to apps/server/src/web-ui/game-artwork.ts diff --git a/packages/local-service/src/web-ui/store-media-cache.ts b/apps/server/src/web-ui/store-media-cache.ts similarity index 96% rename from packages/local-service/src/web-ui/store-media-cache.ts rename to apps/server/src/web-ui/store-media-cache.ts index dbdccb2..036347b 100644 --- a/packages/local-service/src/web-ui/store-media-cache.ts +++ b/apps/server/src/web-ui/store-media-cache.ts @@ -1,14 +1,14 @@ /** * Serve pre-cached store covers, screenshots, and demo clips from local disk only. * - * The local service listens strictly on loopback and never initiates outbound network + * The local server listens strictly on loopback and never initiates outbound network * requests: files present in the player's offline asset pack or local media cache are * served directly (with HTTP byte-range support for video playback), while uncached * paths immediately return 404 so the browser UI falls back without stalling. */ import { existsSync, readFileSync } from 'node:fs'; import { join } from 'node:path'; -import type { ServiceResponse } from '../server/exchange.ts'; +import type { ServiceResponse } from '../transport/exchange.ts'; export const STORE_MEDIA_PREFIX = 'store-media/'; diff --git a/packages/local-service/src/web-ui/web-helpers.ts b/apps/server/src/web-ui/web-helpers.ts similarity index 98% rename from packages/local-service/src/web-ui/web-helpers.ts rename to apps/server/src/web-ui/web-helpers.ts index ed29bd7..a91075b 100644 --- a/packages/local-service/src/web-ui/web-helpers.ts +++ b/apps/server/src/web-ui/web-helpers.ts @@ -7,7 +7,7 @@ import { readFileSync } from 'node:fs'; import { extname, join } from 'node:path'; import { fileURLToPath } from 'node:url'; import type { Account, AccountStore } from '../accounts/account-store.ts'; -import type { ServiceResponse } from '../server/exchange.ts'; +import type { ServiceResponse } from '../transport/exchange.ts'; const CONTENT_TYPES: Readonly> = { '.html': 'text/html; charset=utf-8', diff --git a/packages/local-service/src/web-ui/web-ui-service.ts b/apps/server/src/web-ui/web-ui-service.ts similarity index 99% rename from packages/local-service/src/web-ui/web-ui-service.ts rename to apps/server/src/web-ui/web-ui-service.ts index d1dd435..f0d9852 100644 --- a/packages/local-service/src/web-ui/web-ui-service.ts +++ b/apps/server/src/web-ui/web-ui-service.ts @@ -19,7 +19,7 @@ import { existsSync, readFileSync } from 'node:fs'; import { resolve, sep } from 'node:path'; import type { WebIcons } from '../game-data/datasets/web-icons.ts'; import type { UiLabels } from '../game-data/datasets/ui-labels.ts'; -import type { Service, ServiceRequest, ServiceResponse } from '../server/exchange.ts'; +import type { Service, ServiceRequest, ServiceResponse } from '../transport/exchange.ts'; import type { GameArtwork } from './game-artwork.ts'; import { StoreMediaCache, STORE_MEDIA_PREFIX } from './store-media-cache.ts'; import { contentResponse, createStaticWebSite, notFound } from './web-helpers.ts'; diff --git a/packages/local-service/src/web-ui/web/common.css b/apps/server/src/web-ui/web/common.css similarity index 100% rename from packages/local-service/src/web-ui/web/common.css rename to apps/server/src/web-ui/web/common.css diff --git a/packages/local-service/src/web-ui/web/common.js b/apps/server/src/web-ui/web/common.js similarity index 99% rename from packages/local-service/src/web-ui/web/common.js rename to apps/server/src/web-ui/web/common.js index 55fa26b..355e732 100644 --- a/packages/local-service/src/web-ui/web/common.js +++ b/apps/server/src/web-ui/web/common.js @@ -117,7 +117,7 @@ const WtoUi = (() => { } } - /** Page startup depends only on metadata served by the local service. */ + /** Page startup depends only on metadata served by the local server. */ async function loadImageSources(withStore = false) { const [images, index, store] = await Promise.all([ mediaJson('/_wto/ui/official-images.json', officialImages), diff --git a/packages/local-service/src/web-ui/web/official-images.json b/apps/server/src/web-ui/web/official-images.json similarity index 100% rename from packages/local-service/src/web-ui/web/official-images.json rename to apps/server/src/web-ui/web/official-images.json diff --git a/packages/local-service/src/web-ui/web/official-store-media.json b/apps/server/src/web-ui/web/official-store-media.json similarity index 100% rename from packages/local-service/src/web-ui/web/official-store-media.json rename to apps/server/src/web-ui/web/official-store-media.json diff --git a/packages/local-service/tuning/battle-economy.jsonc b/apps/server/tuning/battle-economy.jsonc similarity index 100% rename from packages/local-service/tuning/battle-economy.jsonc rename to apps/server/tuning/battle-economy.jsonc diff --git a/packages/local-service/tuning/battle.jsonc b/apps/server/tuning/battle.jsonc similarity index 100% rename from packages/local-service/tuning/battle.jsonc rename to apps/server/tuning/battle.jsonc diff --git a/packages/local-service/tuning/clans.jsonc b/apps/server/tuning/clans.jsonc similarity index 100% rename from packages/local-service/tuning/clans.jsonc rename to apps/server/tuning/clans.jsonc diff --git a/packages/local-service/tuning/limits.jsonc b/apps/server/tuning/limits.jsonc similarity index 100% rename from packages/local-service/tuning/limits.jsonc rename to apps/server/tuning/limits.jsonc diff --git a/packages/local-service/tuning/marketplace.jsonc b/apps/server/tuning/marketplace.jsonc similarity index 100% rename from packages/local-service/tuning/marketplace.jsonc rename to apps/server/tuning/marketplace.jsonc diff --git a/packages/local-service/tuning/new-profile.jsonc b/apps/server/tuning/new-profile.jsonc similarity index 100% rename from packages/local-service/tuning/new-profile.jsonc rename to apps/server/tuning/new-profile.jsonc diff --git a/packages/local-service/tuning/recycling.jsonc b/apps/server/tuning/recycling.jsonc similarity index 100% rename from packages/local-service/tuning/recycling.jsonc rename to apps/server/tuning/recycling.jsonc diff --git a/packages/local-service/tuning/redeem-codes.jsonc b/apps/server/tuning/redeem-codes.jsonc similarity index 100% rename from packages/local-service/tuning/redeem-codes.jsonc rename to apps/server/tuning/redeem-codes.jsonc diff --git a/packages/local-service/tuning/research.jsonc b/apps/server/tuning/research.jsonc similarity index 100% rename from packages/local-service/tuning/research.jsonc rename to apps/server/tuning/research.jsonc diff --git a/packages/local-service/tuning/store.jsonc b/apps/server/tuning/store.jsonc similarity index 100% rename from packages/local-service/tuning/store.jsonc rename to apps/server/tuning/store.jsonc diff --git a/packages/local-service/tuning/supply-chests.jsonc b/apps/server/tuning/supply-chests.jsonc similarity index 100% rename from packages/local-service/tuning/supply-chests.jsonc rename to apps/server/tuning/supply-chests.jsonc diff --git a/packages/local-service/tuning/trophies.jsonc b/apps/server/tuning/trophies.jsonc similarity index 100% rename from packages/local-service/tuning/trophies.jsonc rename to apps/server/tuning/trophies.jsonc diff --git a/native/wto-net/src/connection_hooks.c b/native/wto-net/src/connection_hooks.c index debeb85..5ede431 100644 --- a/native/wto-net/src/connection_hooks.c +++ b/native/wto-net/src/connection_hooks.c @@ -1,6 +1,6 @@ /* * Connections and datagrams: a destination that is the marker address - * or outside the loopback network goes to 127.0.0.1: instead; when that + * or outside the loopback network goes to 127.0.0.1: instead; when that * is impossible (no port configured, IPv6 destination) the call fails as unreachable. * * ConnectEx is not an export: programs fetch it with WSAIoctl(SIO_GET_EXTENSION_FUNCTION_POINTER), @@ -28,7 +28,7 @@ static WSAIoctl_fn real_WSAIoctl; static LPFN_CONNECTEX real_ConnectEx; /* - * The destination to use: the original one, or the local service. Returns 0 when the call + * The destination to use: the original one, or the local server. Returns 0 when the call * must fail (WSAENETUNREACH is set). Connections are logged; datagrams only when refused or * the first time a destination is seen would be too noisy to track, so only refusals. */ diff --git a/native/wto-net/src/dll_main.c b/native/wto-net/src/dll_main.c index aaf91e8..54ff46f 100644 --- a/native/wto-net/src/dll_main.c +++ b/native/wto-net/src/dll_main.c @@ -2,7 +2,7 @@ * wto_ws.dll: the network hook library of WTOffline. * * aces.exe imports its network functions from this DLL instead of WS2_32.dll - * (exe-patches/online/network-hook-library). Every export is forwarded to the system's + * (patches/exe/online/network-hook-library). Every export is forwarded to the system's * ws2_32.dll (wto_ws.def); on load the DLL hooks the resolution, connection and datagram * functions of the system's ws2_32.dll itself with MinHook, so the calls of every module in * the process pass through the hooks, not only the executable's. diff --git a/native/wto-net/src/hook_config.c b/native/wto-net/src/hook_config.c index b60a185..d559225 100644 --- a/native/wto-net/src/hook_config.c +++ b/native/wto-net/src/hook_config.c @@ -1,7 +1,7 @@ /* * Settings and log next to the DLL. * - * wto_ws.cfg, written by the build into the game copy: one line "port=". + * wto_ws.cfg, written by the build into the game copy: one line "port=". * Without a valid port the hooks still answer every host name locally but refuse every * connection that would leave the machine. * @@ -62,7 +62,7 @@ void config_load(HMODULE self) read_port(); if (_snwprintf_s(path, MAX_PATH, _TRUNCATE, L"%swto_ws.log", g_folder) >= 0) g_log = _wfsopen(path, L"w", _SH_DENYWR); - log_line("wto_ws: local service port %u%s", g_service_port, g_service_port ? "" : " (none: outside connections are refused)"); + log_line("wto_ws: local server port %u%s", g_service_port, g_service_port ? "" : " (none: outside connections are refused)"); } void log_line(const char *format, ...) diff --git a/native/wto-net/src/local_mp_awards.c b/native/wto-net/src/local_mp_awards.c index 45c36db..f2f00ca 100644 --- a/native/wto-net/src/local_mp_awards.c +++ b/native/wto-net/src/local_mp_awards.c @@ -6,8 +6,8 @@ * "InBattleReward". A LocalMP host has no battle server, so the kill and event hooks call * local_mp_report_award_event() instead. It raises the HUD script event * LMP_AWARD_EVENT_NAME carrying facts only (event code, victim class and name); the - * scripts price it with the parameters sent by the local service, show the banner and keep - * the record that the local service settles after the battle. Nothing here computes money. + * scripts price it with the parameters sent by the local server, show the banner and keep + * the record that the local server settles after the battle. Nothing here computes money. * * The event is queued with the same call addScoreMessage uses, but without its * "hudShowAwardMessages" option gate, so the record does not depend on a HUD setting. diff --git a/native/wto-net/src/local_mp_offsets.h b/native/wto-net/src/local_mp_offsets.h index da642f1..3ee53db 100644 --- a/native/wto-net/src/local_mp_offsets.h +++ b/native/wto-net/src/local_mp_offsets.h @@ -55,7 +55,7 @@ #define LMP_MIS_OFF_ARCADE_COUNTRY 0x01d0u #define LMP_MIS_OFF_CUSTOM_BOTS 0x0718u /* MissionSettings copy of the mission block customScoreParams (2.61.0.37 loader 0x12657a0 copies it at - * 0x126d762); the client never reads it, local_mp_scores.c reads the local service's score table there. */ + * 0x126d762); the client never reads it, local_mp_scores.c reads the local server's score table there. */ #define LMP_MIS_OFF_CUSTOM_SCORE_PARAMS 0x06d8u #define LMP_MATCH_INFO_OFF_TEAM 0x0004u diff --git a/native/wto-net/src/local_mp_scores.c b/native/wto-net/src/local_mp_scores.c index e56acb7..1eb4da8 100644 --- a/native/wto-net/src/local_mp_scores.c +++ b/native/wto-net/src/local_mp_scores.c @@ -1,7 +1,7 @@ /* * Mission scores of combat events on the LocalMP scoreboard, read from the mission settings. * - * Online the battle server scores every event. The local service writes the official mission + * Online the battle server scores every event. The local server writes the official mission * scores (tuning/battle-economy.jsonc, BattleEconomy.missionScores) into the mission settings * block `customScoreParams`, which the 2.61.0.37 client copies into MissionSettings+0x6d8 * (0x126d762 in the mission settings loader 0x12657a0) and never reads itself. Keys: diff --git a/native/wto-net/src/redirect_rules.c b/native/wto-net/src/redirect_rules.c index 58606e8..f91c434 100644 --- a/native/wto-net/src/redirect_rules.c +++ b/native/wto-net/src/redirect_rules.c @@ -55,7 +55,7 @@ enum redirect_result redirect_destination(const struct sockaddr *name, int lengt if (!is_marker_v4(&v4) && is_loopback_v4(&v4)) return REDIRECT_KEEP; } - /* The local service listens on IPv4 only, which an IPv6 socket cannot always reach. */ + /* The local server listens on IPv4 only, which an IPv6 socket cannot always reach. */ return REDIRECT_REFUSE; } return REDIRECT_KEEP; diff --git a/native/wto-net/src/redirect_rules.h b/native/wto-net/src/redirect_rules.h index 3fcc413..d00bda2 100644 --- a/native/wto-net/src/redirect_rules.h +++ b/native/wto-net/src/redirect_rules.h @@ -2,9 +2,9 @@ * Where a connection may go. * * Every host name resolves to MARKER_ADDRESS (127.0.0.2). A destination that is the marker, - * or any address outside the loopback network, is replaced by 127.0.0.1:; + * or any address outside the loopback network, is replaced by 127.0.0.1:; * other loopback addresses (127.0.0.1 and the rest of 127/8, ::1) are left alone, because the - * game reaches the local service and its own helpers there. + * game reaches the local server and its own helpers there. */ #pragma once @@ -14,12 +14,12 @@ #define MARKER_ADDRESS "127.0.0.2" #define MARKER_ADDRESS_W L"127.0.0.2" -/* The local service port read from wto_ws.cfg; 0 when there is none, and then nothing is let out. */ +/* The local server port read from wto_ws.cfg; 0 when there is none, and then nothing is let out. */ extern unsigned short g_service_port; enum redirect_result { REDIRECT_KEEP, /* leave the destination as it is */ - REDIRECT_CHANGED, /* *out holds the local service address */ + REDIRECT_CHANGED, /* *out holds the local server address */ REDIRECT_REFUSE /* no way to keep it local: fail the call */ }; diff --git a/package-lock.json b/package-lock.json index f8924b5..01d57d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,6 +6,7 @@ "": { "name": "wto", "workspaces": [ + "apps/*", "packages/*" ], "devDependencies": { @@ -16,6 +17,15 @@ "node": ">=24" } }, + "apps/server": { + "name": "@wto/server", + "version": "0.1.0", + "dependencies": { + "@wto/blk": "*", + "@wto/jsonc": "*", + "@wto/vromfs": "*" + } + }, "node_modules/@types/node": { "version": "24.19.2", "resolved": "https://registry.npmjs.org/@types/node/-/node-24.19.2.tgz", @@ -30,10 +40,6 @@ "resolved": "packages/blk", "link": true }, - "node_modules/@wto/build": { - "resolved": "packages/build", - "link": true - }, "node_modules/@wto/exepatch": { "resolved": "packages/exepatch", "link": true @@ -42,8 +48,12 @@ "resolved": "packages/jsonc", "link": true }, - "node_modules/@wto/local-service": { - "resolved": "packages/local-service", + "node_modules/@wto/patcher": { + "resolved": "packages/patcher", + "link": true + }, + "node_modules/@wto/server": { + "resolved": "apps/server", "link": true }, "node_modules/@wto/vromfs": { @@ -75,13 +85,6 @@ "name": "@wto/blk", "version": "0.1.0" }, - "packages/build": { - "name": "@wto/build", - "version": "0.1.0", - "dependencies": { - "@wto/jsonc": "*" - } - }, "packages/exepatch": { "name": "@wto/exepatch", "version": "0.1.0", @@ -93,11 +96,12 @@ "name": "@wto/jsonc", "version": "0.1.0" }, - "packages/local-service": { - "name": "@wto/local-service", + "packages/patcher": { + "name": "@wto/patcher", "version": "0.1.0", "dependencies": { "@wto/blk": "*", + "@wto/exepatch": "*", "@wto/jsonc": "*", "@wto/vromfs": "*" } diff --git a/package.json b/package.json index e42a713..a6c42ed 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,10 @@ { "name": "wto", "private": true, - "description": "War Thunder offline project: local services emulating Gaijin's servers, and the build pipeline for the game copy.", + "description": "War Thunder offline project: a local server emulating Gaijin's servers, and the patcher that builds the game copy.", "type": "module", "workspaces": [ + "apps/*", "packages/*" ], "scripts": { @@ -16,4 +17,4 @@ "@types/node": "^24.19.2", "typescript": "5.9" } -} +} \ No newline at end of file diff --git a/packages/blk/src/stable-guid.ts b/packages/blk/src/stable-guid.ts index f71e124..655308e 100644 --- a/packages/blk/src/stable-guid.ts +++ b/packages/blk/src/stable-guid.ts @@ -1,7 +1,7 @@ /** * Deterministic GUID derived from a text (SHA-1, formatted 8-4-4-4-12, upper case). The build * registers `stableGuid()` for the offline vehicle packs in config/gui.blk - * `bundles/guid`, and the local service gives the same GUID to the same store product, so the + * `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. */ diff --git a/packages/build/src/store/offline-bundles.ts b/packages/build/src/store/offline-bundles.ts deleted file mode 100644 index 2263be7..0000000 --- a/packages/build/src/store/offline-bundles.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Offline store bundle GUIDs for config/gui.blk `bundles/guid`. - * - * The game opens a gift vehicle's own store page only when `getBundleId()` finds a - * GUID for it (scripts/onlineShop/onlineShopModel.nut showUnitGoods → doBrowserPurchaseByGuid); - * the URL then comes from the local service's item_info.php `url` field. Every vehicle carrying - * `gift` in char.vromfs.bin config/wpcost.blk gets `stableGuid(wto_pack_)`, and every - * multi-vehicle pack listed in the local service's tuning/store.jsonc gets `stableGuid()`; - * entries the store does not sell are never looked up, so registering extra ones is harmless. - */ -import { existsSync, readFileSync } from 'node:fs'; -import { singleVehiclePackId, stableGuid, type BlkBlock } from '@wto/blk'; -import { parseJsonc } from '@wto/jsonc'; -import { readPackBlk } from '../pack-edit.ts'; - -export const WPCOST_PATH = 'config/wpcost.blk'; - -export function offlinePackBundleGuids(charPack: Uint8Array, storeTuningPath: string): Array { - const ids = new Set(); - for (const vehicle of giftVehicles(readPackBlk(charPack, WPCOST_PATH))) ids.add(singleVehiclePackId(vehicle)); - for (const id of multiVehiclePackIds(storeTuningPath)) ids.add(id); - return [...ids].sort().map((id) => [id, stableGuid(id)] as const); -} - -function giftVehicles(wpcost: BlkBlock): string[] { - return wpcost.blocks.filter((unit) => unit.params.some((param) => param.name === 'gift')).map((unit) => unit.name); -} - -/** Pack ids of `vehiclePacks.multiVehiclePacks` in tuning/store.jsonc. */ -function multiVehiclePackIds(storeTuningPath: string): string[] { - if (!existsSync(storeTuningPath)) return []; - const tuning = parseJsonc(readFileSync(storeTuningPath, 'utf8')) as { - readonly vehiclePacks?: { readonly multiVehiclePacks?: ReadonlyArray<{ readonly id?: unknown }> }; - }; - const packs = tuning.vehiclePacks?.multiVehiclePacks ?? []; - return packs.map((pack, index) => { - if (typeof pack.id !== 'string' || pack.id === '') { - throw new Error(`${storeTuningPath}: vehiclePacks.multiVehiclePacks[${index}].id must be a non-empty string`); - } - return pack.id; - }); -} diff --git a/packages/exepatch/src/definition.ts b/packages/exepatch/src/definition.ts index b4be444..cb58acf 100644 --- a/packages/exepatch/src/definition.ts +++ b/packages/exepatch/src/definition.ts @@ -1,6 +1,6 @@ /** * Patch definitions as stored on disk, one directory per change to the program's behaviour, - * under exe-patches///: + * under patches/exe///: * * patch.jsonc id, title, features, required patches, the game versions it was verified * on, and the bytes to write; comments explain the change and why the local diff --git a/packages/exepatch/src/index.ts b/packages/exepatch/src/index.ts index 1b42d96..6ee8074 100644 --- a/packages/exepatch/src/index.ts +++ b/packages/exepatch/src/index.ts @@ -1,5 +1,5 @@ /** - * Apply the declarative patches under exe-patches/ to aces.exe: locate every site and verify + * Apply the declarative patches under patches/exe/ to aces.exe: locate every site and verify * every original byte first, then write. A site that is missing or ambiguous is reported, * never guessed. Authoring patches (building signatures, assembling) is development-side * work done in tools/. diff --git a/packages/local-service/src/index.ts b/packages/local-service/src/index.ts deleted file mode 100644 index a381f8c..0000000 --- a/packages/local-service/src/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * The local service: emulates Gaijin's servers on this machine so the unmodified game logic - * signs in, loads the profile and sends player actions as it would online. - */ -export { LOOPBACK, startLocalService, type LocalServiceOptions, type RunningLocalService } from './local-service.ts'; -export { HEALTH_PATH } from './server/http-listener.ts'; diff --git a/packages/build/package.json b/packages/patcher/package.json similarity index 52% rename from packages/build/package.json rename to packages/patcher/package.json index 6b8b8e2..dd4676d 100644 --- a/packages/build/package.json +++ b/packages/patcher/package.json @@ -1,5 +1,5 @@ { - "name": "@wto/build", + "name": "@wto/patcher", "version": "0.1.0", "private": true, "type": "module", @@ -7,6 +7,9 @@ ".": "./src/index.ts" }, "dependencies": { - "@wto/jsonc": "*" + "@wto/blk": "*", + "@wto/exepatch": "*", + "@wto/jsonc": "*", + "@wto/vromfs": "*" } -} +} \ No newline at end of file diff --git a/packages/build/src/char-pack.ts b/packages/patcher/src/char-pack.ts similarity index 98% rename from packages/build/src/char-pack.ts rename to packages/patcher/src/char-pack.ts index 92f06b5..9a58277 100644 --- a/packages/build/src/char-pack.ts +++ b/packages/patcher/src/char-pack.ts @@ -1,5 +1,5 @@ /** - * Rebuild char.vromfs.bin: config/network.blk pointed at the local service, the offline + * Rebuild char.vromfs.bin: config/network.blk pointed at the local server, the offline * version's features turned on in config/game_settings.blk, every vehicle shown in the * tech tree (config/shop.blk), and, unless the player gave a decal source, placeholder decal * and skin indexes (decals/offline-decal-index.ts). diff --git a/packages/build/src/decals/offline-decal-index.ts b/packages/patcher/src/decals/offline-decal-index.ts similarity index 100% rename from packages/build/src/decals/offline-decal-index.ts rename to packages/patcher/src/decals/offline-decal-index.ts diff --git a/packages/build/src/decals/player-decal-cache.ts b/packages/patcher/src/decals/player-decal-cache.ts similarity index 97% rename from packages/build/src/decals/player-decal-cache.ts rename to packages/patcher/src/decals/player-decal-cache.ts index e6ad36e..8af5b92 100644 --- a/packages/build/src/decals/player-decal-cache.ts +++ b/packages/patcher/src/decals/player-decal-cache.ts @@ -7,7 +7,7 @@ * - cache/content/ is the web cache root ("ContentProvider::init mount=/cache/content/"). * - dldata_s.info names the current indexes; when the request for it fails, the client reads * the cached copy ("failed to get dlContent index hashes from %s, will fallback local copy", - * 0xd3eb40), and the local service answers that request with 404. + * 0xd3eb40), and the local server answers that request with 404. * - downloadable_decals..blk is the decal index as the CDN served it, with its signature * (0xd383e0 checks it and deletes a file that fails). If the file named by dldata_s.info is * missing, the newest valid downloadable_decals.*.blk in the folder is used (0xd3f610). diff --git a/packages/build/src/executable.ts b/packages/patcher/src/executable.ts similarity index 89% rename from packages/build/src/executable.ts rename to packages/patcher/src/executable.ts index 01977d7..03a35ad 100644 --- a/packages/build/src/executable.ts +++ b/packages/patcher/src/executable.ts @@ -1,5 +1,5 @@ /** - * Patch a copy of aces.exe with every definition under exe-patches/. When any patch cannot be + * Patch a copy of aces.exe with every definition under patches/exe/. When any patch cannot be * applied, no executable is produced; the result lists the unavailable patches and the * features they cover. */ diff --git a/packages/build/src/features/offline-features.ts b/packages/patcher/src/features/offline-features.ts similarity index 100% rename from packages/build/src/features/offline-features.ts rename to packages/patcher/src/features/offline-features.ts diff --git a/packages/build/src/game-copy.ts b/packages/patcher/src/game-copy.ts similarity index 100% rename from packages/build/src/game-copy.ts rename to packages/patcher/src/game-copy.ts diff --git a/packages/build/src/gui-pack.ts b/packages/patcher/src/gui-pack.ts similarity index 93% rename from packages/build/src/gui-pack.ts rename to packages/patcher/src/gui-pack.ts index 82cc28e..7746f72 100644 --- a/packages/build/src/gui-pack.ts +++ b/packages/patcher/src/gui-pack.ts @@ -1,16 +1,14 @@ /** - * Rebuild gui.vromfs.bin by applying the script patch definitions in `gui-patches/` + * Rebuild gui.vromfs.bin by applying the script patch definitions in `patches/gui/` * (implementation notes, format in gui-patch-definition.ts). * * Every edit must find its stock text exactly once in the current script; anything else * refuses the whole build rather than writing a half-patched archive. */ -import { fileURLToPath } from 'node:url'; import { getFile, putFile, readArchive, writeArchive } from '@wto/vromfs'; import { loadGuiPatches, type GuiScriptPatch } from './gui-patch-definition.ts'; import type { LocalEndpoint } from './network/local-endpoint.ts'; -const DEFAULT_GUI_PATCHES_DIR = fileURLToPath(new URL('../../../gui-patches', import.meta.url)); const ENDPOINT_PLACEHOLDER = '{{LOCAL_ENDPOINT}}'; export interface GuiPackResult { @@ -21,7 +19,7 @@ export interface GuiPackResult { export function rebuildGuiPack( stockPack: Uint8Array, endpoint: LocalEndpoint, - patchesFolder: string = DEFAULT_GUI_PATCHES_DIR, + patchesFolder: string, ): GuiPackResult { const patches = loadGuiPatches(patchesFolder); const archive = readArchive(stockPack); diff --git a/packages/build/src/gui-patch-definition.ts b/packages/patcher/src/gui-patch-definition.ts similarity index 98% rename from packages/build/src/gui-patch-definition.ts rename to packages/patcher/src/gui-patch-definition.ts index a9c23d4..500ca3e 100644 --- a/packages/build/src/gui-patch-definition.ts +++ b/packages/patcher/src/gui-patch-definition.ts @@ -1,10 +1,10 @@ /** * GUI script patch definitions as stored on disk, one folder per change under - * `gui-patches///`: + * `patches/gui///`: * * patch.jsonc id, title, target script, features, the game versions it was verified on, * and the list of edits; comments explain what the change does and why the - * local service cannot provide it + * local server cannot provide it * .nut the edit fragments named by `edits` (stock text to find, text to put there) * * Fragment files hold the exact script text followed by one terminating newline, which is not diff --git a/packages/build/src/index.ts b/packages/patcher/src/index.ts similarity index 61% rename from packages/build/src/index.ts rename to packages/patcher/src/index.ts index e8a4dce..20b7a32 100644 --- a/packages/build/src/index.ts +++ b/packages/patcher/src/index.ts @@ -1,9 +1,10 @@ /** - * The build pipeline for the game copy: point the client at the local - * service and patch the executable. Used by the development command line (cli.ts) and, - * later, by the launcher at every launch. + * The patcher: builds the game copy by pointing the client at the local server + * and patching the executable. Used by the development script scripts/build-game-copy.ts and by + * the launcher. The patch definitions and the network hook library are given by the caller. */ export { NETWORK_CONFIG_PATH, rebuildCharPack, type CharPackResult } from './char-pack.ts'; +export { copyPlayerDecalCache, playerDecalCacheProblem } from './decals/player-decal-cache.ts'; export { patchExecutable, type ExecutableResult } from './executable.ts'; export { assertWritableCopy, GAME_FILES } from './game-copy.ts'; export { rebuildGuiPack, type GuiPackResult } from './gui-pack.ts'; @@ -11,4 +12,6 @@ export { loadGuiPatches, type GuiScriptEdit, type GuiScriptPatch } from './gui-p export { ENGINE_SETTINGS_PATH, EXTRA_STORE_BUNDLE_GUID_MAP, EXTRA_STORE_BUNDLE_GUIDS, rebuildMainPack, type MainPackResult } from './main-pack.ts'; export { redirectAddresses, type AddressChange } from './network/address-rewrite.ts'; export { hostPort, localEndpoint, localUrl, type LocalEndpoint } from './network/local-endpoint.ts'; +export { NETWORK_HOOK_LIBRARY, networkHookSettings } from './network/network-hook.ts'; export { redirectNetworkConfig, type NetworkRedirectReport } from './network/redirect-network-config.ts'; +export { offlinePackBundleGuids } from './store/offline-bundles.ts'; diff --git a/packages/build/src/main-pack.ts b/packages/patcher/src/main-pack.ts similarity index 98% rename from packages/build/src/main-pack.ts rename to packages/patcher/src/main-pack.ts index dafb0e9..5405f95 100644 --- a/packages/build/src/main-pack.ts +++ b/packages/patcher/src/main-pack.ts @@ -6,7 +6,7 @@ * engine's public-configs module downloads files at startup, including a signed network.blk * that would replace the one in char.vromfs.bin (DagorEngine prog/gameLibs/publicConfigs/ * publicConfigs.cpp, init). On a machine with internet access the download would succeed and - * point the game back at Gaijin's servers. Redirected, the request reaches the local service; + * point the game back at Gaijin's servers. Redirected, the request reaches the local server; * it has no such file, so the game keeps the network.blk of char.vromfs.bin. * * Only the `network` block is touched: the rest of settings.blk is engine configuration, not diff --git a/packages/build/src/network/address-rewrite.ts b/packages/patcher/src/network/address-rewrite.ts similarity index 97% rename from packages/build/src/network/address-rewrite.ts rename to packages/patcher/src/network/address-rewrite.ts index a6c9f55..1128b60 100644 --- a/packages/build/src/network/address-rewrite.ts +++ b/packages/patcher/src/network/address-rewrite.ts @@ -8,7 +8,7 @@ * * Bare Gaijin host names without a port (e.g. the event log host) are left as they are so the * client keeps their Host header and SNI; wto_ws.dll resolves them locally and sends their - * connections to the local service port. Everything else (file patterns, + * connections to the local server port. Everything else (file patterns, * placeholders such as "https://not.used", DNS server IPs) is also left as it is. */ import { visitParams, type BlkBlock } from '@wto/blk'; diff --git a/packages/build/src/network/local-endpoint.ts b/packages/patcher/src/network/local-endpoint.ts similarity index 81% rename from packages/build/src/network/local-endpoint.ts rename to packages/patcher/src/network/local-endpoint.ts index 4bcdaf3..3e34607 100644 --- a/packages/build/src/network/local-endpoint.ts +++ b/packages/patcher/src/network/local-endpoint.ts @@ -1,4 +1,4 @@ -/** Where the local service listens. The port is chosen at every launch. */ +/** Where the local server listens. The port is chosen at every launch. */ export interface LocalEndpoint { readonly host: string; readonly port: number; @@ -11,14 +11,14 @@ export function localEndpoint(port: number): LocalEndpoint { return { host: LOOPBACK, port }; } -/** `host:port` of the local service. */ +/** `host:port` of the local server. */ export function hostPort(endpoint: LocalEndpoint): string { return `${endpoint.host}:${endpoint.port}`; } /** * Local URL standing in for a Gaijin URL. The original host becomes the first path segment, - * so the local service can tell which Gaijin service a request was meant for even when two + * so the local server can tell which Gaijin service a request was meant for even when two * services use the same path (char and inventory both use "/char"). */ export function localUrl(endpoint: LocalEndpoint, originalHost: string, originalPath: string, scheme: 'http' | 'ws' = 'http'): string { diff --git a/packages/build/src/network/login-overrides.ts b/packages/patcher/src/network/login-overrides.ts similarity index 89% rename from packages/build/src/network/login-overrides.ts rename to packages/patcher/src/network/login-overrides.ts index 43e180a..6a38c0c 100644 --- a/packages/build/src/network/login-overrides.ts +++ b/packages/patcher/src/network/login-overrides.ts @@ -3,7 +3,7 @@ * component. * * The URL keys get a local URL built from the login component's default address for that - * key, so the local service sees which login request was meant. Only `loginURL`'s default is + * key, so the local server sees which login request was meant. Only `loginURL`'s default is * certain (https://auth.gaijinent.com/login.php); the others are matched by name to the * addresses in the executable's string table. * @@ -12,7 +12,7 @@ * `fallbackIP` (yu_init.cpp) substitutes a bare IP literal on port 443 when DNS fails — both * strip the original Host/SNI domain and bypass wto_ws.dll's DNS-based routing. Leaving the * Gaijin host names in place lets wto_ws.dll resolve them to 127.0.0.2 and route their TLS - * connections to the local service port with the original Host and SNI intact. + * connections to the local server port with the original Host and SNI intact. */ import { localUrl, type LocalEndpoint } from './local-endpoint.ts'; diff --git a/packages/build/src/network/network-hook.ts b/packages/patcher/src/network/network-hook.ts similarity index 100% rename from packages/build/src/network/network-hook.ts rename to packages/patcher/src/network/network-hook.ts diff --git a/packages/build/src/network/redirect-network-config.ts b/packages/patcher/src/network/redirect-network-config.ts similarity index 95% rename from packages/build/src/network/redirect-network-config.ts rename to packages/patcher/src/network/redirect-network-config.ts index e82311d..bf2e27a 100644 --- a/packages/build/src/network/redirect-network-config.ts +++ b/packages/patcher/src/network/redirect-network-config.ts @@ -1,12 +1,12 @@ /** - * Point config/network.blk at the local service. + * Point config/network.blk at the local server. * * The environment names stay as they are: the stock scripts branch on the environment name * (for example on whether it contains "production"), so renaming it would change client * behaviour. Instead: - * - every server address in the file is rewritten to the local service (address-rewrite.ts); + * - every server address in the file is rewritten to the local server (address-rewrite.ts); * - every environment block (a block with `charServer` entries) gets certificate checking - * turned off and its login component settings pointed at the local service. + * turned off and its login component settings pointed at the local server. */ import { ensureBlock, findParam, setParam, type BlkBlock } from '@wto/blk'; import { redirectAddresses, type AddressChange } from './address-rewrite.ts'; diff --git a/packages/build/src/pack-edit.ts b/packages/patcher/src/pack-edit.ts similarity index 100% rename from packages/build/src/pack-edit.ts rename to packages/patcher/src/pack-edit.ts diff --git a/packages/patcher/src/store/offline-bundles.ts b/packages/patcher/src/store/offline-bundles.ts new file mode 100644 index 0000000..fa9e980 --- /dev/null +++ b/packages/patcher/src/store/offline-bundles.ts @@ -0,0 +1,25 @@ +/** + * Offline store bundle GUIDs for config/gui.blk `bundles/guid`. + * + * The game opens a gift vehicle's own store page only when `getBundleId()` finds a + * GUID for it (scripts/onlineShop/onlineShopModel.nut showUnitGoods → doBrowserPurchaseByGuid); + * the URL then comes from the local server's item_info.php `url` field. Every vehicle carrying + * `gift` in char.vromfs.bin config/wpcost.blk gets `stableGuid(wto_pack_)`, and every + * multi-vehicle pack the local server sells gets `stableGuid()`; the caller gives those + * ids, as the server reads them for the same data folder. Entries the store does not sell are + * never looked up, so registering extra ones is harmless. + */ +import { singleVehiclePackId, stableGuid, type BlkBlock } from '@wto/blk'; +import { readPackBlk } from '../pack-edit.ts'; + +export const WPCOST_PATH = 'config/wpcost.blk'; + +export function offlinePackBundleGuids(charPack: Uint8Array, multiVehiclePackIds: readonly string[]): Array { + const ids = new Set(multiVehiclePackIds); + for (const vehicle of giftVehicles(readPackBlk(charPack, WPCOST_PATH))) ids.add(singleVehiclePackId(vehicle)); + return [...ids].sort().map((id) => [id, stableGuid(id)] as const); +} + +function giftVehicles(wpcost: BlkBlock): string[] { + return wpcost.blocks.filter((unit) => unit.params.some((param) => param.name === 'gift')).map((unit) => unit.name); +} diff --git a/packages/build/src/tech-tree/reveal-hidden-vehicles.ts b/packages/patcher/src/tech-tree/reveal-hidden-vehicles.ts similarity index 100% rename from packages/build/src/tech-tree/reveal-hidden-vehicles.ts rename to packages/patcher/src/tech-tree/reveal-hidden-vehicles.ts diff --git a/exe-patches/battle/allow-local-host-bot-spawns/locate.jsonc b/patches/exe/battle/allow-local-host-bot-spawns/locate.jsonc similarity index 100% rename from exe-patches/battle/allow-local-host-bot-spawns/locate.jsonc rename to patches/exe/battle/allow-local-host-bot-spawns/locate.jsonc diff --git a/exe-patches/battle/allow-local-host-bot-spawns/patch.jsonc b/patches/exe/battle/allow-local-host-bot-spawns/patch.jsonc similarity index 100% rename from exe-patches/battle/allow-local-host-bot-spawns/patch.jsonc rename to patches/exe/battle/allow-local-host-bot-spawns/patch.jsonc diff --git a/exe-patches/battle/allow-local-host-player-respawn/locate.jsonc b/patches/exe/battle/allow-local-host-player-respawn/locate.jsonc similarity index 100% rename from exe-patches/battle/allow-local-host-player-respawn/locate.jsonc rename to patches/exe/battle/allow-local-host-player-respawn/locate.jsonc diff --git a/exe-patches/battle/allow-local-host-player-respawn/patch.jsonc b/patches/exe/battle/allow-local-host-player-respawn/patch.jsonc similarity index 100% rename from exe-patches/battle/allow-local-host-player-respawn/patch.jsonc rename to patches/exe/battle/allow-local-host-player-respawn/patch.jsonc diff --git a/exe-patches/battle/allow-local-host-ucav-launch/locate.jsonc b/patches/exe/battle/allow-local-host-ucav-launch/locate.jsonc similarity index 100% rename from exe-patches/battle/allow-local-host-ucav-launch/locate.jsonc rename to patches/exe/battle/allow-local-host-ucav-launch/locate.jsonc diff --git a/exe-patches/battle/allow-local-host-ucav-launch/patch.jsonc b/patches/exe/battle/allow-local-host-ucav-launch/patch.jsonc similarity index 100% rename from exe-patches/battle/allow-local-host-ucav-launch/patch.jsonc rename to patches/exe/battle/allow-local-host-ucav-launch/patch.jsonc diff --git a/exe-patches/battle/count-bots-as-active-players/locate.jsonc b/patches/exe/battle/count-bots-as-active-players/locate.jsonc similarity index 100% rename from exe-patches/battle/count-bots-as-active-players/locate.jsonc rename to patches/exe/battle/count-bots-as-active-players/locate.jsonc diff --git a/exe-patches/battle/count-bots-as-active-players/patch.jsonc b/patches/exe/battle/count-bots-as-active-players/patch.jsonc similarity index 100% rename from exe-patches/battle/count-bots-as-active-players/patch.jsonc rename to patches/exe/battle/count-bots-as-active-players/patch.jsonc diff --git a/exe-patches/isolation/never-load-battleye/locate.jsonc b/patches/exe/isolation/never-load-battleye/locate.jsonc similarity index 100% rename from exe-patches/isolation/never-load-battleye/locate.jsonc rename to patches/exe/isolation/never-load-battleye/locate.jsonc diff --git a/exe-patches/isolation/never-load-battleye/patch.jsonc b/patches/exe/isolation/never-load-battleye/patch.jsonc similarity index 100% rename from exe-patches/isolation/never-load-battleye/patch.jsonc rename to patches/exe/isolation/never-load-battleye/patch.jsonc diff --git a/exe-patches/isolation/never-upload-crash-reports/locate.jsonc b/patches/exe/isolation/never-upload-crash-reports/locate.jsonc similarity index 100% rename from exe-patches/isolation/never-upload-crash-reports/locate.jsonc rename to patches/exe/isolation/never-upload-crash-reports/locate.jsonc diff --git a/exe-patches/isolation/never-upload-crash-reports/patch.jsonc b/patches/exe/isolation/never-upload-crash-reports/patch.jsonc similarity index 100% rename from exe-patches/isolation/never-upload-crash-reports/patch.jsonc rename to patches/exe/isolation/never-upload-crash-reports/patch.jsonc diff --git a/exe-patches/isolation/registry-key/locate.jsonc b/patches/exe/isolation/registry-key/locate.jsonc similarity index 100% rename from exe-patches/isolation/registry-key/locate.jsonc rename to patches/exe/isolation/registry-key/locate.jsonc diff --git a/exe-patches/isolation/registry-key/patch.jsonc b/patches/exe/isolation/registry-key/patch.jsonc similarity index 100% rename from exe-patches/isolation/registry-key/patch.jsonc rename to patches/exe/isolation/registry-key/patch.jsonc diff --git a/exe-patches/isolation/user-data-folder-name/locate.jsonc b/patches/exe/isolation/user-data-folder-name/locate.jsonc similarity index 100% rename from exe-patches/isolation/user-data-folder-name/locate.jsonc rename to patches/exe/isolation/user-data-folder-name/locate.jsonc diff --git a/exe-patches/isolation/user-data-folder-name/patch.jsonc b/patches/exe/isolation/user-data-folder-name/patch.jsonc similarity index 100% rename from exe-patches/isolation/user-data-folder-name/patch.jsonc rename to patches/exe/isolation/user-data-folder-name/patch.jsonc diff --git a/exe-patches/online/accept-local-tls-certificate/locate.jsonc b/patches/exe/online/accept-local-tls-certificate/locate.jsonc similarity index 100% rename from exe-patches/online/accept-local-tls-certificate/locate.jsonc rename to patches/exe/online/accept-local-tls-certificate/locate.jsonc diff --git a/exe-patches/online/accept-local-tls-certificate/patch.jsonc b/patches/exe/online/accept-local-tls-certificate/patch.jsonc similarity index 100% rename from exe-patches/online/accept-local-tls-certificate/patch.jsonc rename to patches/exe/online/accept-local-tls-certificate/patch.jsonc diff --git a/exe-patches/online/matching-server-public-key/locate.jsonc b/patches/exe/online/matching-server-public-key/locate.jsonc similarity index 100% rename from exe-patches/online/matching-server-public-key/locate.jsonc rename to patches/exe/online/matching-server-public-key/locate.jsonc diff --git a/exe-patches/online/matching-server-public-key/patch.jsonc b/patches/exe/online/matching-server-public-key/patch.jsonc similarity index 97% rename from exe-patches/online/matching-server-public-key/patch.jsonc rename to patches/exe/online/matching-server-public-key/patch.jsonc index b7d919d..c63f381 100644 --- a/exe-patches/online/matching-server-public-key/patch.jsonc +++ b/patches/exe/online/matching-server-public-key/patch.jsonc @@ -1,4 +1,4 @@ -// Replace the matching server public key with the local service's key. +// Replace the matching server public key with the local server's key. // Why the executable: the session key is encrypted with this constant; only its private key can open it. // Without it: the client cannot connect to the local matching server and the hangar never finishes loading. { diff --git a/exe-patches/online/network-hook-library/locate.jsonc b/patches/exe/online/network-hook-library/locate.jsonc similarity index 100% rename from exe-patches/online/network-hook-library/locate.jsonc rename to patches/exe/online/network-hook-library/locate.jsonc diff --git a/exe-patches/online/network-hook-library/patch.jsonc b/patches/exe/online/network-hook-library/patch.jsonc similarity index 93% rename from exe-patches/online/network-hook-library/patch.jsonc rename to patches/exe/online/network-hook-library/patch.jsonc index 1641f9e..b886972 100644 --- a/exe-patches/online/network-hook-library/patch.jsonc +++ b/patches/exe/online/network-hook-library/patch.jsonc @@ -1,6 +1,6 @@ // Import wto_ws.dll instead of WS2_32.dll; it forwards every export and redirects lookups and connections. // Why the executable: many Gaijin addresses, ports and schemes are constants with no configuration entry. -// Without it: hard-coded https endpoints try the real internet and purchases/redeem codes never reach the local service. +// Without it: hard-coded https endpoints try the real internet and purchases/redeem codes never reach the local server. { "id": "online/network-hook-library", "title": "让游戏加载离线版的网络钩子库 wto_ws.dll(代替直接加载 WS2_32.dll),把所有联网都接到本地服务", diff --git a/exe-patches/startup/skip-resource-archive-signature-check/locate.jsonc b/patches/exe/startup/skip-resource-archive-signature-check/locate.jsonc similarity index 100% rename from exe-patches/startup/skip-resource-archive-signature-check/locate.jsonc rename to patches/exe/startup/skip-resource-archive-signature-check/locate.jsonc diff --git a/exe-patches/startup/skip-resource-archive-signature-check/patch.jsonc b/patches/exe/startup/skip-resource-archive-signature-check/patch.jsonc similarity index 100% rename from exe-patches/startup/skip-resource-archive-signature-check/patch.jsonc rename to patches/exe/startup/skip-resource-archive-signature-check/patch.jsonc diff --git a/gui-patches/battle/append-extra-battle-slots/find.nut b/patches/gui/battle/append-extra-battle-slots/find.nut similarity index 100% rename from gui-patches/battle/append-extra-battle-slots/find.nut rename to patches/gui/battle/append-extra-battle-slots/find.nut diff --git a/gui-patches/battle/append-extra-battle-slots/patch.jsonc b/patches/gui/battle/append-extra-battle-slots/patch.jsonc similarity index 86% rename from gui-patches/battle/append-extra-battle-slots/patch.jsonc rename to patches/gui/battle/append-extra-battle-slots/patch.jsonc index cba0b36..4be10a5 100644 --- a/gui-patches/battle/append-extra-battle-slots/patch.jsonc +++ b/patches/gui/battle/append-extra-battle-slots/patch.jsonc @@ -1,4 +1,4 @@ -// Add the extra vehicles the local service chose for a LocalMP battle (nuclear carrier, strike UCAV, +// Add the extra vehicles the local server chose for a LocalMP battle (nuclear carrier, strike UCAV, // the RandomSpawnUnits tank / SPAA / naval aircraft) to the in-battle crew list. // Why the client: online the battle server adds them to the player's crews; a LocalMP host has no // battle server, and the in-battle crew list comes from the native get_crew_info. diff --git a/gui-patches/battle/append-extra-battle-slots/replace.nut b/patches/gui/battle/append-extra-battle-slots/replace.nut similarity index 100% rename from gui-patches/battle/append-extra-battle-slots/replace.nut rename to patches/gui/battle/append-extra-battle-slots/replace.nut diff --git a/gui-patches/battle/force-extra-slot-weapons/find.nut b/patches/gui/battle/force-extra-slot-weapons/find.nut similarity index 100% rename from gui-patches/battle/force-extra-slot-weapons/find.nut rename to patches/gui/battle/force-extra-slot-weapons/find.nut diff --git a/gui-patches/battle/force-extra-slot-weapons/patch.jsonc b/patches/gui/battle/force-extra-slot-weapons/patch.jsonc similarity index 74% rename from gui-patches/battle/force-extra-slot-weapons/patch.jsonc rename to patches/gui/battle/force-extra-slot-weapons/patch.jsonc index 8b584da..1752250 100644 --- a/gui-patches/battle/force-extra-slot-weapons/patch.jsonc +++ b/patches/gui/battle/force-extra-slot-weapons/patch.jsonc @@ -1,7 +1,7 @@ -// Lock the weapon preset the local service set for an extra LocalMP vehicle (the nuclear carrier's +// Lock the weapon preset the local server set for an extra LocalMP vehicle (the nuclear carrier's // bomb, the RandomSpawnUnits forceWeapon of a naval extra aircraft). // Why the client: online the battle server sends the extra vehicles with their weapon; on a LocalMP -// host the local service chooses them, and getForcedUnitWeapon only knows mission and room data. +// host the local server chooses them, and getForcedUnitWeapon only knows mission and room data. // Without it: the extra vehicles spawn with whatever preset the respawn screen picks. { "id": "battle/force-extra-slot-weapons", diff --git a/gui-patches/battle/force-extra-slot-weapons/replace.nut b/patches/gui/battle/force-extra-slot-weapons/replace.nut similarity index 86% rename from gui-patches/battle/force-extra-slot-weapons/replace.nut rename to patches/gui/battle/force-extra-slot-weapons/replace.nut index f049389..b005c7c 100644 --- a/gui-patches/battle/force-extra-slot-weapons/replace.nut +++ b/patches/gui/battle/force-extra-slot-weapons/replace.nut @@ -1,5 +1,5 @@ function getForcedUnitWeapon(unit) { - // WTOffline: the extra vehicles the local service added to a LocalMP lineup carry their forced + // WTOffline: the extra vehicles the local server added to a LocalMP lineup carry their forced // weapon (nuclear carrier, RandomSpawnUnits forceWeapon); online the battle server sends it. foreach (wtoSlot in (require("nestdb").ndbTryRead(["wto", "activeBattle"])?.extraBattleSlots ?? [])) if (wtoSlot?.unitName == unit.name && (wtoSlot?.forceWeapon ?? "") != "") diff --git a/gui-patches/battle/launch-local-battle-from-queue/find.nut b/patches/gui/battle/launch-local-battle-from-queue/find.nut similarity index 100% rename from gui-patches/battle/launch-local-battle-from-queue/find.nut rename to patches/gui/battle/launch-local-battle-from-queue/find.nut diff --git a/gui-patches/battle/launch-local-battle-from-queue/patch.jsonc b/patches/gui/battle/launch-local-battle-from-queue/patch.jsonc similarity index 88% rename from gui-patches/battle/launch-local-battle-from-queue/patch.jsonc rename to patches/gui/battle/launch-local-battle-from-queue/patch.jsonc index b27e9dd..92ab267 100644 --- a/gui-patches/battle/launch-local-battle-from-queue/patch.jsonc +++ b/patches/gui/battle/launch-local-battle-from-queue/patch.jsonc @@ -1,4 +1,4 @@ -// Start a local battle pushed by the local service: rebuild the mission settings it sends and host +// Start a local battle pushed by the local server: rebuild the mission settings it sends and host // the battle as an in-process LocalMP session (select_training_mission + guiStartFlight). // Why the client: the stock queue only ever joins a remote room (connect_to_host_list, peer mode); // nothing in it enters LocalMP, so no answer from the service can start a hosted battle. diff --git a/gui-patches/battle/launch-local-battle-from-queue/replace.nut b/patches/gui/battle/launch-local-battle-from-queue/replace.nut similarity index 93% rename from gui-patches/battle/launch-local-battle-from-queue/replace.nut rename to patches/gui/battle/launch-local-battle-from-queue/replace.nut index 72df834..485f1ea 100644 --- a/gui-patches/battle/launch-local-battle-from-queue/replace.nut +++ b/patches/gui/battle/launch-local-battle-from-queue/replace.nut @@ -1,7 +1,7 @@ matchingApiFunc("match.enqueue", cb, params) } -// WTOffline: rebuild a DataBlock sent by the local service as { p = [[name, type, value]], b = [[name, node]] }. +// WTOffline: rebuild a DataBlock sent by the local server as { p = [[name, type, value]], b = [[name, node]] }. // The type ("t", "i", "r", "b") travels with each value because the engine reads ints and reals with typed getters. function wtoBlkFromWire(blk, node) { foreach (param in (node?.p ?? [])) { @@ -16,7 +16,7 @@ function wtoBlkFromWire(blk, node) { return blk } -// WTOffline: start a local battle pushed by the local service (mrpc.generic_notify, from = "wto_battle"). +// WTOffline: start a local battle pushed by the local server (mrpc.generic_notify, from = "wto_battle"). // The service sends the complete mission settings; the client hosts the battle as a LocalMP session. function onWtoBattleNotify(ev) { if (ev?.func != "launch" || isInFlight()) diff --git a/gui-patches/battle/lineup-br-for-submodes/find.nut b/patches/gui/battle/lineup-br-for-submodes/find.nut similarity index 100% rename from gui-patches/battle/lineup-br-for-submodes/find.nut rename to patches/gui/battle/lineup-br-for-submodes/find.nut diff --git a/gui-patches/battle/lineup-br-for-submodes/patch.jsonc b/patches/gui/battle/lineup-br-for-submodes/patch.jsonc similarity index 100% rename from gui-patches/battle/lineup-br-for-submodes/patch.jsonc rename to patches/gui/battle/lineup-br-for-submodes/patch.jsonc diff --git a/gui-patches/battle/lineup-br-for-submodes/replace.nut b/patches/gui/battle/lineup-br-for-submodes/replace.nut similarity index 81% rename from gui-patches/battle/lineup-br-for-submodes/replace.nut rename to patches/gui/battle/lineup-br-for-submodes/replace.nut index 5437715..3fd752c 100644 --- a/gui-patches/battle/lineup-br-for-submodes/replace.nut +++ b/patches/gui/battle/lineup-br-for-submodes/replace.nut @@ -1,6 +1,6 @@ function getCurRank(event) { // WTOffline: also out of a squad, use the battle rating the matching server computed for the - // lineup (wtmm_static.calc_ranks, answered by the local service with the lineup's highest + // lineup (wtmm_static.calc_ranks, answered by the local server with the lineup's highest // rank), as the live game decides the extra modes by the whole lineup. if (isInSquad() || getRecentSquadMrank() >= 0) return getRecentSquadMrank() diff --git a/gui-patches/battle/local-host-spawn-score/find.nut b/patches/gui/battle/local-host-spawn-score/find.nut similarity index 100% rename from gui-patches/battle/local-host-spawn-score/find.nut rename to patches/gui/battle/local-host-spawn-score/find.nut diff --git a/gui-patches/battle/local-host-spawn-score/patch.jsonc b/patches/gui/battle/local-host-spawn-score/patch.jsonc similarity index 100% rename from gui-patches/battle/local-host-spawn-score/patch.jsonc rename to patches/gui/battle/local-host-spawn-score/patch.jsonc diff --git a/gui-patches/battle/local-host-spawn-score/replace.nut b/patches/gui/battle/local-host-spawn-score/replace.nut similarity index 100% rename from gui-patches/battle/local-host-spawn-score/replace.nut rename to patches/gui/battle/local-host-spawn-score/replace.nut diff --git a/gui-patches/battle/match-settled-battle-room-logs/find-room-check.nut b/patches/gui/battle/match-settled-battle-room-logs/find-room-check.nut similarity index 100% rename from gui-patches/battle/match-settled-battle-room-logs/find-room-check.nut rename to patches/gui/battle/match-settled-battle-room-logs/find-room-check.nut diff --git a/gui-patches/battle/match-settled-battle-room-logs/find.nut b/patches/gui/battle/match-settled-battle-room-logs/find.nut similarity index 100% rename from gui-patches/battle/match-settled-battle-room-logs/find.nut rename to patches/gui/battle/match-settled-battle-room-logs/find.nut diff --git a/gui-patches/battle/match-settled-battle-room-logs/patch.jsonc b/patches/gui/battle/match-settled-battle-room-logs/patch.jsonc similarity index 100% rename from gui-patches/battle/match-settled-battle-room-logs/patch.jsonc rename to patches/gui/battle/match-settled-battle-room-logs/patch.jsonc diff --git a/gui-patches/battle/match-settled-battle-room-logs/replace-room-check.nut b/patches/gui/battle/match-settled-battle-room-logs/replace-room-check.nut similarity index 100% rename from gui-patches/battle/match-settled-battle-room-logs/replace-room-check.nut rename to patches/gui/battle/match-settled-battle-room-logs/replace-room-check.nut diff --git a/gui-patches/battle/match-settled-battle-room-logs/replace.nut b/patches/gui/battle/match-settled-battle-room-logs/replace.nut similarity index 100% rename from gui-patches/battle/match-settled-battle-room-logs/replace.nut rename to patches/gui/battle/match-settled-battle-room-logs/replace.nut diff --git a/gui-patches/battle/pass-spawn-modifications-blk/find.nut b/patches/gui/battle/pass-spawn-modifications-blk/find.nut similarity index 100% rename from gui-patches/battle/pass-spawn-modifications-blk/find.nut rename to patches/gui/battle/pass-spawn-modifications-blk/find.nut diff --git a/gui-patches/battle/pass-spawn-modifications-blk/patch.jsonc b/patches/gui/battle/pass-spawn-modifications-blk/patch.jsonc similarity index 100% rename from gui-patches/battle/pass-spawn-modifications-blk/patch.jsonc rename to patches/gui/battle/pass-spawn-modifications-blk/patch.jsonc diff --git a/gui-patches/battle/pass-spawn-modifications-blk/replace.nut b/patches/gui/battle/pass-spawn-modifications-blk/replace.nut similarity index 100% rename from gui-patches/battle/pass-spawn-modifications-blk/replace.nut rename to patches/gui/battle/pass-spawn-modifications-blk/replace.nut diff --git a/gui-patches/battle/quit-local-host-spectator-to-debriefing/find.nut b/patches/gui/battle/quit-local-host-spectator-to-debriefing/find.nut similarity index 100% rename from gui-patches/battle/quit-local-host-spectator-to-debriefing/find.nut rename to patches/gui/battle/quit-local-host-spectator-to-debriefing/find.nut diff --git a/gui-patches/battle/quit-local-host-spectator-to-debriefing/patch.jsonc b/patches/gui/battle/quit-local-host-spectator-to-debriefing/patch.jsonc similarity index 100% rename from gui-patches/battle/quit-local-host-spectator-to-debriefing/patch.jsonc rename to patches/gui/battle/quit-local-host-spectator-to-debriefing/patch.jsonc diff --git a/gui-patches/battle/quit-local-host-spectator-to-debriefing/replace.nut b/patches/gui/battle/quit-local-host-spectator-to-debriefing/replace.nut similarity index 100% rename from gui-patches/battle/quit-local-host-spectator-to-debriefing/replace.nut rename to patches/gui/battle/quit-local-host-spectator-to-debriefing/replace.nut diff --git a/gui-patches/battle/quit-local-host-to-debriefing/find.nut b/patches/gui/battle/quit-local-host-to-debriefing/find.nut similarity index 100% rename from gui-patches/battle/quit-local-host-to-debriefing/find.nut rename to patches/gui/battle/quit-local-host-to-debriefing/find.nut diff --git a/gui-patches/battle/quit-local-host-to-debriefing/patch.jsonc b/patches/gui/battle/quit-local-host-to-debriefing/patch.jsonc similarity index 100% rename from gui-patches/battle/quit-local-host-to-debriefing/patch.jsonc rename to patches/gui/battle/quit-local-host-to-debriefing/patch.jsonc diff --git a/gui-patches/battle/quit-local-host-to-debriefing/replace.nut b/patches/gui/battle/quit-local-host-to-debriefing/replace.nut similarity index 100% rename from gui-patches/battle/quit-local-host-to-debriefing/replace.nut rename to patches/gui/battle/quit-local-host-to-debriefing/replace.nut diff --git a/gui-patches/battle/ready-local-host-respawn/find.nut b/patches/gui/battle/ready-local-host-respawn/find.nut similarity index 100% rename from gui-patches/battle/ready-local-host-respawn/find.nut rename to patches/gui/battle/ready-local-host-respawn/find.nut diff --git a/gui-patches/battle/ready-local-host-respawn/patch.jsonc b/patches/gui/battle/ready-local-host-respawn/patch.jsonc similarity index 100% rename from gui-patches/battle/ready-local-host-respawn/patch.jsonc rename to patches/gui/battle/ready-local-host-respawn/patch.jsonc diff --git a/gui-patches/battle/ready-local-host-respawn/replace.nut b/patches/gui/battle/ready-local-host-respawn/replace.nut similarity index 100% rename from gui-patches/battle/ready-local-host-respawn/replace.nut rename to patches/gui/battle/ready-local-host-respawn/replace.nut diff --git a/gui-patches/battle/record-local-battle-awards/find.nut b/patches/gui/battle/record-local-battle-awards/find.nut similarity index 100% rename from gui-patches/battle/record-local-battle-awards/find.nut rename to patches/gui/battle/record-local-battle-awards/find.nut diff --git a/gui-patches/battle/record-local-battle-awards/patch.jsonc b/patches/gui/battle/record-local-battle-awards/patch.jsonc similarity index 96% rename from gui-patches/battle/record-local-battle-awards/patch.jsonc rename to patches/gui/battle/record-local-battle-awards/patch.jsonc index e12001f..0ef6ad7 100644 --- a/gui-patches/battle/record-local-battle-awards/patch.jsonc +++ b/patches/gui/battle/record-local-battle-awards/patch.jsonc @@ -1,5 +1,5 @@ // Record the local player's lives, combat events, the battle's kill log and how the battle ended -// in a LocalMP battle, show the reward banner, and pass each fact to the local service live to +// in a LocalMP battle, show the reward banner, and pass each fact to the local server live to // show the battle awards (streaks) it completes. // Why the client: online the battle server prices each event, judges the awards and sends both // banners (packet 0xb03d, streak messages); a LocalMP host has no battle server, so the native diff --git a/gui-patches/battle/record-local-battle-awards/replace.nut b/patches/gui/battle/record-local-battle-awards/replace.nut similarity index 97% rename from gui-patches/battle/record-local-battle-awards/replace.nut rename to patches/gui/battle/record-local-battle-awards/replace.nut index dec89ff..884a29e 100644 --- a/gui-patches/battle/record-local-battle-awards/replace.nut +++ b/patches/gui/battle/record-local-battle-awards/replace.nut @@ -1,9 +1,9 @@ // WTOffline: record the local player's lives and combat events in a LocalMP battle and show the // reward banner. A LocalMP host has no battle server to price events: the native bridge raises the // HUD event "wtoLocalMpExpEvent" with the facts, the banner amount comes from the parameters the -// local service sent at launch (nestdb wto.activeBattle.awards, battle-economy.ts BannerParams), and -// the record (nestdb wto.battleLog) is settled by the local service after the battle. -// Each fact is also sent to the local service as it happens (matching request wto_battle.fact); +// local server sent at launch (nestdb wto.activeBattle.awards, battle-economy.ts BannerParams), and +// the record (nestdb wto.battleLog) is settled by the local server after the battle. +// Each fact is also sent to the local server as it happens (matching request wto_battle.fact); // the battle awards (streaks) it completed come back and are shown with the stock award banner, // as the battle server's award messages are online. function wtoShowLiveStreaks(resp) { diff --git a/gui-patches/battle/report-local-battle-settlement/find-summary-layout.nut b/patches/gui/battle/report-local-battle-settlement/find-summary-layout.nut similarity index 100% rename from gui-patches/battle/report-local-battle-settlement/find-summary-layout.nut rename to patches/gui/battle/report-local-battle-settlement/find-summary-layout.nut diff --git a/gui-patches/battle/report-local-battle-settlement/find.nut b/patches/gui/battle/report-local-battle-settlement/find.nut similarity index 100% rename from gui-patches/battle/report-local-battle-settlement/find.nut rename to patches/gui/battle/report-local-battle-settlement/find.nut diff --git a/gui-patches/battle/report-local-battle-settlement/patch.jsonc b/patches/gui/battle/report-local-battle-settlement/patch.jsonc similarity index 79% rename from gui-patches/battle/report-local-battle-settlement/patch.jsonc rename to patches/gui/battle/report-local-battle-settlement/patch.jsonc index 3eba1c4..7dab722 100644 --- a/gui-patches/battle/report-local-battle-settlement/patch.jsonc +++ b/patches/gui/battle/report-local-battle-settlement/patch.jsonc @@ -1,11 +1,11 @@ -// Report a finished LocalMP battle to the local service (cln_wto_finish_battle) and open the +// Report a finished LocalMP battle to the local server (cln_wto_finish_battle) and open the // debriefing with the statistics it settled. // Why the client: online the battle server reports the battle to the char server by itself; on a // LocalMP host only the client knows the battle has ended, and there is no stock char action for it. // Without it: battles pay nothing and the debriefing stays empty. { "id": "battle/report-local-battle-settlement", - "title": "Report LocalMP battle facts to local-service and show the settled debriefing", + "title": "Report LocalMP battle facts to local server and show the settled debriefing", "file": "scripts/debriefing/debriefingmodal.nut", "features": [ "L-结算页", diff --git a/gui-patches/battle/report-local-battle-settlement/replace-summary-layout.nut b/patches/gui/battle/report-local-battle-settlement/replace-summary-layout.nut similarity index 100% rename from gui-patches/battle/report-local-battle-settlement/replace-summary-layout.nut rename to patches/gui/battle/report-local-battle-settlement/replace-summary-layout.nut diff --git a/gui-patches/battle/report-local-battle-settlement/replace.nut b/patches/gui/battle/report-local-battle-settlement/replace.nut similarity index 99% rename from gui-patches/battle/report-local-battle-settlement/replace.nut rename to patches/gui/battle/report-local-battle-settlement/replace.nut index 624ad7a..444f072 100644 --- a/gui-patches/battle/report-local-battle-settlement/replace.nut +++ b/patches/gui/battle/report-local-battle-settlement/replace.nut @@ -1,4 +1,4 @@ -// WTOffline: report a finished LocalMP battle to the local service as facts (lives and combat events +// WTOffline: report a finished LocalMP battle to the local server as facts (lives and combat events // recorded by record-local-battle-awards, the outcome and the team scores), then build the debriefing // from the statistics the service settled (see use-settled-debriefing-stats). The client computes // no rewards itself. diff --git a/gui-patches/battle/scoreboard-team-country-flags/find.nut b/patches/gui/battle/scoreboard-team-country-flags/find.nut similarity index 100% rename from gui-patches/battle/scoreboard-team-country-flags/find.nut rename to patches/gui/battle/scoreboard-team-country-flags/find.nut diff --git a/gui-patches/battle/scoreboard-team-country-flags/patch.jsonc b/patches/gui/battle/scoreboard-team-country-flags/patch.jsonc similarity index 100% rename from gui-patches/battle/scoreboard-team-country-flags/patch.jsonc rename to patches/gui/battle/scoreboard-team-country-flags/patch.jsonc diff --git a/gui-patches/battle/scoreboard-team-country-flags/replace.nut b/patches/gui/battle/scoreboard-team-country-flags/replace.nut similarity index 100% rename from gui-patches/battle/scoreboard-team-country-flags/replace.nut rename to patches/gui/battle/scoreboard-team-country-flags/replace.nut diff --git a/gui-patches/battle/stabilize-respawn-countdown-button/find.nut b/patches/gui/battle/stabilize-respawn-countdown-button/find.nut similarity index 100% rename from gui-patches/battle/stabilize-respawn-countdown-button/find.nut rename to patches/gui/battle/stabilize-respawn-countdown-button/find.nut diff --git a/gui-patches/battle/stabilize-respawn-countdown-button/patch.jsonc b/patches/gui/battle/stabilize-respawn-countdown-button/patch.jsonc similarity index 100% rename from gui-patches/battle/stabilize-respawn-countdown-button/patch.jsonc rename to patches/gui/battle/stabilize-respawn-countdown-button/patch.jsonc diff --git a/gui-patches/battle/stabilize-respawn-countdown-button/replace.nut b/patches/gui/battle/stabilize-respawn-countdown-button/replace.nut similarity index 100% rename from gui-patches/battle/stabilize-respawn-countdown-button/replace.nut rename to patches/gui/battle/stabilize-respawn-countdown-button/replace.nut diff --git a/gui-patches/battle/use-settled-debriefing-stats/find-after-exp.nut b/patches/gui/battle/use-settled-debriefing-stats/find-after-exp.nut similarity index 100% rename from gui-patches/battle/use-settled-debriefing-stats/find-after-exp.nut rename to patches/gui/battle/use-settled-debriefing-stats/find-after-exp.nut diff --git a/gui-patches/battle/use-settled-debriefing-stats/find-gather.nut b/patches/gui/battle/use-settled-debriefing-stats/find-gather.nut similarity index 100% rename from gui-patches/battle/use-settled-debriefing-stats/find-gather.nut rename to patches/gui/battle/use-settled-debriefing-stats/find-gather.nut diff --git a/gui-patches/battle/use-settled-debriefing-stats/find.nut b/patches/gui/battle/use-settled-debriefing-stats/find.nut similarity index 100% rename from gui-patches/battle/use-settled-debriefing-stats/find.nut rename to patches/gui/battle/use-settled-debriefing-stats/find.nut diff --git a/gui-patches/battle/use-settled-debriefing-stats/patch.jsonc b/patches/gui/battle/use-settled-debriefing-stats/patch.jsonc similarity index 88% rename from gui-patches/battle/use-settled-debriefing-stats/patch.jsonc rename to patches/gui/battle/use-settled-debriefing-stats/patch.jsonc index 5ea47f5..ae26cf0 100644 --- a/gui-patches/battle/use-settled-debriefing-stats/patch.jsonc +++ b/patches/gui/battle/use-settled-debriefing-stats/patch.jsonc @@ -1,11 +1,11 @@ -// Build the debriefing of a settled LocalMP battle from the statistics table the local service +// Build the debriefing of a settled LocalMP battle from the statistics table the local server // settled, using the multiplayer state captured while leaving the battle. // Why the client: the debriefing reads stat_get_exp() (aces.exe 0x1053b70, the battle's // SessionStatsNet), which online the battle server fills; a LocalMP host has no battle server. // Without it: the debriefing shows no rewards or activity. { "id": "battle/use-settled-debriefing-stats", - "title": "Use the local service's settled battle in the LocalMP debriefing", + "title": "Use the local server's settled battle in the LocalMP debriefing", "file": "scripts/debriefing/debriefingfull.nut", "features": [ "L-结算页" diff --git a/gui-patches/battle/use-settled-debriefing-stats/replace-after-exp.nut b/patches/gui/battle/use-settled-debriefing-stats/replace-after-exp.nut similarity index 100% rename from gui-patches/battle/use-settled-debriefing-stats/replace-after-exp.nut rename to patches/gui/battle/use-settled-debriefing-stats/replace-after-exp.nut diff --git a/gui-patches/battle/use-settled-debriefing-stats/replace-gather.nut b/patches/gui/battle/use-settled-debriefing-stats/replace-gather.nut similarity index 100% rename from gui-patches/battle/use-settled-debriefing-stats/replace-gather.nut rename to patches/gui/battle/use-settled-debriefing-stats/replace-gather.nut diff --git a/gui-patches/battle/use-settled-debriefing-stats/replace.nut b/patches/gui/battle/use-settled-debriefing-stats/replace.nut similarity index 100% rename from gui-patches/battle/use-settled-debriefing-stats/replace.nut rename to patches/gui/battle/use-settled-debriefing-stats/replace.nut diff --git a/gui-patches/inventory/local-content-public-key/find.nut b/patches/gui/inventory/local-content-public-key/find.nut similarity index 100% rename from gui-patches/inventory/local-content-public-key/find.nut rename to patches/gui/inventory/local-content-public-key/find.nut diff --git a/gui-patches/inventory/local-content-public-key/patch.jsonc b/patches/gui/inventory/local-content-public-key/patch.jsonc similarity index 93% rename from gui-patches/inventory/local-content-public-key/patch.jsonc rename to patches/gui/inventory/local-content-public-key/patch.jsonc index 3c11868..cdb4321 100644 --- a/gui-patches/inventory/local-content-public-key/patch.jsonc +++ b/patches/gui/inventory/local-content-public-key/patch.jsonc @@ -1,4 +1,4 @@ -// Replace the inventory content-signing public key with the local service's key; native verification stays on. +// Replace the inventory content-signing public key with the local server's key; native verification stays on. // Why the client: the key is hard-coded in the script and the service cannot sign with Gaijin's private key. // Without it: GetItemDefsClient fails CONTENT_SIGN_VALIDATION_FAILED and every external item definition is dropped. { diff --git a/gui-patches/inventory/local-content-public-key/replace.nut b/patches/gui/inventory/local-content-public-key/replace.nut similarity index 100% rename from gui-patches/inventory/local-content-public-key/replace.nut rename to patches/gui/inventory/local-content-public-key/replace.nut diff --git a/gui-patches/inventory/show-coupon-redemption-reward/find.nut b/patches/gui/inventory/show-coupon-redemption-reward/find.nut similarity index 100% rename from gui-patches/inventory/show-coupon-redemption-reward/find.nut rename to patches/gui/inventory/show-coupon-redemption-reward/find.nut diff --git a/gui-patches/inventory/show-coupon-redemption-reward/patch.jsonc b/patches/gui/inventory/show-coupon-redemption-reward/patch.jsonc similarity index 100% rename from gui-patches/inventory/show-coupon-redemption-reward/patch.jsonc rename to patches/gui/inventory/show-coupon-redemption-reward/patch.jsonc diff --git a/gui-patches/inventory/show-coupon-redemption-reward/replace.nut b/patches/gui/inventory/show-coupon-redemption-reward/replace.nut similarity index 100% rename from gui-patches/inventory/show-coupon-redemption-reward/replace.nut rename to patches/gui/inventory/show-coupon-redemption-reward/replace.nut diff --git a/gui-patches/online-shop/bypass-external-sso-for-local-urls/find.nut b/patches/gui/online-shop/bypass-external-sso-for-local-urls/find.nut similarity index 100% rename from gui-patches/online-shop/bypass-external-sso-for-local-urls/find.nut rename to patches/gui/online-shop/bypass-external-sso-for-local-urls/find.nut diff --git a/gui-patches/online-shop/bypass-external-sso-for-local-urls/patch.jsonc b/patches/gui/online-shop/bypass-external-sso-for-local-urls/patch.jsonc similarity index 97% rename from gui-patches/online-shop/bypass-external-sso-for-local-urls/patch.jsonc rename to patches/gui/online-shop/bypass-external-sso-for-local-urls/patch.jsonc index 91cf76e..1c6d947 100644 --- a/gui-patches/online-shop/bypass-external-sso-for-local-urls/patch.jsonc +++ b/patches/gui/online-shop/bypass-external-sso-for-local-urls/patch.jsonc @@ -1,4 +1,4 @@ -// Skip the yuplay2 single sign-on wrapper for URLs that point at the local service. +// Skip the yuplay2 single sign-on wrapper for URLs that point at the local server. // Why the client: SsoLoggedUrlAction always wraps the URL in https://login.gaijin.net and the embedded browser does not load wto_ws.dll. // Without it: opening the local store or marketplace sends the browser to the real Gaijin login server. { diff --git a/gui-patches/online-shop/bypass-external-sso-for-local-urls/replace.nut b/patches/gui/online-shop/bypass-external-sso-for-local-urls/replace.nut similarity index 100% rename from gui-patches/online-shop/bypass-external-sso-for-local-urls/replace.nut rename to patches/gui/online-shop/bypass-external-sso-for-local-urls/replace.nut diff --git a/gui-patches/online-shop/collect-entitlement-purchase-rewards/find.nut b/patches/gui/online-shop/collect-entitlement-purchase-rewards/find.nut similarity index 100% rename from gui-patches/online-shop/collect-entitlement-purchase-rewards/find.nut rename to patches/gui/online-shop/collect-entitlement-purchase-rewards/find.nut diff --git a/gui-patches/online-shop/collect-entitlement-purchase-rewards/patch.jsonc b/patches/gui/online-shop/collect-entitlement-purchase-rewards/patch.jsonc similarity index 100% rename from gui-patches/online-shop/collect-entitlement-purchase-rewards/patch.jsonc rename to patches/gui/online-shop/collect-entitlement-purchase-rewards/patch.jsonc diff --git a/gui-patches/online-shop/collect-entitlement-purchase-rewards/replace.nut b/patches/gui/online-shop/collect-entitlement-purchase-rewards/replace.nut similarity index 100% rename from gui-patches/online-shop/collect-entitlement-purchase-rewards/replace.nut rename to patches/gui/online-shop/collect-entitlement-purchase-rewards/replace.nut diff --git a/gui-patches/online-shop/defer-explicit-browser-update-to-close/find.nut b/patches/gui/online-shop/defer-explicit-browser-update-to-close/find.nut similarity index 100% rename from gui-patches/online-shop/defer-explicit-browser-update-to-close/find.nut rename to patches/gui/online-shop/defer-explicit-browser-update-to-close/find.nut diff --git a/gui-patches/online-shop/defer-explicit-browser-update-to-close/patch.jsonc b/patches/gui/online-shop/defer-explicit-browser-update-to-close/patch.jsonc similarity index 100% rename from gui-patches/online-shop/defer-explicit-browser-update-to-close/patch.jsonc rename to patches/gui/online-shop/defer-explicit-browser-update-to-close/patch.jsonc diff --git a/gui-patches/online-shop/defer-explicit-browser-update-to-close/replace.nut b/patches/gui/online-shop/defer-explicit-browser-update-to-close/replace.nut similarity index 100% rename from gui-patches/online-shop/defer-explicit-browser-update-to-close/replace.nut rename to patches/gui/online-shop/defer-explicit-browser-update-to-close/replace.nut diff --git a/gui-patches/online-shop/free-offline-payment-method/find.nut b/patches/gui/online-shop/free-offline-payment-method/find.nut similarity index 100% rename from gui-patches/online-shop/free-offline-payment-method/find.nut rename to patches/gui/online-shop/free-offline-payment-method/find.nut diff --git a/gui-patches/online-shop/free-offline-payment-method/patch.jsonc b/patches/gui/online-shop/free-offline-payment-method/patch.jsonc similarity index 100% rename from gui-patches/online-shop/free-offline-payment-method/patch.jsonc rename to patches/gui/online-shop/free-offline-payment-method/patch.jsonc diff --git a/gui-patches/online-shop/free-offline-payment-method/replace.nut b/patches/gui/online-shop/free-offline-payment-method/replace.nut similarity index 100% rename from gui-patches/online-shop/free-offline-payment-method/replace.nut rename to patches/gui/online-shop/free-offline-payment-method/replace.nut diff --git a/gui-patches/online-shop/localize-vehicle-pack-titles/find.nut b/patches/gui/online-shop/localize-vehicle-pack-titles/find.nut similarity index 100% rename from gui-patches/online-shop/localize-vehicle-pack-titles/find.nut rename to patches/gui/online-shop/localize-vehicle-pack-titles/find.nut diff --git a/gui-patches/online-shop/localize-vehicle-pack-titles/patch.jsonc b/patches/gui/online-shop/localize-vehicle-pack-titles/patch.jsonc similarity index 100% rename from gui-patches/online-shop/localize-vehicle-pack-titles/patch.jsonc rename to patches/gui/online-shop/localize-vehicle-pack-titles/patch.jsonc diff --git a/gui-patches/online-shop/localize-vehicle-pack-titles/replace.nut b/patches/gui/online-shop/localize-vehicle-pack-titles/replace.nut similarity index 100% rename from gui-patches/online-shop/localize-vehicle-pack-titles/replace.nut rename to patches/gui/online-shop/localize-vehicle-pack-titles/replace.nut diff --git a/gui-patches/online-shop/open-entitlement-purchase-receipts/find.nut b/patches/gui/online-shop/open-entitlement-purchase-receipts/find.nut similarity index 100% rename from gui-patches/online-shop/open-entitlement-purchase-receipts/find.nut rename to patches/gui/online-shop/open-entitlement-purchase-receipts/find.nut diff --git a/gui-patches/online-shop/open-entitlement-purchase-receipts/patch.jsonc b/patches/gui/online-shop/open-entitlement-purchase-receipts/patch.jsonc similarity index 100% rename from gui-patches/online-shop/open-entitlement-purchase-receipts/patch.jsonc rename to patches/gui/online-shop/open-entitlement-purchase-receipts/patch.jsonc diff --git a/gui-patches/online-shop/open-entitlement-purchase-receipts/replace.nut b/patches/gui/online-shop/open-entitlement-purchase-receipts/replace.nut similarity index 100% rename from gui-patches/online-shop/open-entitlement-purchase-receipts/replace.nut rename to patches/gui/online-shop/open-entitlement-purchase-receipts/replace.nut diff --git a/gui-patches/online-shop/present-saved-entitlement-grants/find.nut b/patches/gui/online-shop/present-saved-entitlement-grants/find.nut similarity index 100% rename from gui-patches/online-shop/present-saved-entitlement-grants/find.nut rename to patches/gui/online-shop/present-saved-entitlement-grants/find.nut diff --git a/gui-patches/online-shop/present-saved-entitlement-grants/patch.jsonc b/patches/gui/online-shop/present-saved-entitlement-grants/patch.jsonc similarity index 100% rename from gui-patches/online-shop/present-saved-entitlement-grants/patch.jsonc rename to patches/gui/online-shop/present-saved-entitlement-grants/patch.jsonc diff --git a/gui-patches/online-shop/present-saved-entitlement-grants/replace.nut b/patches/gui/online-shop/present-saved-entitlement-grants/replace.nut similarity index 100% rename from gui-patches/online-shop/present-saved-entitlement-grants/replace.nut rename to patches/gui/online-shop/present-saved-entitlement-grants/replace.nut diff --git a/gui-patches/online-shop/refresh-profile-after-browser-close/find.nut b/patches/gui/online-shop/refresh-profile-after-browser-close/find.nut similarity index 100% rename from gui-patches/online-shop/refresh-profile-after-browser-close/find.nut rename to patches/gui/online-shop/refresh-profile-after-browser-close/find.nut diff --git a/gui-patches/online-shop/refresh-profile-after-browser-close/patch.jsonc b/patches/gui/online-shop/refresh-profile-after-browser-close/patch.jsonc similarity index 100% rename from gui-patches/online-shop/refresh-profile-after-browser-close/patch.jsonc rename to patches/gui/online-shop/refresh-profile-after-browser-close/patch.jsonc diff --git a/gui-patches/online-shop/refresh-profile-after-browser-close/replace.nut b/patches/gui/online-shop/refresh-profile-after-browser-close/replace.nut similarity index 100% rename from gui-patches/online-shop/refresh-profile-after-browser-close/replace.nut rename to patches/gui/online-shop/refresh-profile-after-browser-close/replace.nut diff --git a/gui-patches/online-shop/refresh-profile-after-currency-shop-close/find.nut b/patches/gui/online-shop/refresh-profile-after-currency-shop-close/find.nut similarity index 100% rename from gui-patches/online-shop/refresh-profile-after-currency-shop-close/find.nut rename to patches/gui/online-shop/refresh-profile-after-currency-shop-close/find.nut diff --git a/gui-patches/online-shop/refresh-profile-after-currency-shop-close/patch.jsonc b/patches/gui/online-shop/refresh-profile-after-currency-shop-close/patch.jsonc similarity index 100% rename from gui-patches/online-shop/refresh-profile-after-currency-shop-close/patch.jsonc rename to patches/gui/online-shop/refresh-profile-after-currency-shop-close/patch.jsonc diff --git a/gui-patches/online-shop/refresh-profile-after-currency-shop-close/replace.nut b/patches/gui/online-shop/refresh-profile-after-currency-shop-close/replace.nut similarity index 100% rename from gui-patches/online-shop/refresh-profile-after-currency-shop-close/replace.nut rename to patches/gui/online-shop/refresh-profile-after-currency-shop-close/replace.nut diff --git a/gui-patches/online-shop/refresh-profile-after-premium-shop-close/find.nut b/patches/gui/online-shop/refresh-profile-after-premium-shop-close/find.nut similarity index 100% rename from gui-patches/online-shop/refresh-profile-after-premium-shop-close/find.nut rename to patches/gui/online-shop/refresh-profile-after-premium-shop-close/find.nut diff --git a/gui-patches/online-shop/refresh-profile-after-premium-shop-close/patch.jsonc b/patches/gui/online-shop/refresh-profile-after-premium-shop-close/patch.jsonc similarity index 100% rename from gui-patches/online-shop/refresh-profile-after-premium-shop-close/patch.jsonc rename to patches/gui/online-shop/refresh-profile-after-premium-shop-close/patch.jsonc diff --git a/gui-patches/online-shop/refresh-profile-after-premium-shop-close/replace.nut b/patches/gui/online-shop/refresh-profile-after-premium-shop-close/replace.nut similarity index 100% rename from gui-patches/online-shop/refresh-profile-after-premium-shop-close/replace.nut rename to patches/gui/online-shop/refresh-profile-after-premium-shop-close/replace.nut diff --git a/gui-patches/online-shop/render-retired-entitlement-log/find.nut b/patches/gui/online-shop/render-retired-entitlement-log/find.nut similarity index 100% rename from gui-patches/online-shop/render-retired-entitlement-log/find.nut rename to patches/gui/online-shop/render-retired-entitlement-log/find.nut diff --git a/gui-patches/online-shop/render-retired-entitlement-log/patch.jsonc b/patches/gui/online-shop/render-retired-entitlement-log/patch.jsonc similarity index 100% rename from gui-patches/online-shop/render-retired-entitlement-log/patch.jsonc rename to patches/gui/online-shop/render-retired-entitlement-log/patch.jsonc diff --git a/gui-patches/online-shop/render-retired-entitlement-log/replace.nut b/patches/gui/online-shop/render-retired-entitlement-log/replace.nut similarity index 100% rename from gui-patches/online-shop/render-retired-entitlement-log/replace.nut rename to patches/gui/online-shop/render-retired-entitlement-log/replace.nut diff --git a/gui-patches/online-shop/resume-purchase-receipts-after-price-update/find.nut b/patches/gui/online-shop/resume-purchase-receipts-after-price-update/find.nut similarity index 100% rename from gui-patches/online-shop/resume-purchase-receipts-after-price-update/find.nut rename to patches/gui/online-shop/resume-purchase-receipts-after-price-update/find.nut diff --git a/gui-patches/online-shop/resume-purchase-receipts-after-price-update/patch.jsonc b/patches/gui/online-shop/resume-purchase-receipts-after-price-update/patch.jsonc similarity index 100% rename from gui-patches/online-shop/resume-purchase-receipts-after-price-update/patch.jsonc rename to patches/gui/online-shop/resume-purchase-receipts-after-price-update/patch.jsonc diff --git a/gui-patches/online-shop/resume-purchase-receipts-after-price-update/replace.nut b/patches/gui/online-shop/resume-purchase-receipts-after-price-update/replace.nut similarity index 100% rename from gui-patches/online-shop/resume-purchase-receipts-after-price-update/replace.nut rename to patches/gui/online-shop/resume-purchase-receipts-after-price-update/replace.nut diff --git a/gui-patches/online-shop/return-entitlement-reward-handler/find.nut b/patches/gui/online-shop/return-entitlement-reward-handler/find.nut similarity index 100% rename from gui-patches/online-shop/return-entitlement-reward-handler/find.nut rename to patches/gui/online-shop/return-entitlement-reward-handler/find.nut diff --git a/gui-patches/online-shop/return-entitlement-reward-handler/patch.jsonc b/patches/gui/online-shop/return-entitlement-reward-handler/patch.jsonc similarity index 100% rename from gui-patches/online-shop/return-entitlement-reward-handler/patch.jsonc rename to patches/gui/online-shop/return-entitlement-reward-handler/patch.jsonc diff --git a/gui-patches/online-shop/return-entitlement-reward-handler/replace.nut b/patches/gui/online-shop/return-entitlement-reward-handler/replace.nut similarity index 100% rename from gui-patches/online-shop/return-entitlement-reward-handler/replace.nut rename to patches/gui/online-shop/return-entitlement-reward-handler/replace.nut diff --git a/gui-patches/online-shop/show-direct-entitlement-gift-icons/find.nut b/patches/gui/online-shop/show-direct-entitlement-gift-icons/find.nut similarity index 100% rename from gui-patches/online-shop/show-direct-entitlement-gift-icons/find.nut rename to patches/gui/online-shop/show-direct-entitlement-gift-icons/find.nut diff --git a/gui-patches/online-shop/show-direct-entitlement-gift-icons/patch.jsonc b/patches/gui/online-shop/show-direct-entitlement-gift-icons/patch.jsonc similarity index 100% rename from gui-patches/online-shop/show-direct-entitlement-gift-icons/patch.jsonc rename to patches/gui/online-shop/show-direct-entitlement-gift-icons/patch.jsonc diff --git a/gui-patches/online-shop/show-direct-entitlement-gift-icons/replace.nut b/patches/gui/online-shop/show-direct-entitlement-gift-icons/replace.nut similarity index 100% rename from gui-patches/online-shop/show-direct-entitlement-gift-icons/replace.nut rename to patches/gui/online-shop/show-direct-entitlement-gift-icons/replace.nut diff --git a/gui-patches/online-shop/show-direct-entitlement-gifts/find.nut b/patches/gui/online-shop/show-direct-entitlement-gifts/find.nut similarity index 100% rename from gui-patches/online-shop/show-direct-entitlement-gifts/find.nut rename to patches/gui/online-shop/show-direct-entitlement-gifts/find.nut diff --git a/gui-patches/online-shop/show-direct-entitlement-gifts/patch.jsonc b/patches/gui/online-shop/show-direct-entitlement-gifts/patch.jsonc similarity index 100% rename from gui-patches/online-shop/show-direct-entitlement-gifts/patch.jsonc rename to patches/gui/online-shop/show-direct-entitlement-gifts/patch.jsonc diff --git a/gui-patches/online-shop/show-direct-entitlement-gifts/replace.nut b/patches/gui/online-shop/show-direct-entitlement-gifts/replace.nut similarity index 100% rename from gui-patches/online-shop/show-direct-entitlement-gifts/replace.nut rename to patches/gui/online-shop/show-direct-entitlement-gifts/replace.nut diff --git a/gui-patches/online-shop/show-entitlement-purchase-rewards/find.nut b/patches/gui/online-shop/show-entitlement-purchase-rewards/find.nut similarity index 100% rename from gui-patches/online-shop/show-entitlement-purchase-rewards/find.nut rename to patches/gui/online-shop/show-entitlement-purchase-rewards/find.nut diff --git a/gui-patches/online-shop/show-entitlement-purchase-rewards/patch.jsonc b/patches/gui/online-shop/show-entitlement-purchase-rewards/patch.jsonc similarity index 100% rename from gui-patches/online-shop/show-entitlement-purchase-rewards/patch.jsonc rename to patches/gui/online-shop/show-entitlement-purchase-rewards/patch.jsonc diff --git a/gui-patches/online-shop/show-entitlement-purchase-rewards/replace.nut b/patches/gui/online-shop/show-entitlement-purchase-rewards/replace.nut similarity index 100% rename from gui-patches/online-shop/show-entitlement-purchase-rewards/replace.nut rename to patches/gui/online-shop/show-entitlement-purchase-rewards/replace.nut diff --git a/gui-patches/online-shop/use-entitlement-receipt-for-native-payment/find.nut b/patches/gui/online-shop/use-entitlement-receipt-for-native-payment/find.nut similarity index 100% rename from gui-patches/online-shop/use-entitlement-receipt-for-native-payment/find.nut rename to patches/gui/online-shop/use-entitlement-receipt-for-native-payment/find.nut diff --git a/gui-patches/online-shop/use-entitlement-receipt-for-native-payment/patch.jsonc b/patches/gui/online-shop/use-entitlement-receipt-for-native-payment/patch.jsonc similarity index 100% rename from gui-patches/online-shop/use-entitlement-receipt-for-native-payment/patch.jsonc rename to patches/gui/online-shop/use-entitlement-receipt-for-native-payment/patch.jsonc diff --git a/gui-patches/online-shop/use-entitlement-receipt-for-native-payment/replace.nut b/patches/gui/online-shop/use-entitlement-receipt-for-native-payment/replace.nut similarity index 100% rename from gui-patches/online-shop/use-entitlement-receipt-for-native-payment/replace.nut rename to patches/gui/online-shop/use-entitlement-receipt-for-native-payment/replace.nut diff --git a/gui-patches/tutorials/immediate-save-skip-tutorial/find.nut b/patches/gui/tutorials/immediate-save-skip-tutorial/find.nut similarity index 100% rename from gui-patches/tutorials/immediate-save-skip-tutorial/find.nut rename to patches/gui/tutorials/immediate-save-skip-tutorial/find.nut diff --git a/gui-patches/tutorials/immediate-save-skip-tutorial/patch.jsonc b/patches/gui/tutorials/immediate-save-skip-tutorial/patch.jsonc similarity index 100% rename from gui-patches/tutorials/immediate-save-skip-tutorial/patch.jsonc rename to patches/gui/tutorials/immediate-save-skip-tutorial/patch.jsonc diff --git a/gui-patches/tutorials/immediate-save-skip-tutorial/replace.nut b/patches/gui/tutorials/immediate-save-skip-tutorial/replace.nut similarity index 100% rename from gui-patches/tutorials/immediate-save-skip-tutorial/replace.nut rename to patches/gui/tutorials/immediate-save-skip-tutorial/replace.nut diff --git a/packages/build/src/cli.ts b/scripts/build-game-copy.ts similarity index 67% rename from packages/build/src/cli.ts rename to scripts/build-game-copy.ts index b95c6ec..339cae3 100644 --- a/packages/build/src/cli.ts +++ b/scripts/build-game-copy.ts @@ -1,35 +1,44 @@ /** - * Development entry point of the build: read the stock files of a game folder, write the - * files of the game copy. + * Development script: build the game copy from the stock files of a game folder. * - * node packages/build/src/cli.ts --game --out --port - * [--patches exe-patches] [--gui-patches gui-patches] - * [--native build/native] [--decal-cache ] [--verbose] + * node scripts/build-game-copy.ts --game --out --port + * --data + * [--patches ] [--gui-patches ] + * [--native ] [--decal-cache ] [--verbose] * * Writes /char.vromfs.bin, /aces.vromfs.bin, /gui.vromfs.bin, /win64/aces.exe * and the network hook library the patched executable loads (/win64/wto_ws.dll from --native, * built by native/wto-net/build.ps1, and its settings wto_ws.cfg). The stock folder is only read. - * --decal-cache names the cache/content folder of the player's online installation; it is copied - * to /cache/content (decals/player-decal-cache.ts), otherwise char.vromfs.bin gets the - * placeholder decal index (decals/offline-decal-index.ts). - * The launcher will run the same steps at every launch, with the port the player chose. + * --data is the folder the local server will run with: the store packs it sells there (its tuning + * with that folder's overrides) get bundle GUIDs in gui.blk. --decal-cache names the cache/content + * folder of the player's online installation; it is copied to /cache/content, otherwise + * char.vromfs.bin gets the placeholder decal index. + * The patch folders and the hook library default to this repository's patches/exe, patches/gui + * and build/native. The launcher runs the same steps at every launch, with the port the player chose. */ import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs'; import { dirname, join } from 'node:path'; -import { parseArgs } from 'node:util'; import { fileURLToPath } from 'node:url'; -import { rebuildCharPack } from './char-pack.ts'; -import { copyPlayerDecalCache, playerDecalCacheProblem } from './decals/player-decal-cache.ts'; -import { patchExecutable } from './executable.ts'; -import { assertWritableCopy, GAME_FILES } from './game-copy.ts'; -import { rebuildGuiPack } from './gui-pack.ts'; -import { rebuildMainPack } from './main-pack.ts'; -import { localEndpoint } from './network/local-endpoint.ts'; -import { NETWORK_HOOK_LIBRARY, networkHookSettings } from './network/network-hook.ts'; -import { offlinePackBundleGuids } from './store/offline-bundles.ts'; +import { parseArgs } from 'node:util'; +import { + assertWritableCopy, + copyPlayerDecalCache, + GAME_FILES, + localEndpoint, + NETWORK_HOOK_LIBRARY, + networkHookSettings, + offlinePackBundleGuids, + patchExecutable, + playerDecalCacheProblem, + rebuildCharPack, + rebuildGuiPack, + rebuildMainPack, +} from '@wto/patcher'; +import { multiVehiclePackIds } from '@wto/server'; -/** The local service's default store tuning; its multi-vehicle pack ids get bundle GUIDs too. */ -const STORE_TUNING_PATH = fileURLToPath(new URL('../../local-service/tuning/store.jsonc', import.meta.url)); +const REPOSITORY = fileURLToPath(new URL('..', import.meta.url)); +const USAGE = 'usage: build-game-copy.ts --game --out --port --data ' + + '[--patches ] [--gui-patches ] [--native ] [--decal-cache ] [--verbose]'; function main(): number { const { values } = parseArgs({ @@ -37,15 +46,16 @@ function main(): number { game: { type: 'string' }, out: { type: 'string' }, port: { type: 'string' }, - patches: { type: 'string', default: 'exe-patches' }, - 'gui-patches': { type: 'string' }, - native: { type: 'string', default: join('build', 'native') }, + data: { type: 'string' }, + patches: { type: 'string', default: join(REPOSITORY, 'patches', 'exe') }, + 'gui-patches': { type: 'string', default: join(REPOSITORY, 'patches', 'gui') }, + native: { type: 'string', default: join(REPOSITORY, 'build', 'native') }, 'decal-cache': { type: 'string' }, verbose: { type: 'boolean', default: false }, }, }); - if (!values.game || !values.out || !values.port) { - console.error('usage: cli.ts --game --out --port [--patches exe-patches] [--gui-patches gui-patches] [--native build/native] [--decal-cache ] [--verbose]'); + if (!values.game || !values.out || !values.port || !values.data) { + console.error(USAGE); return 2; } assertWritableCopy(values.game, values.out); @@ -80,7 +90,7 @@ function main(): number { console.log(`shop.blk: ${charPack.revealedVehicles} hidden vehicles shown in the tech tree`); if (charPack.placeholderDecals !== undefined) console.log(`dldata: placeholder textures for ${charPack.placeholderDecals} decals`); - const packBundles = offlinePackBundleGuids(stockCharPack, STORE_TUNING_PATH); + const packBundles = offlinePackBundleGuids(stockCharPack, multiVehiclePackIds(values.data, (line) => console.log(line))); const mainPack = rebuildMainPack(readFileSync(join(values.game, GAME_FILES.mainPack)), endpoint, packBundles); console.log(`gui.blk: ${packBundles.length} offline vehicle pack bundle GUID(s) registered`); console.log(`settings.blk: ${mainPack.addresses.length} address(es) now point to ${endpoint.host}:${endpoint.port}`); diff --git a/tools/src/wtotools/__init__.py b/tools/src/wtotools/__init__.py index 39a2516..f19b165 100644 --- a/tools/src/wtotools/__init__.py +++ b/tools/src/wtotools/__init__.py @@ -3,5 +3,5 @@ Subpackages: - vromfs: read and write the game's .vromfs.bin data packs - pe: read-only view of a PE executable (address mapping, sections, functions) -- exepatch: locate and apply declarative exe patches from the exe-patches/ tree +- exepatch: locate and apply declarative exe patches from the patches/exe/ tree """ diff --git a/tools/src/wtotools/cli/exe_commands.py b/tools/src/wtotools/cli/exe_commands.py index 4c61042..6cd4d3c 100644 --- a/tools/src/wtotools/cli/exe_commands.py +++ b/tools/src/wtotools/cli/exe_commands.py @@ -1,8 +1,8 @@ """Commands that work on the game executable. - wtotools check-patches --exe [--patches exe-patches] + wtotools check-patches --exe [--patches patches/exe] wtotools check-offsets --exe [--header native/wto-net/src/local_mp_offsets.h] - wtotools patch-exe --exe --out [--patches exe-patches] [--force] + wtotools patch-exe --exe --out [--patches patches/exe] [--force] The input executable is only ever read. `patch-exe` refuses to write over its input and refuses an existing output unless --force is given, so it cannot modify a game install by @@ -19,7 +19,7 @@ from ..exepatch.assemble import disagreement from ..offset_check import parse_offset_header, verify_offsets from ..pe import PeImage -DEFAULT_PATCHES = Path("exe-patches") +DEFAULT_PATCHES = Path("patches/exe") DEFAULT_OFFSET_HEADER = Path("native/wto-net/src/local_mp_offsets.h") diff --git a/tools/src/wtotools/cli/gui_commands.py b/tools/src/wtotools/cli/gui_commands.py index 318ed19..6b48eb0 100644 --- a/tools/src/wtotools/cli/gui_commands.py +++ b/tools/src/wtotools/cli/gui_commands.py @@ -1,6 +1,6 @@ -"""Command to verify `gui-patches/` against `gui.vromfs.bin` with Quirrel bytecode compilation. +"""Command to verify `patches/gui/` against `gui.vromfs.bin` with Quirrel bytecode compilation. - wtotools check-gui --gui [--patches gui-patches] [--sq build/quirrel-check/sq.exe] + wtotools check-gui --gui [--patches patches/gui] [--sq build/quirrel-check/sq.exe] """ from __future__ import annotations @@ -10,17 +10,17 @@ from pathlib import Path from ..gui_check import verify_gui_patches -DEFAULT_GUI_PATCHES = Path("gui-patches") +DEFAULT_GUI_PATCHES = Path("patches/gui") DEFAULT_SQ_EXE = Path("build/quirrel-check/sq.exe") def register(commands: argparse._SubParsersAction) -> None: check = commands.add_parser( "check-gui", - help="apply gui-patches in memory and bytecode-compile every modified .nut script", + help="apply patches/gui in memory and bytecode-compile every modified .nut script", ) check.add_argument("--gui", type=Path, required=True, help="stock gui.vromfs.bin to read") - check.add_argument("--patches", type=Path, default=DEFAULT_GUI_PATCHES, help="gui-patches directory") + check.add_argument("--patches", type=Path, default=DEFAULT_GUI_PATCHES, help="patches/gui directory") check.add_argument("--sq", type=Path, default=DEFAULT_SQ_EXE, help="Quirrel compiler sq.exe path") check.set_defaults(handler=_check_gui) diff --git a/tools/src/wtotools/exepatch/__init__.py b/tools/src/wtotools/exepatch/__init__.py index 236262f..68e16f9 100644 --- a/tools/src/wtotools/exepatch/__init__.py +++ b/tools/src/wtotools/exepatch/__init__.py @@ -1,6 +1,6 @@ """Locate and apply the declared changes to aces.exe. -The patches themselves live as data under exe-patches/; this package is only the engine. +The patches themselves live as data under patches/exe/; this package is only the engine. Order of work, and the reason for it: find every site and verify every original byte first (plan), then write (apply). A site that is missing or ambiguous is reported, never guessed, so a game update produces a list of unavailable patches and the features they cover rather diff --git a/tools/src/wtotools/exepatch/definition.py b/tools/src/wtotools/exepatch/definition.py index 05f3592..3d10e3c 100644 --- a/tools/src/wtotools/exepatch/definition.py +++ b/tools/src/wtotools/exepatch/definition.py @@ -1,6 +1,6 @@ """Patch definitions as they are stored on disk. -One directory per change to the program's behaviour, under exe-patches///: +One directory per change to the program's behaviour, under patches/exe///: patch.jsonc id, title, features, required patches, the game versions it was verified on, and the bytes to write; comments explain the change and why the local diff --git a/tools/src/wtotools/gui_check.py b/tools/src/wtotools/gui_check.py index f372952..726150b 100644 --- a/tools/src/wtotools/gui_check.py +++ b/tools/src/wtotools/gui_check.py @@ -1,4 +1,4 @@ -"""Offline Quirrel bytecode & lexical-scope verifier for `gui-patches/`. +"""Offline Quirrel bytecode & lexical-scope verifier for `patches/gui/`. `sq.exe --syntax-check` only runs `sq_parsetoast` and skips `CodeGenVisitor`, missing `Unknown variable`, forward references, and `Named binding name conflicts with existing diff --git a/tools/src/wtotools/guipatch.py b/tools/src/wtotools/guipatch.py index 6b73f53..fc2d59a 100644 --- a/tools/src/wtotools/guipatch.py +++ b/tools/src/wtotools/guipatch.py @@ -1,13 +1,13 @@ -"""GUI script patch definitions, one folder per change under gui-patches///. +"""GUI script patch definitions, one folder per change under patches/gui///. patch.jsonc id, title, target script, features, game versions verified on, and the edits; - comments explain the change and why the local service cannot provide it + comments explain the change and why the local server cannot provide it .nut edit fragments named by `edits`: the stock text to find and its replacement Fragment files hold the exact script text followed by one terminating newline, which is not part of the fragment. Line endings are normalised to "\\n" here; `apply` matches regardless of the script's line endings (stock scripts mix "\\r\\n" and "\\n") and writes replacements with the -script's dominant line ending. Same rules as packages/build/src/gui-patch-definition.ts. +script's dominant line ending. Same rules as packages/patcher/src/gui-patch-definition.ts. """ from __future__ import annotations diff --git a/tools/src/wtotools/jsonc.py b/tools/src/wtotools/jsonc.py index 88edd8e..f08c4f0 100644 --- a/tools/src/wtotools/jsonc.py +++ b/tools/src/wtotools/jsonc.py @@ -1,4 +1,4 @@ -"""JSON with comments: the format of the patch definitions and the local service's tuning files. +"""JSON with comments: the format of the patch definitions and the local server's tuning files. Line comments (//) and block comments are blanked out, outside string literals only; the rest goes to json.loads, so error positions still match the file. Same rules as the TypeScript diff --git a/tsconfig.json b/tsconfig.json index c2ed551..a039a22 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,5 +15,8 @@ "noEmit": true, "skipLibCheck": true }, - "include": ["packages/*/src/**/*.ts"] + "include": ["apps/*/src/**/*.ts", "packages/*/src/**/*.ts", "scripts/**/*.ts"], + // The launcher is an Electron app with a window: it has its own tsconfig.node.json and + // tsconfig.web.json and its own typecheck script. + "exclude": ["apps/launcher/**"] }