Files
DFJ/tasks/tasks.json
2025-12-16 08:57:19 +08:00

666 lines
66 KiB
JSON
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"tasks": [
{
"id": 1,
"title": "Setup Project Infrastructure (Taro, Fastify, TS)",
"titleTrans": "项目基础设施搭建 (Taro, Fastify, TS)",
"description": "Establish the foundational project structure for both frontend (Taro 4.x + React 18 + TypeScript) and backend (Node.js 18+ + Fastify + TypeScript). This includes setting up the monorepo (if applicable), build tools, and basic configurations for development and production environments.",
"descriptionTrans": "为前端 (Taro 4.x + React 18 + TypeScript) 和后端 (Node.js 18+ + Fastify + TypeScript) 建立基础项目结构。这包括设置 Monorepo如果适用、构建工具以及开发和生产环境的基本配置。",
"status": "pending",
"dependencies": [],
"priority": "high",
"details": "Initialize a Taro project, configure Fastify server, integrate TypeScript for both, set up ESLint and Prettier for code consistency. Ensure Docker setup for local development. Implement basic 'hello world' endpoints for verification.",
"detailsTrans": "初始化 Taro 项目,配置 Fastify 服务器,前后端集成 TypeScript设置 ESLint 和 Prettier 统一代码风格。确保 Docker 设置用于本地开发。实现基本的“hello world”端点进行验证。",
"testStrategy": "Verify successful compilation and execution of both frontend and backend. Access a basic frontend page and a backend API endpoint (e.g., /health). Check code formatting with ESLint/Prettier.",
"testStrategyTrans": "验证前端和后端是否成功编译和执行。访问一个基本的前端页面和一个后端 API 端点(例如,/health。使用 ESLint/Prettier 检查代码格式。"
},
{
"id": 2,
"title": "Database Setup (MongoDB & Redis)",
"titleTrans": "数据库搭建 (MongoDB & Redis)",
"description": "Set up MongoDB for persistent data storage and Redis for caching and real-time data. This includes configuring connections, defining initial schemas for core entities (User, Room), and ensuring database access from the backend.",
"descriptionTrans": "设置 MongoDB 用于持久数据存储Redis 用于缓存和实时数据。这包括配置连接、定义核心实体(用户、房间)的初始模式,并确保后端可以访问数据库。",
"status": "pending",
"dependencies": [
1
],
"priority": "high",
"details": "Install and configure MongoDB and Redis instances (e.g., via Docker Compose). Implement Mongoose models for User and Room. Create Redis client connection and basic `set`/`get` functions. Ensure secure connection strings and environment variable handling.",
"detailsTrans": "安装和配置 MongoDB 和 Redis 实例(例如,通过 Docker Compose。为 User 和 Room 实现 Mongoose 模型。创建 Redis 客户端连接和基本的 `set`/`get` 函数。确保安全的连接字符串和环境变量处理。",
"testStrategy": "Write unit tests for database connection and basic CRUD operations on a dummy collection for MongoDB. Verify Redis `set`/`get` functionality. Confirm database schemas are correctly applied.",
"testStrategyTrans": "为 MongoDB 数据库连接和虚拟集合上的基本 CRUD 操作编写单元测试。验证 Redis 的 `set`/`get` 功能。确认数据库模式已正确应用。"
},
{
"id": 3,
"title": "Basic UI Component Library Development",
"titleTrans": "基础UI组件库开发",
"description": "Develop a set of reusable, theme-compliant UI components (buttons, modals, loading spinners, input fields) based on the 'deep tech' design principle. These components will form the building blocks for the entire application's frontend.",
"descriptionTrans": "根据“深色科技”设计原则,开发一套可复用、符合主题的 UI 组件(按钮、模态框、加载指示器、输入框)。这些组件将构成整个应用程序前端的构建块。",
"status": "pending",
"dependencies": [
1
],
"priority": "high",
"details": "Implement components using React functional components and styled-components/Sass. Focus on the specified color scheme (#6366f1, #40e0d0, #0f1419 background) and smooth animations. Ensure mobile-first touch optimization (min touch area 44px).",
"detailsTrans": "使用 React 函数式组件和 styled-components/Sass 实现组件。专注于指定的配色方案(#6366f1、#40e0d0、#0f1419 背景)和流畅的动画。确保移动优先的触摸优化(最小触摸区域 44px。",
"testStrategy": "Create a Storybook or similar component showcase. Visually inspect components for design adherence and responsiveness across different screen sizes. Test touch interactions on mobile emulators.",
"testStrategyTrans": "创建 Storybook 或类似的组件展示。目视检查组件是否符合设计规范,并在不同屏幕尺寸下具有响应性。在移动模拟器上测试触摸交互。"
},
{
"id": 4,
"title": "User Authentication (WeChat Login & Guest Mode)",
"titleTrans": "用户认证 (微信登录与游客模式)",
"description": "Implement the user authentication system, including WeChat authorization for quick login and a guest experience mode. This involves both frontend UI for login and backend API for user session management.",
"descriptionTrans": "实现用户认证系统,包括微信授权快速登录和游客体验模式。这涉及登录的前端 UI 和用户会话管理的后端 API。",
"status": "pending",
"dependencies": [
1,
2,
3
],
"priority": "high",
"details": "Frontend: Implement WeChat login button, handle authorization callback. Backend: Create API endpoints for WeChat login (code exchange for openid), user registration/login. Implement JWT token generation for session management. For guest mode, generate a temporary local ID and store basic data in local storage. Add a mechanism for guest accounts to bind to WeChat later.",
"detailsTrans": "前端:实现微信登录按钮,处理授权回调。后端:创建微信登录的 API 端点code 交换 openid用户注册/登录。实现 JWT token 生成用于会话管理。游客模式下,生成临时本地 ID 并将基本数据存储在本地存储中。添加游客账号后续绑定微信的机制。",
"testStrategy": "Test WeChat login flow: successful login, token generation, and user data retrieval. Test guest mode: start as guest, verify local data storage, and conversion to full account. Verify API security (e.g., unauthorized access).",
"testStrategyTrans": "测试微信登录流程成功登录、token 生成和用户数据检索。测试游客模式:以游客身份开始,验证本地数据存储,以及转换为完整账号。验证 API 安全性(例如,未经授权的访问)。"
},
{
"id": 5,
"title": "User Profile & Data Models (Server & DB)",
"titleTrans": "用户档案与数据模型 (后端与数据库)",
"description": "Define and implement the server-side data models and APIs for user profiles, including nickname, avatar, level, experience, and basic game statistics. This task focuses on persistent storage and retrieval of user data.",
"descriptionTrans": "定义和实现用户档案的服务器端数据模型和 API包括昵称、头像、等级、经验和基本游戏统计数据。此任务侧重于用户数据的持久存储和检索。",
"status": "pending",
"dependencies": [
2,
4
],
"priority": "high",
"details": "Update MongoDB User model to include `level`, `experience`, `rank`, `stats` (totalGames, wins, winRate, currentStreak, maxStreak), and `achievements`. Implement API endpoints for fetching and updating user profiles. Ensure data consistency and validation.",
"detailsTrans": "更新 MongoDB 用户模型,使其包含 `level`、`experience`、`rank`、`stats` (总局数、胜场、胜率、当前连胜、最高连胜) 和 `achievements`。实现用于获取和更新用户档案的 API 端点。确保数据一致性和验证。",
"testStrategy": "Create/update user profiles via API. Verify data is correctly stored in MongoDB and retrieved. Test edge cases for stats updates (e.g., first game, win/loss).",
"testStrategyTrans": "通过 API 创建/更新用户档案。验证数据是否正确存储在 MongoDB 中并被检索。测试统计数据更新的边缘情况(例如,第一局游戏、胜利/失败)。"
},
{
"id": 6,
"title": "Game Board UI & Plane Rendering (Client)",
"titleTrans": "游戏棋盘UI与飞机渲染 (前端)",
"description": "Develop the client-side game board component (10x10 grid) and the visual representation of planes. This includes the basic rendering of the grid and placeholder plane sprites.",
"descriptionTrans": "开发客户端游戏棋盘组件10x10 网格)和飞机的视觉表示。这包括网格的基本渲染和飞机精灵的占位符。",
"status": "pending",
"dependencies": [
3
],
"priority": "high",
"details": "Create a `GameBoard` component using Canvas or a grid-based CSS layout. Implement `PlaneSprite` components that can be positioned on the grid. Adhere to the 'deep tech' theme for visual design. The board should support coordinate system (A-J, 1-10).",
"detailsTrans": "使用 Canvas 或基于 CSS 网格布局创建 `GameBoard` 组件。实现可以放置在网格上的 `PlaneSprite` 组件。视觉设计需遵循“深色科技”主题。棋盘应支持坐标系统A-J1-10。",
"testStrategy": "Render the game board with empty cells. Place dummy plane sprites at various positions and orientations to ensure correct rendering. Verify coordinate display.",
"testStrategyTrans": "渲染空单元格的游戏棋盘。在不同位置和方向放置虚拟飞机精灵,以确保正确渲染。验证坐标显示。"
},
{
"id": 7,
"title": "Plane Model & Collision Detection Logic",
"titleTrans": "飞机模型与碰撞检测逻辑",
"description": "Implement the plane data structure (head, wings, body, tail) and the logic for checking placement legality, including boundary checks, no overlap, and completeness. This logic will be shared between client-side UI feedback and server-side validation.",
"descriptionTrans": "实现飞机数据结构(机头、机翼、机身、机尾)和检查放置合法性的逻辑,包括边界检查、无重叠和完整性。此逻辑将在客户端 UI 反馈和服务器端验证之间共享。",
"status": "pending",
"dependencies": [
1,
6
],
"priority": "high",
"details": "Define a plane object with its shape (array of relative coordinates from head), orientation, and position. Implement a `checkPlacementLegality(board, plane)` function that verifies all constraints: 10x10 boundary, no overlap with other planes, and all plane parts are within bounds. This logic should be robust and reusable.",
"detailsTrans": "定义一个飞机对象,包含其形状(从机头开始的相对坐标数组)、方向和位置。实现一个 `checkPlacementLegality(board, plane)` 函数用于验证所有约束10x10 边界、不与其他飞机重叠,以及所有飞机部件都在边界内。此逻辑应健壮且可重用。",
"testStrategy": "Write comprehensive unit tests for `checkPlacementLegality` covering valid placements, invalid placements (out of bounds, overlapping, incomplete), and different plane orientations. Test performance of the algorithm with multiple planes.",
"testStrategyTrans": "为 `checkPlacementLegality` 编写全面的单元测试,涵盖有效放置、无效放置(出界、重叠、不完整)和不同飞机方向。测试算法在多架飞机情况下的性能。"
},
{
"id": 8,
"title": "Plane Placement Interaction (Client)",
"titleTrans": "飞机布置交互 (前端)",
"description": "Develop the client-side interactive system for players to drag, drop, and rotate their 3 planes on the 10x10 grid. Provide real-time visual feedback on placement legality.",
"descriptionTrans": "开发客户端交互系统,允许玩家在 10x10 网格上拖拽、放置和旋转 3 架飞机。提供放置合法性的实时视觉反馈。",
"status": "pending",
"dependencies": [
6,
7
],
"priority": "high",
"details": "Implement drag-and-drop functionality for planes. Add a rotate button/gesture for changing plane orientation (4 directions). Use the `checkPlacementLegality` logic to provide immediate visual feedback (e.g., green highlight for valid, red for invalid). Include an 'auto-place' button. A 'confirm placement' button should send the final plane configurations to the server.",
"detailsTrans": "实现飞机的拖放功能。添加旋转按钮/手势以改变飞机方向4 个方向)。使用 `checkPlacementLegality` 逻辑提供即时视觉反馈(例如,有效时绿色高亮,无效时红色)。包括一个“自动布置”按钮。一个“确认布置”按钮应将最终飞机配置发送到服务器。",
"testStrategy": "Manually test dragging planes to all possible valid and invalid positions. Test rotation in all directions. Verify visual feedback (color changes) is accurate. Test 'auto-place' functionality. Confirm the 'confirm placement' button sends correct data.",
"testStrategyTrans": "手动测试将飞机拖动到所有可能的有效和无效位置。测试所有方向的旋转。验证视觉反馈(颜色变化)是否准确。测试“自动布置”功能。确认“确认布置”按钮发送正确数据。"
},
{
"id": 9,
"title": "WebSocket Server & Basic Messaging",
"titleTrans": "WebSocket 服务器与基本消息",
"description": "Set up the WebSocket server using Fastify's WebSocket plugin. Define a basic message protocol and implement initial message handling for connection, disconnection, and a simple 'ping-pong' heartbeat mechanism.",
"descriptionTrans": "使用 Fastify 的 WebSocket 插件设置 WebSocket 服务器。定义基本消息协议并实现连接、断开连接和简单的“ping-pong”心跳机制的初始消息处理。",
"status": "pending",
"dependencies": [
1
],
"priority": "high",
"details": "Integrate `@fastify/websocket` plugin. Design a generic `GameMessage` interface with `type`, `roomCode`, `userId`, `data`, `timestamp`, `sequence`. Implement handlers for `connection` and `disconnection` events. Set up a heartbeat mechanism to detect inactive clients (e.g., every 30 seconds).",
"detailsTrans": "集成 `@fastify/websocket` 插件。设计一个通用的 `GameMessage` 接口,包含 `type`、`roomCode`、`userId`、`data`、`timestamp`、`sequence`。实现 `connection` 和 `disconnection` 事件的处理程序。建立心跳机制以检测不活跃的客户端(例如,每 30 秒)。",
"testStrategy": "Use a WebSocket client (e.g., Postman, browser console) to connect, send messages, and disconnect. Verify server logs for connection/disconnection events. Test heartbeat by letting a client idle and observing server-side timeout.",
"testStrategyTrans": "使用 WebSocket 客户端(例如 Postman、浏览器控制台连接、发送消息和断开连接。验证服务器日志中的连接/断开连接事件。通过让客户端空闲并观察服务器端超时来测试心跳。"
},
{
"id": 10,
"title": "WebSocket Client Integration & State Management",
"titleTrans": "WebSocket 客户端集成与状态管理",
"description": "Integrate WebSocket client logic into the Taro frontend. Implement global state management (Zustand) to store connection status and received game messages, ensuring real-time UI updates.",
"descriptionTrans": "将 WebSocket 客户端逻辑集成到 Taro 前端。实现全局状态管理 (Zustand) 以存储连接状态和接收到的游戏消息,确保实时 UI 更新。",
"status": "pending",
"dependencies": [
1,
9
],
"priority": "high",
"details": "Create a WebSocket service/hook in the frontend to manage connection lifecycle (connect, disconnect, send, receive). Use Zustand to create a `GameStore` that holds `connectionState`, `user`, `room`, `gameState`. Update UI based on changes in `GameStore`. Implement message parsing and dispatching to relevant parts of the application.",
"detailsTrans": "在前端创建一个 WebSocket 服务/Hook 来管理连接生命周期(连接、断开、发送、接收)。使用 Zustand 创建一个 `GameStore`,其中包含 `connectionState`、`user`、`room`、`gameState`。根据 `GameStore` 中的变化更新 UI。实现消息解析和分发到应用程序的相关部分。",
"testStrategy": "Verify client can connect to WebSocket server. Send test messages from server and confirm client receives and updates state. Test reconnection logic (manual disconnect/reconnect).",
"testStrategyTrans": "验证客户端可以连接到 WebSocket 服务器。从服务器发送测试消息并确认客户端接收并更新状态。测试重新连接逻辑(手动断开/重新连接)。"
},
{
"id": 11,
"title": "Room Management Backend (Create, Join, Match)",
"titleTrans": "房间管理后端 (创建、加入、匹配)",
"description": "Develop the backend logic for managing game rooms: creating private rooms (with password, config), joining rooms via code, and implementing a basic random matchmaking queue.",
"descriptionTrans": "开发用于管理游戏房间的后端逻辑:创建私人房间(带密码、配置)、通过代码加入房间,并实现基本的随机匹配队列。",
"status": "pending",
"dependencies": [
2,
4,
9
],
"priority": "high",
"details": "Implement `Room` model in MongoDB and cache active room states in Redis. Create API endpoints for `createRoom`, `joinRoom`, `leaveRoom`. For matchmaking, use a Redis List or Set as a queue; when two players are in the queue, create a room for them. Implement room code generation (6-digit numeric). Handle host permissions and room configuration (e.g., round time limit, AI difficulty).",
"detailsTrans": "在 MongoDB 中实现 `Room` 模型,并将活跃房间状态缓存到 Redis 中。创建 `createRoom`、`joinRoom`、`leaveRoom` 的 API 端点。对于匹配,使用 Redis List 或 Set 作为队列当队列中有两名玩家时为他们创建一个房间。实现房间代码生成6 位数字。处理房主权限和房间配置例如回合时间限制、AI 难度)。",
"testStrategy": "Unit test room creation with various configs (password, no password). Test joining valid/invalid rooms. Simulate multiple users joining a matchmaking queue and verify room creation. Test room status updates in Redis.",
"testStrategyTrans": "单元测试不同配置(有密码、无密码)的房间创建。测试加入有效/无效房间。模拟多个用户加入匹配队列并验证房间创建。测试 Redis 中的房间状态更新。"
},
{
"id": 12,
"title": "Room Management Frontend (UI for Create, Join, Match)",
"titleTrans": "房间管理前端 (创建、加入、匹配UI)",
"description": "Develop the client-side UI for room management, allowing users to create private rooms, enter room codes to join, and initiate quick matchmaking.",
"descriptionTrans": "开发房间管理的客户端 UI允许用户创建私人房间输入房间代码加入并启动快速匹配。",
"status": "pending",
"dependencies": [
3,
10,
11
],
"priority": "high",
"details": "Create 'Create Room' modal/page with options for password, AI difficulty, round time. Implement 'Join Room' input field for room code. Implement a 'Quick Match' button. Display room lists/states. Use WebSocket to send room actions and receive updates. Show loading/waiting states during matching.",
"detailsTrans": "创建“创建房间”模态框/页面包含密码、AI 难度、回合时间等选项。实现“加入房间”的房间代码输入字段。实现“快速匹配”按钮。显示房间列表/状态。使用 WebSocket 发送房间操作并接收更新。在匹配期间显示加载/等待状态。",
"testStrategy": "Test creating a room and verify room code display. Test joining a room with the correct code. Test quick matchmaking flow. Verify error messages for invalid room codes or full rooms. Ensure UI updates correctly with WebSocket messages.",
"testStrategyTrans": "测试创建房间并验证房间代码显示。测试使用正确代码加入房间。测试快速匹配流程。验证无效房间代码或房间已满的错误消息。确保 UI 通过 WebSocket 消息正确更新。"
},
{
"id": 13,
"title": "Core Game Engine Logic (Server-side Combat)",
"titleTrans": "核心游戏引擎逻辑 (服务器端战斗)",
"description": "Implement the server-side game engine responsible for managing game state, handling player attacks, determining hit/miss/destroy outcomes, and enforcing game rules (turn-based, win conditions).",
"descriptionTrans": "实现服务器端游戏引擎,负责管理游戏状态、处理玩家攻击、确定命中/未命中/击毁结果,并执行游戏规则(回合制、胜利条件)。",
"status": "pending",
"dependencies": [
2,
7,
9,
11
],
"priority": "high",
"details": "Create a `GameEngine` module. Store game state (player boards, plane positions, attack history, current turn) in Redis. Implement `processAttack(roomId, userId, targetCoordinate)` function. This function should: 1. Validate turn. 2. Check target on opponent's board. 3. Determine MISS, HIT, or DESTROY (if head is hit). 4. Update game state. 5. Check win condition (all 3 planes destroyed). 6. Switch turn. Use the `Plane` data structure and collision logic from Task 7. Store game sessions in MongoDB for history.",
"detailsTrans": "创建 `GameEngine` 模块。将游戏状态(玩家棋盘、飞机位置、攻击历史、当前回合)存储在 Redis 中。实现 `processAttack(roomId, userId, targetCoordinate)` 函数。此函数应1. 验证回合。2. 检查对手棋盘上的目标。3. 确定 MISS、HIT 或 DESTROY如果击中机头。4. 更新游戏状态。5. 检查胜利条件(所有 3 架飞机被摧毁。6. 切换回合。使用任务 7 中的 `Plane` 数据结构和碰撞逻辑。将游戏会话存储在 MongoDB 中以供历史记录。",
"testStrategy": "Unit test `processAttack` with various scenarios: miss, hit (body), hit (head/destroy), hitting same spot twice. Test turn switching and win condition detection. Simulate a full game flow via API calls to verify engine logic. Test concurrent attacks (should be prevented by turn validation).",
"testStrategyTrans": "单元测试 `processAttack` 的各种场景:未命中、命中(机身)、命中(机头/击毁)、两次击中同一位置。测试回合切换和胜利条件检测。通过 API 调用模拟完整游戏流程以验证引擎逻辑。测试并发攻击(应通过回合验证阻止)。"
},
{
"id": 14,
"title": "Simple AI Implementation (Random + Basic Exclusion)",
"titleTrans": "简单AI实现 (随机+基本排除)",
"description": "Implement the 'Simple AI' difficulty level. This AI will make random attacks, but with basic exclusion of already attacked cells. It serves as a training partner for new players.",
"descriptionTrans": "实现“简单 AI”难度级别。此 AI 将进行随机攻击,但会基本排除已攻击过的单元格。它可作为新玩家的训练伙伴。",
"status": "pending",
"dependencies": [
13
],
"priority": "high",
"details": "Create an `AIService` module. For 'Simple AI', implement a strategy that: 1. Generates a list of all untargeted cells on the opponent's board. 2. Randomly selects one cell from this list. 3. Calls the `processAttack` function with the chosen coordinate. Ensure AI decision-making time is <500ms.",
"detailsTrans": "创建 `AIService` 模块。对于“简单 AI”实现一个策略1. 生成对手棋盘上所有未被攻击的单元格列表。2. 从此列表中随机选择一个单元格。3. 使用选定的坐标调用 `processAttack` 函数。确保 AI 决策时间 <500ms。",
"testStrategy": "Play multiple games against the Simple AI. Verify AI consistently makes moves, does not attack the same spot twice, and adheres to the turn-based system. Check response time.",
"testStrategyTrans": "与简单 AI 进行多局游戏。验证 AI 始终出招,不会两次攻击同一位置,并遵循回合制。检查响应时间。"
},
{
"id": 15,
"title": "Game Play Loop Integration (Client & Server)",
"titleTrans": "游戏流程集成 (前端与后端)",
"description": "Integrate all core game components (plane placement, attack phase, turn management) into a complete, playable game loop for both player vs. player and player vs. AI modes. This involves extensive WebSocket communication and UI state updates.",
"descriptionTrans": "将所有核心游戏组件(飞机布置、攻击阶段、回合管理)集成到玩家对玩家和玩家对 AI 模式的完整可玩游戏循环中。这涉及广泛的 WebSocket 通信和 UI 状态更新。",
"status": "pending",
"dependencies": [
8,
10,
12,
13,
14
],
"priority": "high",
"details": "Frontend: Implement `GameScreen` component. Display both player's (hidden planes) and opponent's boards. Handle 'your turn' UI, attack target selection, and attack confirmation. Display hit/miss/destroy feedback. Show opponent's moves. Implement round countdown. Backend: Coordinate plane placement phase, transition to battle phase, manage turn timers, handle timeout for attacks (random attack). Broadcast game state changes via WebSocket to all participants.",
"detailsTrans": "前端:实现 `GameScreen` 组件。显示玩家隐藏飞机和对手的棋盘。处理“你的回合”UI、攻击目标选择和攻击确认。显示命中/未命中/击毁反馈。显示对手的移动。实现回合倒计时。后端:协调飞机布置阶段,过渡到战斗阶段,管理回合计时器,处理攻击超时(随机攻击)。通过 WebSocket 向所有参与者广播游戏状态变化。",
"testStrategy": "Conduct full end-to-end tests for PV P and PVE (AI) matches. Verify plane placement, attack sequence, turn switching, hit feedback, and game conclusion. Test round countdown and timeout auto-attack. Check for any desynchronization issues between clients.",
"testStrategyTrans": "对玩家对玩家和玩家对 AI 比赛进行全面的端到端测试。验证飞机布置、攻击序列、回合切换、命中反馈和游戏结束。测试回合倒计时和超时自动攻击。检查客户端之间的任何不同步问题。"
},
{
"id": 16,
"title": "Game End & Settlement System",
"titleTrans": "游戏结束与结算系统",
"description": "Implement the logic and UI for ending a game, determining the winner, and displaying a settlement screen with results and rewards (e.g., experience points).",
"descriptionTrans": "实现游戏结束、确定赢家以及显示带有结果和奖励(例如经验值)的结算屏幕的逻辑和 UI。",
"status": "pending",
"dependencies": [
5,
15
],
"priority": "high",
"details": "Backend: When a win condition is met, update player stats (wins, losses, streaks, experience) in MongoDB. Calculate XP based on victory/defeat (win +100XP, loss +20XP). Frontend: Display a 'Game Over' modal/screen showing winner/loser, final board state, and earned XP/rewards. Include 'Play Again' and 'Return to Lobby' buttons.",
"detailsTrans": "后端:当满足胜利条件时,更新 MongoDB 中玩家的统计数据(胜场、败场、连胜、经验)。根据胜利/失败计算经验值(胜利 +100XP失败 +20XP。前端显示“游戏结束”模态框/屏幕,显示赢家/输家、最终棋盘状态和获得的经验值/奖励。包括“再玩一局”和“返回大厅”按钮。",
"testStrategy": "Play games to completion (win/loss) and verify correct winner determination. Check if XP and stats are updated in the database. Verify settlement screen displays accurate information. Test 'Play Again' and 'Return to Lobby' functionality.",
"testStrategyTrans": "完成游戏(胜利/失败)并验证正确的赢家判定。检查数据库中经验值和统计数据是否更新。验证结算屏幕显示准确信息。测试“再玩一局”和“返回大厅”功能。"
},
{
"id": 17,
"title": "Basic Game Statistics & Display",
"titleTrans": "基础游戏统计与显示",
"description": "Develop the functionality to track and display basic user game statistics, such as total games played, win rate, and current/max win streaks, on the user's profile.",
"descriptionTrans": "开发跟踪和显示用户基本游戏统计数据的功能,例如总游戏局数、胜率和当前/最高连胜记录,并在用户档案中显示。",
"status": "pending",
"dependencies": [
5,
16
],
"priority": "medium",
"details": "Frontend: Create a 'My Profile' section that fetches user stats from the backend. Display `totalGames`, `wins`, `winRate` (calculated from wins/totalGames), `currentStreak`, `maxStreak`. Backend: Ensure that `Game End & Settlement` (Task 16) correctly updates these fields in the User model.",
"detailsTrans": "前端:创建一个“我的档案”部分,从后端获取用户统计数据。显示 `totalGames`、`wins`、`winRate`(根据胜场/总局数计算)、`currentStreak`、`maxStreak`。后端:确保“游戏结束与结算”(任务 16正确更新用户模型中的这些字段。",
"testStrategy": "Play multiple games with varying outcomes. Verify that statistics on the profile page update correctly after each game. Test edge cases like a user's first game, or breaking a win streak.",
"testStrategyTrans": "玩多局不同结果的游戏。验证每局游戏后档案页面上的统计数据是否正确更新。测试边缘情况,例如用户的第一局游戏,或中断连胜。"
},
{
"id": 18,
"title": "Disconnect & Reconnect Mechanism (Client & Server)",
"titleTrans": "断线重连机制 (前端与后端)",
"description": "Implement a robust mechanism for handling client disconnections during a game, allowing players to automatically reconnect and resume their game session.",
"descriptionTrans": "实现一个强大的机制,用于处理游戏期间的客户端断线,允许玩家自动重新连接并恢复他们的游戏会话。",
"status": "pending",
"dependencies": [
9,
10,
13
],
"priority": "high",
"details": "Frontend: Implement exponential backoff for WebSocket reconnection attempts (1s, 2s, 4s...). Display a 'Reconnecting...' UI. Backend: Store a snapshot of the current game state in Redis. When a client reconnects, verify their identity and send the latest game state snapshot. Implement a 30-minute room retention policy for disconnected players to rejoin.",
"detailsTrans": "前端:为 WebSocket 重新连接尝试实现指数退避1s、2s、4s...)。显示“正在重新连接...”UI。后端将当前游戏状态的快照存储在 Redis 中。当客户端重新连接时,验证其身份并发送最新的游戏状态快照。为断线玩家重新加入实施 30 分钟的房间保留策略。",
"testStrategy": "During a live game, forcibly disconnect the client (e.g., turn off Wi-Fi, close and reopen app quickly). Verify automatic reconnection and game state restoration. Test behavior when reconnection fails after multiple attempts (return to lobby). Test if the room persists for 30 mins.",
"testStrategyTrans": "在实时游戏中,强制断开客户端连接(例如,关闭 Wi-Fi快速关闭并重新打开应用程序。验证自动重新连接和游戏状态恢复。测试多次尝试后重新连接失败时的行为返回大厅。测试房间是否持续 30 分钟。"
},
{
"id": 19,
"title": "Initial Performance Optimization & Bug Fixes",
"titleTrans": "初步性能优化与Bug修复",
"description": "Conduct initial performance profiling and address critical bugs identified during MVP development. Focus on improving client-side rendering, network latency, and overall responsiveness.",
"descriptionTrans": "进行初步的性能分析并解决 MVP 开发期间发现的关键错误。重点关注改善客户端渲染、网络延迟和整体响应能力。",
"status": "pending",
"dependencies": [
15,
18
],
"priority": "high",
"details": "Frontend: Optimize rendering of `GameBoard` and `PlaneSprite` components (e.g., memoization, use of `requestAnimationFrame`). Implement message compression for WebSocket. Backend: Review database queries for efficiency (indexing). Monitor server CPU/memory usage. Address any reported bugs. Ensure client-side loading times (<2s first screen, <300ms page switch) and stable 60fps.",
"detailsTrans": "前端:优化 `GameBoard` 和 `PlaneSprite` 组件的渲染(例如,记忆化、使用 `requestAnimationFrame`)。为 WebSocket 实现消息压缩。后端:审查数据库查询以提高效率(索引)。监控服务器 CPU/内存使用情况。解决任何报告的错误。确保客户端加载时间(首屏 <2 秒,页面切换 <300 毫秒)和稳定的 60fps。",
"testStrategy": "Use browser/mini-program developer tools to profile rendering performance (FPS, repaint times). Monitor network requests for latency and payload size. Conduct stress tests on the backend. Perform thorough QA testing to identify and verify bug fixes.",
"testStrategyTrans": "使用浏览器/小程序开发者工具分析渲染性能FPS、重绘时间。监控网络请求的延迟和负载大小。对后端进行压力测试。进行彻底的 QA 测试以识别和验证错误修复。"
},
{
"id": 20,
"title": "User Level & Rank System (Frontend & Backend)",
"titleTrans": "用户等级与段位系统 (前端与后端)",
"description": "Expand the user profile to include a level system (1-100) based on accumulated experience points and a rank system (Bronze-King) based on game performance.",
"descriptionTrans": "扩展用户档案使其包含基于累积经验值的等级系统1-100级和基于游戏表现的段位系统青铜-王者)。",
"status": "pending",
"dependencies": [
5,
16,
17
],
"priority": "medium",
"details": "Backend: Implement logic for XP thresholds for level progression. Define rules for rank promotion/demotion (e.g., every 10 levels for rank, or based on Elo/Glicko rating). Update `User` model and `Game End & Settlement` to reflect these changes. Frontend: Display user's current level and rank visually on their profile and in game UI. Design appropriate badges/icons for ranks.",
"detailsTrans": "后端:实现经验值阈值以进行等级晋升的逻辑。定义段位晋升/降级规则(例如,每 10 级一个段位,或基于 Elo/Glicko 评分)。更新 `User` 模型和“游戏结束与结算”以反映这些变化。前端:在用户的档案和游戏 UI 中视觉化显示当前等级和段位。为段位设计适当的徽章/图标。",
"testStrategy": "Play multiple games to gain XP and level up. Verify level and rank increase correctly. Test edge cases for rank promotion/demotion. Ensure UI accurately reflects the current level and rank.",
"testStrategyTrans": "玩多局游戏以获得经验值并升级。验证等级和段位是否正确提升。测试段位晋升/降级的边缘情况。确保 UI 准确反映当前等级和段位。"
},
{
"id": 21,
"title": "Friend System (WeChat Import & Invite)",
"titleTrans": "好友系统 (微信导入与邀请)",
"description": "Implement a friend system allowing users to import WeChat friends, view online status, and send game invitations. Include a basic blacklist feature.",
"descriptionTrans": "实现一个好友系统,允许用户导入微信好友、查看在线状态并发送游戏邀请。包括一个基本的黑名单功能。",
"status": "pending",
"dependencies": [
4,
10,
12
],
"priority": "medium",
"details": "Frontend: Implement UI for 'Friends List'. Use WeChat API for friend relationship chain authorization and import. Display online/offline status (via WebSocket presence updates). Implement 'Invite to Game' button that generates a shareable link/card. Backend: Store friend relationships. Implement APIs for adding/removing friends and managing blacklists. Use Redis to track online users.",
"detailsTrans": "前端实现“好友列表”UI。使用微信 API 进行好友关系链授权和导入。显示在线/离线状态(通过 WebSocket 在线状态更新)。实现“邀请游戏”按钮,生成可分享的链接/卡片。后端:存储好友关系。实现添加/删除好友和管理黑名单的 API。使用 Redis 跟踪在线用户。",
"testStrategy": "Test WeChat friend import. Verify online status updates in real-time. Send game invitations to friends and confirm they can join the invited room. Test blacklist functionality.",
"testStrategyTrans": "测试微信好友导入。验证在线状态实时更新。向好友发送游戏邀请并确认他们可以加入受邀房间。测试黑名单功能。"
},
{
"id": 22,
"title": "In-Room Chat (Text & Emotes)",
"titleTrans": "房间内聊天 (文字与表情)",
"description": "Add a real-time chat feature within game rooms, supporting both text messages and a selection of emotes.",
"descriptionTrans": "在游戏房间内添加实时聊天功能,支持文字消息和表情。",
"status": "pending",
"dependencies": [
10,
12
],
"priority": "medium",
"details": "Frontend: Implement a chat input field and message display area in the room UI. Include an emote picker. Backend: Implement WebSocket message type for `CHAT_MESSAGE`. Broadcast chat messages to all participants in the room. Implement basic message filtering for offensive content.",
"detailsTrans": "前端:在房间 UI 中实现聊天输入框和消息显示区域。包括表情选择器。后端:为 `CHAT_MESSAGE` 实现 WebSocket 消息类型。将聊天消息广播给房间中的所有参与者。实现基本的冒犯性内容消息过滤。",
"testStrategy": "Join a room with multiple players. Send text messages and emotes. Verify all players receive messages in real-time. Test message filtering. Check for UI responsiveness with many messages.",
"testStrategyTrans": "与多名玩家加入一个房间。发送文本消息和表情。验证所有玩家实时接收消息。测试消息过滤。检查 UI 在大量消息下的响应能力。"
},
{
"id": 23,
"title": "Game Replay Functionality",
"titleTrans": "游戏回放功能",
"description": "Enable users to view replays of their past games, step-by-step, to analyze strategies and share exciting moments.",
"descriptionTrans": "允许用户逐步查看他们过去的游戏回放,以分析策略并分享精彩瞬间。",
"status": "pending",
"dependencies": [
2,
13,
15
],
"priority": "medium",
"details": "Backend: When a game ends, store a condensed `moves` history (sequence of attacks, results) in the `GameSession` model in MongoDB. Frontend: Create a 'Replay' screen. Fetch `GameSession` data. Reconstruct the game state step-by-step, allowing users to navigate through turns (play, pause, next, previous).",
"detailsTrans": "后端:游戏结束时,将精简的 `moves` 历史(攻击序列、结果)存储在 MongoDB 的 `GameSession` 模型中。前端:创建“回放”屏幕。获取 `GameSession` 数据。逐步重建游戏状态,允许用户在回合中导航(播放、暂停、下一回合、上一回合)。",
"testStrategy": "Play several games and verify that replays are saved. Access replay for different games and verify accurate reconstruction of the game. Test playback controls (play/pause, step forward/backward).",
"testStrategyTrans": "玩多局游戏并验证回放是否保存。访问不同游戏的回放并验证游戏重建的准确性。测试播放控制(播放/暂停、前进/后退)。"
},
{
"id": 24,
"title": "Share Game Results (Image Generation)",
"titleTrans": "分享战绩 (图片生成)",
"description": "Implement functionality to generate shareable image cards of game results, allowing users to easily share their achievements on WeChat or other platforms.",
"descriptionTrans": "实现生成可分享的游戏结果图片卡片的功能,允许用户轻松在微信或其他平台分享他们的成就。",
"status": "pending",
"dependencies": [
16,
17
],
"priority": "medium",
"details": "Frontend: After a game, provide a 'Share' button. Use Canvas API to render the game result (winner, score, final board state) into an image. Include user's avatar, nickname, and a QR code for the mini-program. Implement WeChat sharing API to allow sharing the generated image to friends/groups/moments.",
"detailsTrans": "前端:游戏结束后,提供“分享”按钮。使用 Canvas API 将游戏结果(赢家、分数、最终棋盘状态)渲染成图片。包括用户头像、昵称和微信小程序的二维码。实现微信分享 API允许将生成的图片分享给好友/群组/朋友圈。",
"testStrategy": "Complete a game and trigger the share function. Verify the generated image accurately reflects the game results and looks visually appealing. Test sharing to WeChat (friends, groups, moments) and confirm successful delivery.",
"testStrategyTrans": "完成游戏并触发分享功能。验证生成的图片是否准确反映游戏结果并具有视觉吸引力。测试分享到微信(好友、群组、朋友圈)并确认成功发送。"
},
{
"id": 25,
"title": "Achievement System (Badges, Tasks)",
"titleTrans": "成就系统 (徽章、任务)",
"description": "Introduce an achievement system with various badges and tasks to incentivize player engagement and provide long-term goals.",
"descriptionTrans": "引入成就系统,包含各种徽章和任务,以激励玩家参与并提供长期目标。",
"status": "pending",
"dependencies": [
5,
16,
17
],
"priority": "medium",
"details": "Backend: Define `Achievement` model (e.g., 'First Win', '5-Win Streak', 'Hit King'). Implement logic to detect when achievements are unlocked based on game events and player stats. Store unlocked achievements in the `User` model. Frontend: Create an 'Achievements' section in the user profile to display earned badges and progress towards unearned ones. Provide visual flair for new achievements.",
"detailsTrans": "后端:定义 `Achievement` 模型(例如,“首胜”、“五连胜”、“命中王”)。实现根据游戏事件和玩家统计数据检测成就解锁的逻辑。将解锁的成就存储在 `User` 模型中。前端:在用户档案中创建一个“成就”部分,显示已获得的徽章和未获得成就的进度。为新成就提供视觉效果。",
"testStrategy": "Test unlocking various achievements (e.g., win first game, achieve a streak). Verify achievements are correctly recorded in the database. Check if the UI updates to show new achievements and progress.",
"testStrategyTrans": "测试解锁各种成就(例如,赢得第一局游戏,实现连胜)。验证成就是否正确记录在数据库中。检查 UI 是否更新以显示新成就和进度。"
},
{
"id": 26,
"title": "Advanced AI Difficulty Levels (Normal, Hard)",
"titleTrans": "高级AI难度级别 (普通、困难)",
"description": "Enhance the AI system by implementing 'Normal' and 'Hard' difficulty levels, utilizing more sophisticated strategies like probability heatmaps and pattern recognition.",
"descriptionTrans": "通过实现“普通”和“困难”难度级别来增强 AI 系统,利用更复杂的策略,如概率热图和模式识别。",
"status": "pending",
"dependencies": [
14,
15
],
"priority": "medium",
"details": "For 'Normal AI', implement a strategy that prioritizes cells with higher probability of containing a plane part (e.g., based on surrounding hits). For 'Hard AI', introduce multi-step prediction and basic pattern recognition (e.g., if a HIT occurs, prioritize adjacent cells). Ensure AI difficulty can be selected in room creation.",
"detailsTrans": "对于“普通 AI”实现一种策略优先选择包含飞机部件概率更高的单元格例如根据周围命中情况。对于“困难 AI”引入多步预测和基本模式识别例如如果发生命中则优先考虑相邻单元格。确保在房间创建时可以选择 AI 难度。",
"testStrategy": "Play numerous games against Normal and Hard AI. Observe their attack patterns and verify they are more strategic than Simple AI. Ensure AI still makes decisions within the <500ms time limit. Compare win rates against different AI difficulties.",
"testStrategyTrans": "与普通和困难 AI 进行多局游戏。观察它们的攻击模式,并验证它们比简单 AI 更具策略性。确保 AI 仍然在 <500 毫秒的时间限制内做出决策。比较不同 AI 难度下的胜率。"
},
{
"id": 27,
"title": "Leaderboard System",
"titleTrans": "排行榜系统",
"description": "Develop a global leaderboard system to display top players based on various metrics (e.g., rank, wins, win rate).",
"descriptionTrans": "开发一个全球排行榜系统,根据各种指标(例如,段位、胜场、胜率)显示顶尖玩家。",
"status": "pending",
"dependencies": [
5,
17,
20
],
"priority": "medium",
"details": "Backend: Implement API endpoints to fetch leaderboard data (e.g., top 100 players by rank, by wins). This might involve efficient queries on the `Users` collection or pre-calculated data in Redis. Frontend: Create a 'Leaderboard' screen with tabs for different ranking criteria. Display player's own rank within the leaderboard.",
"detailsTrans": "后端:实现 API 端点以获取排行榜数据(例如,按段位、按胜场排名的前 100 名玩家)。这可能涉及对 `Users` 集合的有效查询或 Redis 中的预计算数据。前端:创建一个“排行榜”屏幕,带有不同排名标准的选项卡。在排行榜中显示玩家自己的排名。",
"testStrategy": "Populate the database with dummy user data and varied stats. Verify leaderboard data is fetched correctly and sorted as expected for different criteria. Check UI rendering of top players and user's own position.",
"testStrategyTrans": "用虚拟用户数据和各种统计数据填充数据库。验证排行榜数据是否正确获取并按不同标准排序。检查顶尖玩家和用户自身位置的 UI 渲染。"
},
{
"id": 28,
"title": "Matchmaking Algorithm Optimization",
"titleTrans": "匹配算法优化",
"description": "Refine the matchmaking algorithm to improve player experience by considering factors like player skill (rank/level) and reducing wait times. Implement tiered matching.",
"descriptionTrans": "优化匹配算法,通过考虑玩家技能(段位/等级)和减少等待时间来改善玩家体验。实现阶梯匹配。",
"status": "pending",
"dependencies": [
11,
20,
27
],
"priority": "medium",
"details": "Backend: Modify the matchmaking queue logic. Instead of pure random, prioritize matching players with similar ranks/levels. If no suitable match is found within a short time (e.g., 30s), expand the search criteria (wider rank range, then consider matching with AI or bots). Implement a timeout for matchmaking (e.g., 120s) before offering alternative modes.",
"detailsTrans": "后端:修改匹配队列逻辑。不再纯粹随机,优先匹配段位/等级相似的玩家。如果在短时间内(例如 30 秒)找不到合适的匹配,则扩大搜索范围(更宽的段位范围,然后考虑与 AI 或机器人匹配)。实施匹配超时(例如 120 秒),然后提供替代模式。",
"testStrategy": "Simulate matchmaking with various player populations (e.g., many low-rank, few high-rank). Verify that players are matched with appropriate opponents or that search criteria expand as expected. Measure average matchmaking time.",
"testStrategyTrans": "模拟不同玩家群体(例如,许多低段位,少数高段位)的匹配。验证玩家是否与合适的对手匹配,或者搜索条件是否按预期扩展。测量平均匹配时间。"
},
{
"id": 29,
"title": "System Monitoring & Analytics Integration",
"titleTrans": "系统监控与数据分析集成",
"description": "Integrate comprehensive monitoring and analytics tools (Prometheus, Grafana, ELK, Sentry) to track application health, performance, and key business metrics.",
"descriptionTrans": "集成全面的监控和数据分析工具Prometheus、Grafana、ELK、Sentry以跟踪应用程序健康状况、性能和关键业务指标。",
"status": "pending",
"dependencies": [
1,
19
],
"priority": "medium",
"details": "Set up Prometheus for metric collection and Grafana for dashboard visualization. Configure ELK stack for log aggregation and analysis. Integrate Sentry for real-time error tracking. Implement basic user behavior tracking (e.g., login, room creation, game start/end) using events as described in PRD (8.4.1).",
"detailsTrans": "设置 Prometheus 用于指标收集Grafana 用于仪表盘可视化。配置 ELK 堆栈用于日志聚合和分析。集成 Sentry 用于实时错误跟踪。使用 PRD 中描述的事件8.4.1)实现基本的用户行为跟踪(例如,登录、房间创建、游戏开始/结束)。",
"testStrategy": "Verify all monitoring tools are collecting data (metrics, logs, errors). Trigger specific events/errors and confirm they appear in the respective dashboards. Check if custom business metrics are being tracked correctly.",
"testStrategyTrans": "验证所有监控工具都在收集数据(指标、日志、错误)。触发特定事件/错误并确认它们出现在各自的仪表盘中。检查自定义业务指标是否正确跟踪。"
},
{
"id": 30,
"title": "Interactive Newbie Guide",
"titleTrans": "交互式新手引导",
"description": "Create an interactive, step-by-step tutorial for new users to learn the game rules, controls, and core mechanics, including AI accompaniment.",
"descriptionTrans": "为新用户创建一个交互式的分步教程,以学习游戏规则、控制和核心机制,包括 AI 陪练。",
"status": "pending",
"dependencies": [
3,
8,
15,
14
],
"priority": "medium",
"details": "Design a series of guided steps (e.g., 'how to place planes', 'how to attack'). Implement overlay UI elements to highlight actions. Use a simplified AI to guide the player through their first game. Allow users to skip or review the guide. Store guide progress in user settings.",
"detailsTrans": "设计一系列引导步骤(例如,“如何放置飞机”、“如何攻击”)。实现叠加 UI 元素以突出显示操作。使用简化的 AI 引导玩家完成他们的第一局游戏。允许用户跳过或回顾引导。将引导进度存储在用户设置中。",
"testStrategy": "On a new account, go through the entire newbie guide. Verify each step is clear and interactive. Test skipping and reviewing sections. Ensure progress is saved if the user exits mid-guide.",
"testStrategyTrans": "在新账号上,完成整个新手引导。验证每个步骤都清晰且具有交互性。测试跳过和回顾部分。确保如果用户在引导中途退出,进度会保存。"
},
{
"id": 31,
"title": "Game Sound Effects & Visual Effects",
"titleTrans": "游戏音效与视觉特效",
"description": "Add engaging sound effects for game events (hit, miss, destroy) and UI interactions, along with corresponding visual effects.",
"descriptionTrans": "为游戏事件(命中、未命中、击毁)和 UI 交互添加引人入胜的音效,以及相应的视觉特效。",
"status": "pending",
"dependencies": [
15
],
"priority": "medium",
"details": "Source or create sound assets (e.g., 'miss' splash, 'hit' thud, 'destroy' explosion). Integrate an audio manager to play sounds based on game events. Implement visual effects for attacks (e.g., a laser shot, explosion animations for hits/destroys). Ensure performance is not impacted and provide volume controls.",
"detailsTrans": "获取或创建声音素材(例如,“未命中”水花声,“命中”沉闷声,“击毁”爆炸声)。集成音频管理器以根据游戏事件播放声音。为攻击实现视觉效果(例如,激光射击,命中/击毁的爆炸动画)。确保性能不受影响并提供音量控制。",
"testStrategy": "Play a game and verify that all key actions (placing, attacking, hitting, missing, destroying) have appropriate sound and visual effects. Test UI interaction sounds. Check performance during intense effect sequences. Test volume controls.",
"testStrategyTrans": "玩一局游戏并验证所有关键操作(放置、攻击、命中、未命中、击毁)都具有适当的声音和视觉效果。测试 UI 交互音效。检查在强烈特效序列期间的性能。测试音量控制。"
},
{
"id": 32,
"title": "Activity System (Daily Sign-in, Events)",
"titleTrans": "活动系统 (每日签到、活动)",
"description": "Implement a basic activity system to offer daily rewards (e.g., sign-in bonuses) and temporary event-based incentives.",
"descriptionTrans": "实现一个基本的活动系统,提供每日奖励(例如,签到奖励)和基于临时活动的激励。",
"status": "pending",
"dependencies": [
2,
5
],
"priority": "low",
"details": "Backend: Design a flexible `Activity` data model (e.g., daily sign-in, specific win count event). Implement API endpoints for checking activity status and claiming rewards. Store user activity progress in MongoDB. Frontend: Create an 'Activities' section. Display current activities, progress, and a button to claim rewards. Implement daily sign-in UI with calendar.",
"detailsTrans": "后端:设计一个灵活的 `Activity` 数据模型(例如,每日签到、特定胜场活动)。实现用于检查活动状态和领取奖励的 API 端点。将用户活动进度存储在 MongoDB 中。前端:创建一个“活动”部分。显示当前活动、进度和领取奖励的按钮。实现带日历的每日签到 UI。",
"testStrategy": "Test daily sign-in over several days. Verify rewards are granted correctly and progress is tracked. Test a temporary event (e.g., 'win 3 games for bonus') and ensure rewards are given upon completion.",
"testStrategyTrans": "测试连续几天的每日签到。验证奖励是否正确发放,进度是否跟踪。测试临时活动(例如,“赢得 3 场游戏获得奖励”)并确保完成后发放奖励。"
},
{
"id": 33,
"title": "Basic Shop System (Skins, Effects)",
"titleTrans": "基础商城系统 (皮肤、特效)",
"description": "Implement a basic in-game shop where players can purchase cosmetic items like plane skins and attack effects using virtual currency.",
"descriptionTrans": "实现一个基础的游戏内商城,玩家可以使用虚拟货币购买飞机皮肤和攻击特效等装饰性物品。",
"status": "pending",
"dependencies": [
2,
5,
31
],
"priority": "low",
"details": "Backend: Define `Item` model (ID, type, price, asset path). Implement API for fetching shop items, purchasing items, and managing user's inventory. Users need a virtual currency balance. Frontend: Create a 'Shop' screen displaying available skins and effects. Allow users to preview items and make purchases. Display current virtual currency balance.",
"detailsTrans": "后端:定义 `Item` 模型ID、类型、价格、资产路径。实现用于获取商店物品、购买物品和管理用户库存的 API。用户需要虚拟货币余额。前端创建一个“商店”屏幕显示可用的皮肤和特效。允许用户预览物品并进行购买。显示当前虚拟货币余额。",
"testStrategy": "Add dummy items to the shop. Test purchasing items with sufficient/insufficient currency. Verify item is added to user's inventory and currency is deducted. Test equipping purchased skins/effects in a game.",
"testStrategyTrans": "在商店中添加虚拟物品。测试使用足够/不足的货币购买物品。验证物品是否添加到用户库存中,货币是否扣除。测试在游戏中装备购买的皮肤/特效。"
},
{
"id": 34,
"title": "Push Notifications (WeChat Template Messages)",
"titleTrans": "推送通知 (微信模板消息)",
"description": "Integrate WeChat template messages to send important notifications to users, such as match invitations, game start reminders, or activity updates.",
"descriptionTrans": "集成微信模板消息,向用户发送重要通知,例如比赛邀请、游戏开始提醒或活动更新。",
"status": "pending",
"dependencies": [
4,
11
],
"priority": "low",
"details": "Backend: Implement WeChat template message sending API calls. Obtain user's formId/subscribe message permissions during user interactions (e.g., after login, when creating a room). Define templates for 'Game Invitation', 'Match Found', 'Activity Reminder'. Trigger these messages based on backend events. Frontend: Guide users to authorize template messages.",
"detailsTrans": "后端:实现微信模板消息发送 API 调用。在用户交互期间(例如,登录后、创建房间时)获取用户的 formId/订阅消息权限。定义“游戏邀请”、“匹配成功”、“活动提醒”的模板。根据后端事件触发这些消息。前端:引导用户授权模板消息。",
"testStrategy": "Send a game invitation to a test user and verify they receive a WeChat template message. Test other notification types (e.g., match found, activity reminder). Ensure proper authorization handling.",
"testStrategyTrans": "向测试用户发送游戏邀请,并验证他们是否收到微信模板消息。测试其他通知类型(例如,匹配成功、活动提醒)。确保正确的授权处理。"
},
{
"id": 35,
"title": "Admin Dashboard for Data Analysis",
"titleTrans": "数据分析后台",
"description": "Develop a basic admin dashboard to view key operational data, such as DAU, retention rates, and game statistics, for product analysis and decision-making.",
"descriptionTrans": "开发一个基本的管理后台,用于查看关键运营数据,例如 DAU、留存率和游戏统计数据以进行产品分析和决策。",
"status": "pending",
"dependencies": [
2,
29
],
"priority": "low",
"details": "Develop a separate web application (e.g., using React Admin or a simple Fastify API + static HTML) for the admin dashboard. Implement authentication for admin users. Fetch data from MongoDB (user stats, game logs) and Redis (real-time metrics). Display DAU, new users, retention rates, game counts, top players. Integrate with Grafana dashboards if possible.",
"detailsTrans": "为管理后台开发一个独立的 Web 应用程序(例如,使用 React Admin 或简单的 Fastify API + 静态 HTML。实现管理员用户的认证。从 MongoDB用户统计、游戏日志和 Redis实时指标获取数据。显示 DAU、新用户、留存率、游戏次数、顶尖玩家。如果可能与 Grafana 仪表盘集成。",
"testStrategy": "Access the admin dashboard with admin credentials. Verify data displayed matches direct database queries. Check if DAU, retention, and game stats are calculated and presented correctly. Test dashboard security.",
"testStrategyTrans": "使用管理员凭据访问管理后台。验证显示的数据是否与直接数据库查询匹配。检查 DAU、留存率和游戏统计数据是否正确计算和呈现。测试后台安全性。"
},
{
"id": 36,
"title": "Spectator Mode",
"titleTrans": "观战模式",
"description": "Allow non-playing users to join active game rooms as spectators, viewing the ongoing match in real-time.",
"descriptionTrans": "允许非玩家用户作为观众加入活跃的游戏房间,实时观看正在进行的比赛。",
"status": "pending",
"dependencies": [
10,
13,
21
],
"priority": "low",
"details": "Backend: Extend WebSocket handling to allow 'spectator' roles. When a spectator joins, send them the current game state snapshot. Broadcast game updates to spectators without allowing them to send game actions. Frontend: Add a 'Spectate' option to rooms or friend profiles. Display the game board and actions without interactive controls. Hide opponent's plane placement until destroyed.",
"detailsTrans": "后端:扩展 WebSocket 处理以允许“观众”角色。当观众加入时,向他们发送当前游戏状态快照。向观众广播游戏更新,但不允许他们发送游戏操作。前端:在房间或好友档案中添加“观战”选项。显示游戏棋盘和操作,但不带交互式控件。在飞机被摧毁之前隐藏对手的飞机布置。",
"testStrategy": "Join an active game as a spectator. Verify real-time updates of game state (attacks, hits, turns). Ensure spectators cannot interact with the game. Test joining/leaving spectator mode. Verify performance with multiple spectators.",
"testStrategyTrans": "作为观众加入一个活跃的游戏。验证游戏状态(攻击、命中、回合)的实时更新。确保观众无法与游戏互动。测试加入/离开观战模式。验证多个观众下的性能。"
},
{
"id": 37,
"title": "H5 Version Adaption",
"titleTrans": "H5版本适配",
"description": "Adapt the mini-program to run as a web (H5) application, ensuring full functionality and responsive design across different browsers and devices.",
"descriptionTrans": "将小程序适配为 Web (H5) 应用程序运行,确保在不同浏览器和设备上具有完整功能和响应式设计。",
"status": "pending",
"dependencies": [
1,
15
],
"priority": "low",
"details": "Leverage Taro's H5 compilation capabilities. Address any platform-specific differences (e.g., WeChat APIs vs. browser APIs for login/sharing). Ensure responsive layout for various screen sizes (desktop, tablet, mobile browser). Test performance on H5.",
"detailsTrans": "利用 Taro 的 H5 编译能力。解决任何平台特定的差异(例如,微信 API 与浏览器 API 用于登录/分享)。确保各种屏幕尺寸(桌面、平板、移动浏览器)的响应式布局。在 H5 上测试性能。",
"testStrategy": "Compile and deploy the H5 version. Test all core functionalities (login, room, game, chat, stats) on different browsers (Chrome, Firefox, Safari) and devices. Verify responsive layout and performance.",
"testStrategyTrans": "编译并部署 H5 版本。在不同浏览器Chrome、Firefox、Safari和设备上测试所有核心功能登录、房间、游戏、聊天、统计。验证响应式布局和性能。"
},
{
"id": 38,
"title": "Internationalization (i18n) Support",
"titleTrans": "国际化 (i18n) 支持",
"description": "Implement internationalization to support multiple languages, starting with English and Chinese.",
"descriptionTrans": "实施国际化以支持多种语言,从英语和中文开始。",
"status": "pending",
"dependencies": [
1,
3
],
"priority": "low",
"details": "Integrate an i18n library (e.g., `react-i18next`). Extract all hardcoded strings from the UI and backend messages into translation files (JSON/YAML). Implement a language switcher in settings. Ensure dynamic content (e.g., user-generated names) is handled correctly.",
"detailsTrans": "集成 i18n 库(例如,`react-i18next`)。将 UI 和后端消息中所有硬编码的字符串提取到翻译文件JSON/YAML中。在设置中实现语言切换器。确保动态内容例如用户生成的名字得到正确处理。",
"testStrategy": "Add English translation files. Switch language in settings and verify all UI text and messages are translated correctly. Test with different locales. Check for text overflow issues with longer translations.",
"testStrategyTrans": "添加英文翻译文件。在设置中切换语言并验证所有 UI 文本和消息是否正确翻译。使用不同的区域设置进行测试。检查较长翻译的文本溢出问题。"
}
],
"metadata": {
"projectName": "打飞机对战小程序",
"totalTasks": 38,
"sourceFile": ".scripts\\PRD.txt",
"generatedAt": "2024-01-20"
}
}