How w1249178256/xyzw_web_helper works
Purpose and Runtime
XYZW Web Helper is a browser-based automation and monitoring client for the XYZW game. It manages multiple game tokens locally, communicates with game servers over encrypted BON-protocol WebSockets, displays game state, and executes individual or batch game tasks. The primary runtime is a Vue 3/Vite SPA with Pinia state; a separate Python service optionally hosts .bin files and issues token URLs.
Entry points: src/main.js, src/App.vue, src/router/index.js.
Application Shell and Navigation
The SPA bootstraps Vue, global styling, stores, and route-driven feature views. DefaultLayout provides the shared authenticated application frame; routes separate login/token-import flows from dashboards, daily tasks, batch automation, role management, legion war, and profile views. Route metadata/guards form the boundary preventing token-dependent pages from running without an imported role.
Paths: src/main.js, src/router/index.js, src/layout/DefaultLayout.vue.
Token and Role Lifecycle
Token import supports manual, URL, and .bin-derived inputs. Token stores own the selected role, persisted credentials, refresh metadata, and connection association; role state captures game-facing identity and status. Browser persistence is the core security boundary: game credentials are intended to remain client-side, with IndexedDB available for durable local data.
Paths: src/views/TokenImport/index.vue, src/stores/tokenStore.ts, src/stores/gameRoles.js.
Game Transport and Protocol Boundary
The transport layer converts game commands into BON payloads, applies supported encryption/encoding formats, and sends them through WebSocket clients. It handles connection lifecycle, message routing, queues, and reconnect behavior. Incoming messages are decoded and propagated into event-specific Pinia stores, separating opaque server protocol traffic from UI-facing game state.
Paths: src/utils/bonProtocol.js, src/utils/xyzwWebSocket.js, src/stores/events/index.ts.
State Projection and Feature UI
Feature views compose card and domain components around reactive stores: dashboard/status, daily activities, team, towers, clubs, rankings, and legion war. Event stores partition server updates by concern—role, activity, tower, team, chat, hangup, study, legion, and clock—so UI components consume normalized live state rather than direct socket traffic.
Paths: src/views/Dashboard.vue, src/views/DailyTasks.vue, src/stores/events/role.ts.
Automation Execution
Automation is command-driven rather than server-hosted. Single-task runners coordinate helper/daily actions, while the batch subsystem schedules and executes task families such as arena, bottle, car, dungeon, hang-up, items, store, and tower. It relies on the shared command/connection layer, making WebSocket availability and token validity prerequisites for automation.
Paths: src/utils/helperTaskRunner.js, src/utils/dailyTaskRunner.js, src/utils/batch/index.js.
Deployment and Optional Services
The frontend builds to static assets and can run behind Cloudflare Pages. worker.js is the edge/API proxy boundary; wrangler.toml configures its Cloudflare runtime. Docker packaging includes Nginx for static delivery. The optional Python backend, declared under server/requirements.txt, provides authenticated multi-user .bin storage and token-URL retrieval; it is separate from normal local-token operation.
Paths: worker.js, wrangler.toml, server/requirements.txt.
Main entry points: xyzwWebSocket.js WebSocket client · tokenStore.ts Token store · index.ts Event store registry · index.js Routes and guards
Components 20
Vue SPA
Browser client runtime and feature shell.
- SPA bootstrap
src/main.js - Routes and guards · Guards isolate token-dependent pages.
src/router/index.js - Authenticated layout
src/layout/DefaultLayout.vue - Token import · Accepts manual, URL, and .bin-derived tokens.
src/views/TokenImport/index.vue - Dashboard
src/views/Dashboard.vue - Daily tasks UI
src/views/DailyTasks.vue - Single-task runners · Coordinates helper and daily commands.
src/utils/helperTaskRunner.js - Daily task runner
src/utils/dailyTaskRunner.js - Batch automation · Executes arena, dungeon, hang-up, store, tower, and other task families.
src/utils/batch/index.js
Local State
Pinia stores and browser-held credentials.
- Token store · Owns selected role, credentials, refresh data, and connection association.
src/stores/tokenStore.ts - Role state · Holds game-facing identity and status.
src/stores/gameRoles.js - Event store registry · Partitions incoming state by game domain.
src/stores/events/index.ts - Role event state
src/stores/events/role.ts - Browser persistence · Client-side credential and durable data boundary.
Game Protocol
Encrypted BON WebSocket boundary.
- BON codec · Builds, encrypts, encodes, and decodes game payloads.
src/utils/bonProtocol.js - WebSocket client · Manages lifecycle, queues, routing, and reconnects.
src/utils/xyzwWebSocket.js - XYZW game servers
Deployment Services
Optional edge and token-hosting services.
- Edge API proxy
worker.js - Cloudflare config
wrangler.toml - Optional .bin service · Authenticated multi-user .bin storage and token-URL retrieval.
server/requirements.txt
Connections 21
- SPA bootstrap → Routes and guards: installs
- SPA bootstrap → Token store: initializes
- Routes and guards → Authenticated layout: renders protected routes
- Routes and guards → Token import: routes to import
- Authenticated layout → Dashboard: hosts
- Authenticated layout → Daily tasks UI: hosts
- Token import → Token store: imports credentials
- Token store → Browser persistence: persists locally
- Token store → Role state: selects role
- Dashboard → Event store registry: reads live state
- Daily tasks UI → Event store registry: reads live state
- Event store registry → Role event state: includes
- WebSocket client → BON codec: encodes and decodes via
- WebSocket client → XYZW game servers: encrypted BON WebSocket
- WebSocket client → Event store registry: routes incoming events
- Single-task runners → Daily task runner: runs daily actions
- Single-task runners → WebSocket client: sends commands
- Batch automation → WebSocket client: executes commands
- Token store → WebSocket client: supplies connection credentials
- Optional .bin service → Token import: provides token URLs/.bin inputs
- Cloudflare config → Edge API proxy: configures