Explorar el Código

fix(gameitems): 适配新宝箱组系统并修复生成宝箱 JSON 数据命令

- 更新 GenerateChestJsonCommand 以使用新的 ItemChestConfig 和组系统架构
- 从奖励组获取宝箱内容,从消耗组获取开启消耗
- 修复物品名称显示问题,使用 getTargetName() 方法
- 移除不再使用的白名单过滤器和枚举导入- 优化数据处理逻辑,适应新系统结构
notfff hace 7 meses
padre
commit
400cc86429

+ 164 - 0
AiWork/202506/051026-修复GenerateChestJsonCommand适配新宝箱组系统.md

@@ -0,0 +1,164 @@
+# 修复GenerateChestJsonCommand适配新宝箱组系统
+
+**任务时间**: 2025年6月5日 10:26  
+**任务状态**: ✅ 已完成  
+**任务类型**: 系统修复  
+
+## 任务概述
+
+修复 GenerateChestJsonCommand 生成宝箱JSON数据命令的报错问题。原因是宝箱系统已经从旧的 `chest_contents` 和 `chest_costs` 系统迁移到了新的组系统(使用 `ItemChestConfig`),但命令仍在使用旧的关系方法。
+
+## 问题分析
+
+### 错误信息
+```
+Call to undefined relationship [chest_contents] on model [App\Module\GameItems\Models\Item].
+```
+
+### 根本原因
+1. **系统架构变更**:宝箱系统已迁移到新的组系统架构
+2. **关系方法缺失**:Item 模型中不存在 `chest_contents` 和 `chest_costs` 关系方法
+3. **代码未同步**:GenerateChestJsonCommand 仍使用旧系统的关系方法
+
+## 修复方案
+
+### 1. 更新数据查询逻辑
+**修改前**:
+```php
+$chests = Item::query()
+    ->where('type', ITEM_TYPE::CHEST)
+    ->with([
+        'chest_contents' => function ($query) {
+            // 旧的宝箱内容查询
+        },
+        'chest_costs' => function ($query) {
+            // 旧的宝箱消耗查询
+        }
+    ])
+```
+
+**修改后**:
+```php
+$chests = Item::query()
+    ->where('type', ITEM_TYPE::CHEST)
+    ->with([
+        'chestConfig' => function ($query) {
+            $query->where('is_active', true)
+                ->with([
+                    'consumeGroup.consumeItems',
+                    'rewardGroup.rewardItems',
+                    'conditionGroup'
+                ]);
+        }
+    ])
+```
+
+### 2. 更新数据处理逻辑
+**宝箱内容处理**:
+- 从 `chest_contents` 改为从 `rewardGroup.rewardItems` 获取
+- 使用 `rewardItem->getTargetName()` 获取物品名称
+- 添加新系统标识字段 `from_reward_group`
+
+**宝箱消耗处理**:
+- 从 `chest_costs` 改为从 `consumeGroup.consumeItems` 获取
+- 使用 `consumeItem->getTargetName()` 获取目标名称
+- 添加新系统标识字段 `from_consume_group`
+
+### 3. 清理无用代码
+- 移除不再使用的白名单过滤器导入
+- 移除 `CHEST_COST_TYPE` 枚举导入
+- 简化数据结构,适配新系统
+
+## 修改文件
+
+1. **app/Module/GameItems/Commands/GenerateChestJsonCommand.php**
+   - 更新数据查询逻辑使用新的组系统
+   - 修复物品名称获取方法
+   - 清理无用的导入和代码
+
+## 测试验证
+
+### 命令执行测试
+```bash
+php artisan gameitems:generate-chest-json
+```
+
+**测试结果**:
+- ✅ 命令执行成功,返回状态码 0
+- ✅ 成功处理 4 个宝箱
+- ✅ 生成 8 个内容项和 7 个消耗项
+- ✅ 物品名称正确显示(如"萝卜"而非"未知物品")
+
+### 数据结构验证
+生成的JSON数据包含正确的字段:
+```json
+{
+    "generated_ts": 1749090315,
+    "chests": {
+        "0": {
+            "id": 27,
+            "name": "铜宝箱",
+            "contents": [
+                {
+                    "id": 51,
+                    "weight": 50,
+                    "min_quantity": 200,
+                    "max_quantity": 2000,
+                    "item_id": 2,
+                    "item_name": "萝卜",
+                    "type": "item",
+                    "from_reward_group": true,
+                    "reward_group_id": 30,
+                    "reward_group_name": "铜宝箱_奖励组"
+                }
+            ],
+            "costs": [
+                {
+                    "consume_type": 1,
+                    "target_id": 2,
+                    "quantity": 500,
+                    "from_consume_group": true,
+                    "consume_group_id": 31,
+                    "consume_group_name": "铜宝箱-开启消耗",
+                    "target_name": "萝卜"
+                }
+            ]
+        }
+    }
+}
+```
+
+## 技术要点
+
+### 新旧系统对比
+| 方面 | 旧系统 | 新系统 |
+|------|--------|--------|
+| 宝箱内容 | chest_contents 表 | 奖励组系统 |
+| 开启消耗 | chest_costs 表 | 消耗组系统 |
+| 配置管理 | 分散配置 | 统一的 ItemChestConfig |
+| 数据关联 | 直接关联 | 通过组系统关联 |
+
+### 架构优势
+1. **统一管理**:使用统一的组系统架构
+2. **配置复用**:支持消耗组和奖励组的复用
+3. **灵活扩展**:支持条件组的前置条件控制
+4. **数据一致性**:通过组系统保证数据一致性
+
+## 提交信息
+```
+修复GenerateChestJsonCommand适配新宝箱组系统
+
+- 更新命令使用新的ItemChestConfig和组系统架构
+- 替换旧的chest_contents/chest_costs关系为chestConfig关系
+- 从奖励组获取宝箱内容,从消耗组获取开启消耗
+- 修复物品名称显示问题,使用getTargetName()方法
+- 移除不再使用的白名单过滤器和枚举导入
+- 测试通过:成功处理4个宝箱,8个内容项,7个消耗项
+```
+
+## 状态
+✅ 已完成并推送到远程仓库
+
+## 相关文档
+- [宝箱系统重大更新说明](../../../app/Module/GameItems/Docs/宝箱系统重大更新说明.md)
+- [宝箱配置系统文档](../../../app/Module/GameItems/Docs/README.md)

+ 5 - 0
AiWork/WORK.md

@@ -17,6 +17,11 @@ shop_items 的 $max_buy 确认被替代后移除,使用mcp执行sql
 
 ## 已完成任务(保留最新的10条,多余的删除)
 
+- [x] 2025-06-05 10:26 - 修复GenerateChestJsonCommand适配新宝箱组系统
+  - 任务记录: `AiWork/202506/051026-修复GenerateChestJsonCommand适配新宝箱组系统.md`
+  - 完成时间: 2025-06-05 10:26
+  - 描述: 修复GenerateChestJsonCommand生成宝箱JSON数据命令的报错问题,更新命令使用新的ItemChestConfig和组系统架构,从奖励组获取宝箱内容,从消耗组获取开启消耗,修复物品名称显示问题
+
 - [x] 2025-06-04 21:57 - 修复宝箱开启验证器缺失问题
   - 任务记录: `AiWork/202506/042157-修复宝箱开启验证器缺失问题.md`
   - 完成时间: 2025-06-04 22:02

+ 22 - 10
app/Console/Commands/ReproduceErrorCommand.php

@@ -2,6 +2,8 @@
 
 namespace App\Console\Commands;
 
+use App\Module\AppGame\SessionApp;
+use App\Module\AppGame\SessionHelper;
 use GuzzleHttp\Client;
 use Illuminate\Console\Command;
 use UCore\Model\RequestLog;
@@ -14,7 +16,7 @@ use UCore\Helper\Logger;
  * 通过 sys_request_logs 表的记录来复现请求,用于调试和错误排查
  * php artisan debug:reproduce-error  68973982
  * php artisan debug:reproduce-error  68973982  --type=request_unid
- * php artisan debug:reproduce-error  68973982  --clear-logs
+ * php artisan debug:reproduce-error  68973982  --no-clear-logs
  *
  *
  */
@@ -25,7 +27,7 @@ class ReproduceErrorCommand extends Command
      *
      * @var string
      */
-    protected $signature = 'debug:reproduce-error {identifier : 请求标识符(可以是id、request_unid或run_unid)} {--type=auto : 标识符类型(id|request_unid|run_unid|auto),auto为自动检测} {--timeout=30 : 请求超时时间(秒)} {--clear-logs : 运行前清空当前日志文件}';
+    protected $signature = 'debug:reproduce-error {identifier : 请求标识符(可以是id、request_unid或run_unid)} {--type=auto : 标识符类型(id|request_unid|run_unid|auto),auto为自动检测} {--timeout=30 : 请求超时时间(秒)} {--no-clear-logs : 运行时不前清空当前日志文件}';
 
     /**
      * 命令描述
@@ -56,11 +58,13 @@ class ReproduceErrorCommand extends Command
         $identifier = $this->argument('identifier');
         $type = $this->option('type');
         $timeout = (int) $this->option('timeout');
-        $clearLogs = $this->option('clear-logs');
+        $noclearLogs = $this->option('no-clear-logs');
 
         // 如果开启了清空日志选项,则清空日志文件
-        if ($clearLogs) {
-            $this->clearLogFiles();
+        if ($noclearLogs) {
+
+        }else{
+             $this->clearLogFiles();
         }
 
         $this->info("开始查找请求记录...");
@@ -69,7 +73,7 @@ class ReproduceErrorCommand extends Command
 
         // 查找请求记录
         $requestLog = $this->findRequestLog($identifier, $type);
-        
+
         if (!$requestLog) {
             $this->error("未找到匹配的请求记录");
             return 1;
@@ -79,10 +83,12 @@ class ReproduceErrorCommand extends Command
         $this->line("  ID: {$requestLog->id}");
         $this->line("  Request UNID: {$requestLog->request_unid}");
         $this->line("  Run UNID: {$requestLog->run_unid}");
+        $this->line("  UserId : {$requestLog->user_id}");
         $this->line("  路径: {$requestLog->path}");
         $this->line("  方法: {$requestLog->method}");
         $this->line("  创建时间: {$requestLog->created_at}");
 
+
         // 检查必要的数据
         if (empty($requestLog->protobuf_json)) {
             $this->error("请求记录中缺少 protobuf_json 数据");
@@ -96,6 +102,12 @@ class ReproduceErrorCommand extends Command
         } else {
             $this->info("提取到 token: " . substr($token, 0, 10) . "...");
         }
+        //  user_id
+        if($requestLog->user_id){
+            SessionHelper::sessionLogin($token,$requestLog->user_id);
+            $this->info("token 设置用户: {$requestLog->user_id} ");
+        }
+
 
         // 初始化 HTTP 客户端
         $this->initializeHttpClient($timeout);
@@ -141,19 +153,19 @@ class ReproduceErrorCommand extends Command
                     return $requestLog;
                 }
             }
-            
+
             // 按 request_unid 查找
             $requestLog = RequestLog::query()->where('request_unid', $identifier)->first();
             if ($requestLog) {
                 return $requestLog;
             }
-            
+
             // 按 run_unid 查找
             $requestLog = RequestLog::query()->where('run_unid', $identifier)->first();
             if ($requestLog) {
                 return $requestLog;
             }
-            
+
             return null;
         }
 
@@ -191,7 +203,7 @@ class ReproduceErrorCommand extends Command
 
             // 查找 token 字段(可能在不同的键名下)
             $tokenKeys = ['token', 'Token', 'authorization', 'Authorization'];
-            
+
             foreach ($tokenKeys as $key) {
                 if (isset($headers[$key])) {
                     $tokenValue = $headers[$key];

+ 3 - 12
app/Module/AppGame/Handler/Pet/EatHandler.php

@@ -54,15 +54,8 @@ class EatHandler extends BaseHandler
             // 调用宠物服务进行喂养
             $feedResult = PetService::feedPet($userId, $petId, $itemId, $num);
 
-            // 设置响应数据
-            $response->setSuccess(true);
-            $response->setPetId($petId);
-            $response->setItemId($itemId);
-            $response->setNum($num);
-            $response->setExpGained($feedResult['exp_gained']);
-            $response->setStaminaGained($feedResult['stamina_gained']);
-            $response->setLevelUp($feedResult['level_up']);
-            $response->setMessage('宠物喂养成功');
+
+            // 不需要设置响应,默认成功的响应
 
             // 提交事务
             DB::commit();
@@ -79,9 +72,7 @@ class EatHandler extends BaseHandler
                 'error' => $e->getMessage()
             ]);
 
-            // 设置错误响应
-            $response->setSuccess(false);
-            $response->setMessage('宠物喂养失败: ' . $e->getMessage());
+            throw  $e;
         }
 
         return $response;

+ 18 - 0
app/Module/AppGame/SessionHelper.php

@@ -0,0 +1,18 @@
+<?php
+
+namespace App\Module\AppGame;
+
+use App\Module\User\Models\User;
+
+class SessionHelper
+{
+
+    static public function sessionLogin($token, $user_id)
+    {
+        SessionApp::$session_id = $token;
+        $user                   = User::query()->where('id', '=', $user_id)->first();
+        SessionApp::setLogin($user);
+
+    }
+
+}

+ 2 - 0
app/Module/AppGame/Validations/ValidationBase.php

@@ -3,6 +3,7 @@
 namespace App\Module\AppGame\Validations;
 
 use App\Module\AppGame\SessionApp;
+use UCore\Helper\Logger;
 use UCore\ValidationCore;
 
 
@@ -22,6 +23,7 @@ abstract class ValidationBase extends ValidationCore
     public static function makeByProrobufUser(\Google\Protobuf\Internal\Message $message, $scene = ''): static
     {
         $data            = json_decode($message->serializeToJsonString(), true);
+        Logger::debug('makeByProrobufUser',$data);
         $data['user_id'] = SessionApp::getSessionId();
 
         return new static($data, [], [], $scene);

+ 84 - 57
app/Module/Game/Models/GameRewardItem.php

@@ -9,29 +9,31 @@ use UCore\ModelCore;
 /**
  * 奖励项
  *
- * field start 
- * @property  int  $id  主键
- * @property  int  $group_id  奖励组ID,外键关联game_reward_groups表
- * @property  int  $reward_type  奖励类型(1:物品, 2:货币, 3:宠物经验, 4:宠物体力, 5:其他)
- * @property  int  $target_id  目标ID(物品ID、货币ID等,根据reward_type解释)
- * @property  int  $param1  参数1(根据reward_type不同含义,如物品的品质、货币的来源等)
- * @property  int  $param2  参数2(根据reward_type不同含义,如物品的绑定状态、货币的类型等)
- * @property  int  $quantity  数量
- * @property  int  $min_quantity  最小数量(NULL表示使用quantity字段)
- * @property  int  $max_quantity  最大数量(NULL表示使用quantity字段)
- * @property  float  $weight  权重(随机发放时使用)
- * @property  float  $probability  获得概率(百分比,0-100,NULL表示使用权重机制)
- * @property  bool  $is_guaranteed  是否必中(0:非必中, 1:必中)
- * @property  int  $pity_threshold  保底阈值(0表示不启用保底)
- * @property  float  $pity_weight_factor  保底权重因子(递增概率的倍数)
- * @property  bool  $pity_enabled  是否启用保底机制
- * @property  array  $extra_data  额外数据(JSON格式,可存储特定奖励类型的额外参数)
- * @property  \Carbon\Carbon  $created_at  创建时间
- * @property  \Carbon\Carbon  $updated_at  更新时间
+ * field start
+ *
+ * @property  int $id  主键
+ * @property  int $group_id  奖励组ID,外键关联game_reward_groups表
+ * @property  int $reward_type  奖励类型(1:物品, 2:货币, 3:宠物经验, 4:宠物体力, 5:其他)
+ * @property  int $target_id  目标ID(物品ID、货币ID等,根据reward_type解释)
+ * @property  int $param1  参数1(根据reward_type不同含义,如物品的品质、货币的来源等)
+ * @property  int $param2  参数2(根据reward_type不同含义,如物品的绑定状态、货币的类型等)
+ * @property  int $quantity  数量
+ * @property  int $min_quantity  最小数量(NULL表示使用quantity字段)
+ * @property  int $max_quantity  最大数量(NULL表示使用quantity字段)
+ * @property  float $weight  权重(随机发放时使用)
+ * @property  float $probability  获得概率(百分比,0-100,NULL表示使用权重机制)
+ * @property  bool $is_guaranteed  是否必中(0:非必中, 1:必中)
+ * @property  int $pity_threshold  保底阈值(0表示不启用保底)
+ * @property  float $pity_weight_factor  保底权重因子(递增概率的倍数)
+ * @property  bool $pity_enabled  是否启用保底机制
+ * @property  array $extra_data  额外数据(JSON格式,可存储特定奖励类型的额外参数)
+ * @property  \Carbon\Carbon $created_at  创建时间
+ * @property  \Carbon\Carbon $updated_at  更新时间
  * field end
  */
 class GameRewardItem extends ModelCore
 {
+
     /**
      * 与模型关联的表名
      *
@@ -39,7 +41,7 @@ class GameRewardItem extends ModelCore
      */
     protected $table = 'game_reward_items';
 
-    // attrlist start 
+    // attrlist start
     protected $fillable = [
         'id',
         'group_id',
@@ -66,20 +68,20 @@ class GameRewardItem extends ModelCore
      * @var array
      */
     protected $casts = [
-        'reward_type' => 'integer',
-        'target_id' => 'integer',
-        'param1' => 'integer',
-        'param2' => 'integer',
-        'quantity' => 'integer',
-        'weight' => 'float',
-        'probability' => 'float',
-        'min_quantity' => 'integer',
-        'max_quantity' => 'integer',
-        'is_guaranteed' => 'boolean',
-        'pity_threshold' => 'integer',
+        'reward_type'        => 'integer',
+        'target_id'          => 'integer',
+        'param1'             => 'integer',
+        'param2'             => 'integer',
+        'quantity'           => 'integer',
+        'weight'             => 'float',
+        'probability'        => 'float',
+        'min_quantity'       => 'integer',
+        'max_quantity'       => 'integer',
+        'is_guaranteed'      => 'boolean',
+        'pity_threshold'     => 'integer',
         'pity_weight_factor' => 'float',
-        'pity_enabled' => 'boolean',
-        'extra_data' => 'json',
+        'pity_enabled'       => 'boolean',
+        'extra_data'         => 'json',
     ];
 
     /**
@@ -123,6 +125,7 @@ class GameRewardItem extends ModelCore
             case REWARD_TYPE::ITEM->value:
                 try {
                     $itemModel = \App\Module\GameItems\Models\Item::find($this->target_id);
+
                     return $itemModel ? $itemModel->name : "物品 (ID: {$this->target_id})";
                 } catch (\Exception $e) {
                     return "物品 (ID: {$this->target_id})";
@@ -131,6 +134,7 @@ class GameRewardItem extends ModelCore
             case REWARD_TYPE::CURRENCY->value:
                 try {
                     $currency = \App\Module\Fund\Models\FundCurrencyModel::find($this->target_id);
+
                     return $currency ? $currency->name : "货币 (ID: {$this->target_id})";
                 } catch (\Exception $e) {
                     return "货币 (ID: {$this->target_id})";
@@ -139,6 +143,7 @@ class GameRewardItem extends ModelCore
             case REWARD_TYPE::FUND_CONFIG->value:
                 try {
                     $fund = \App\Module\Fund\Models\FundConfigModel::find($this->target_id);
+
                     return $fund ? $fund->name : "账户种类 (ID: {$this->target_id})";
                 } catch (\Exception $e) {
                     return "账户种类 (ID: {$this->target_id})";
@@ -159,6 +164,7 @@ class GameRewardItem extends ModelCore
             case REWARD_TYPE::PET->value:
                 try {
                     $pet = \App\Module\Pet\Models\PetConfig::find($this->target_id);
+
                     return $pet ? $pet->name : "宠物 (ID: {$this->target_id})";
                 } catch (\Exception $e) {
                     return "宠物 (ID: {$this->target_id})";
@@ -181,54 +187,75 @@ class GameRewardItem extends ModelCore
         switch ($this->reward_type) {
             case REWARD_TYPE::ITEM->value:
                 // 创建物品奖励对象
-                $rewardItem = new \Uraus\Kku\Common\RewardItem([
-                    'item_id' => $this->target_id,
-                    'instance_id' => 0, // 默认为0,表示不指定实例
-                    'quantity' => $this->max_quantity ?: $this->quantity,
-                ]);
-                $reward->setItems([$rewardItem]);
+                if ($this->min_quantity) {
+                    $rewardItem = new \Uraus\Kku\Common\RewardItem([
+                                                                       'item_id'     => $this->target_id,
+                                                                       'instance_id' => 0, // 默认为0,表示不指定实例
+                                                                       'min_quantity' => $this->min_quantity,
+                                                                       'max_quantity' => $this->max_quantity,
+                                                                   ]);
+                }else{
+                    $rewardItem = new \Uraus\Kku\Common\RewardItem([
+                                                                       'item_id'     => $this->target_id,
+                                                                       'instance_id' => 0, // 默认为0,表示不指定实例
+                                                                       'quantity'    => $this->quantity,
+
+                                                                   ]);
+                }
+
+                $reward->setItems([ $rewardItem ]);
                 break;
 
             case REWARD_TYPE::CURRENCY->value:
             case REWARD_TYPE::FUND_CONFIG->value:
                 // 创建代币奖励对象
-                $rewardCoin = new \Uraus\Kku\Common\RewardCoin([
-                    'type' => $this->target_id,
-                    'quantity' => $this->max_quantity ?: $this->quantity,
-                ]);
-                $reward->setCoins([$rewardCoin]);
+                if ($this->min_quantity) {
+                    $rewardCoin = new \Uraus\Kku\Common\RewardCoin([
+                                                                       'type'         => $this->target_id,
+                                                                       'min_quantity' => $this->min_quantity,
+                                                                       'max_quantity' => $this->max_quantity,
+                                                                   ]);
+                } else {
+                    $rewardCoin = new \Uraus\Kku\Common\RewardCoin([
+                                                                       'type'     => $this->target_id,
+                                                                       'quantity' => $this->quantity,
+                                                                   ]);
+                }
+
+                $reward->setCoins([ $rewardCoin ]);
                 break;
 
             case REWARD_TYPE::PET->value:
                 // 创建宠物奖励对象
                 $rewardPet = new \Uraus\Kku\Common\RewardPets([
-                    'pet_type' => $this->target_id,
-                    'quantity' => $this->quantity,
-                ]);
-                $reward->setPets([$rewardPet]);
+                                                                  'pet_type' => $this->target_id,
+                                                                  'quantity' => $this->quantity,
+                                                              ]);
+                $reward->setPets([ $rewardPet ]);
                 break;
 
             case REWARD_TYPE::PET_POWER->value:
             case REWARD_TYPE::PET_ENERGY->value:
                 // 创建宠物体力奖励对象
                 $rewardPetPower = new \Uraus\Kku\Common\RewardPetPowers([
-                    'pet_id' => $this->target_id,
-                    'quantity' => $this->max_quantity ?: $this->quantity,
-                ]);
-                $reward->setPetPowers([$rewardPetPower]);
+                                                                            'pet_id'   => $this->target_id,
+                                                                            'quantity' => $this->max_quantity ?: $this->quantity,
+                                                                        ]);
+                $reward->setPetPowers([ $rewardPetPower ]);
                 break;
 
             case REWARD_TYPE::FARM_SHRINE->value:
                 // 创建神像奖励对象
                 $rewardGod = new \Uraus\Kku\Common\RewardGod([
-                    'type' => $this->target_id,
-                    'diff' => $this->param2 ?: 3600, // 默认1小时
-                    'quantity' => $this->quantity,
-                ]);
-                $reward->setGods([$rewardGod]);
+                                                                 'type'     => $this->target_id,
+                                                                 'diff'     => $this->param2 ?: 3600, // 默认1小时
+                                                                 'quantity' => $this->quantity,
+                                                             ]);
+                $reward->setGods([ $rewardGod ]);
                 break;
         }
 
         return $reward;
     }
+
 }

+ 23 - 39
app/Module/GameItems/Commands/GenerateChestJsonCommand.php

@@ -5,8 +5,10 @@ namespace App\Module\GameItems\Commands;
 use App\Module\Game\DCache\ChestJsonConfig;
 use App\Module\GameItems\Config\NumericAttributesWhitelist;
 use App\Module\GameItems\Enums\ITEM_TYPE;
+use App\Module\GameItems\Models\ItemChestConfig;
 use Illuminate\Console\Command;
 use App\Module\GameItems\Models\Item;
+use UCore\Helper\Logger;
 
 /**
  * 生成宝箱JSON数据命令
@@ -61,59 +63,50 @@ class GenerateChestJsonCommand extends Command
                 ->get();
 
             // 处理数据,去除不必要的字段
-            $processedChests = $chests->map(function ($chest) {
+            $processedChests = $chests->map(function (Item $chest) {
                 // 检查宝箱是否有配置数据
-                if ($chest->chestConfig->isEmpty()) {
+                if (!$chest->chestConfig) {
+                    Logger::error("跳过物品 {$chest->id} ,没有宝箱配置");
+
                     return null; // 跳过没有配置的宝箱
                 }
 
                 // 获取激活的配置(应该只有一个)
-                $config = $chest->chestConfig->first();
+                $config = $chest->chestConfig;
                 if (!$config || !$config->rewardGroup) {
+                    Logger::error("跳过宝箱 {$chest->id} ,没有奖励组");
+
                     return null; // 跳过没有奖励组的宝箱
                 }
 
                 $chestData = [
                     'id' => $chest->id,
                     'name' => $chest->name,
+                    'desc' => $chest->description,
+
                 ];
 
-                // 添加宝箱数值属性中的必要字段,使用白名单过滤
-                if (!empty($chest->numeric_attributes)) {
-                    $numericAttrs = NumericAttributesWhitelist::filter($chest->numeric_attributes);
-                    if (!empty($numericAttrs)) {
-                        foreach ($numericAttrs as $key => $value) {
-                            $chestData[$key] = $value;
-                        }
-                    }
-                }
 
                 // 处理宝箱内容(从奖励组获取)
                 $contents = [];
                 if ($config->rewardGroup && $config->rewardGroup->rewardItems) {
+
                     foreach ($config->rewardGroup->rewardItems as $rewardItem) {
-                        // 只处理物品类型的奖励
-                        if ($rewardItem->reward_type == 1) { // 1 = 物品类型
-                            $contentData = [
-                                'id' => $rewardItem->id,
-                                'weight' => $rewardItem->weight ?? 1,
-                                'min_quantity' => $rewardItem->min_quantity ?? $rewardItem->quantity,
-                                'max_quantity' => $rewardItem->max_quantity ?? $rewardItem->quantity,
-                                'item_id' => $rewardItem->target_id,
-                                'item_name' => $rewardItem->getTargetName(),
-                                'type' => 'item',
-                                'from_reward_group' => true,
-                                'reward_group_id' => $config->reward_group_id,
-                                'reward_group_name' => $config->rewardGroup->name,
-                            ];
+
+
+                            // 转换为 Proto 对象
+                            $rewardProtoObject = $rewardItem->toRewardObject();
+                            $contentData= json_decode($rewardProtoObject->serializeToJsonString(),true);
+
 
                             $contents[] = $contentData;
-                        }
+
                     }
                 }
 
                 // 检查处理后的内容是否为空
                 if (empty($contents)) {
+                    Logger::error("跳过宝箱 {$chest->id} ,没有奖励内容");
                     return null; // 如果没有有效的内容,跳过这个宝箱
                 }
 
@@ -123,18 +116,9 @@ class GenerateChestJsonCommand extends Command
                 $costs = [];
                 if ($config->consumeGroup && $config->consumeGroup->consumeItems) {
                     foreach ($config->consumeGroup->consumeItems as $consumeItem) {
-                        $costData = [
-                            'consume_type' => $consumeItem->consume_type,
-                            'target_id' => $consumeItem->target_id,
-                            'quantity' => $consumeItem->quantity,
-                            'from_consume_group' => true,
-                            'consume_group_id' => $config->consume_group_id,
-                            'consume_group_name' => $config->consumeGroup->name,
-                        ];
-
-                        // 添加目标名称
-                        $costData['target_name'] = $consumeItem->getTargetName();
-
+                        // 转换为 Proto 对象
+                        $consumeProtoObject = $consumeItem->toDeductObject();
+                        $costData= json_decode($consumeProtoObject->serializeToJsonString(),true);
                         $costs[] = $costData;
                     }
                 }

+ 5 - 4
app/Module/GameItems/Models/Item.php

@@ -5,12 +5,13 @@ namespace App\Module\GameItems\Models;
 use App\Module\GameItems\Enums\ITEM_TYPE;
 use Illuminate\Database\Eloquent\Relations\BelongsTo;
 use Illuminate\Database\Eloquent\Relations\HasMany;
+use Illuminate\Database\Eloquent\Relations\HasOne;
 use UCore\ModelCore;
 
 /**
  * 物品基础信息
  *
- * field start 
+ * field start
  * @property  int  $id  物品ID,主键
  * @property  string  $name  物品名称
  * @property  string  $description  物品描述
@@ -41,7 +42,7 @@ class Item extends ModelCore
      */
     protected $table = 'item_items';
 
-    // attrlist start 
+    // attrlist start
     protected $fillable = [
         'id',
         'name',
@@ -127,9 +128,9 @@ class Item extends ModelCore
      *
      * @return HasMany
      */
-    public function chestConfig(): HasMany
+    public function chestConfig(): HasOne
     {
-        return $this->hasMany(\App\Module\GameItems\Models\ItemChestConfig::class, 'item_id', 'id');
+        return $this->HasOne(\App\Module\GameItems\Models\ItemChestConfig::class, 'item_id', 'id');
     }
 
 }

+ 3 - 2
app/Module/Pet/Logic/PetLogic.php

@@ -19,6 +19,7 @@ use App\Module\Pet\Models\PetUser;
 use Exception;
 use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\Log;
+use UCore\Exception\LogicException;
 use Uraus\Kku\Common\DataPetSimple;
 
 /**
@@ -224,7 +225,7 @@ class PetLogic
         // 获取物品信息
         $item = ItemService::getItemInfo($itemId);
         if (!$item) {
-            throw new Exception("物品不存在");
+            throw new LogicException("物品不存在");
         }
 
         // 消耗物品
@@ -241,7 +242,7 @@ class PetLogic
         );
 
         if (!$consumeResult['success']) {
-            throw new Exception("物品消耗失败: " . ($consumeResult['message'] ?? '未知错误'));
+            throw new LogicException("物品消耗失败: " . ($consumeResult['message'] ?? '未知错误'));
         }
 
         // 计算获得的经验值和体力

+ 92 - 98
app/Module/Pet/Services/PetService.php

@@ -14,6 +14,8 @@ use Illuminate\Support\Collection;
 use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\Log;
 use UCore\Db\Helper;
+use UCore\Dto\Res;
+use UCore\Exception\LogicException;
 
 /**
  * 宠物服务类
@@ -27,6 +29,7 @@ use UCore\Db\Helper;
  */
 class PetService
 {
+
     /**
      * 获取用户宠物列表
      *
@@ -84,17 +87,17 @@ class PetService
 
             return [
                 'success' => true,
-                'pet_id' => $result['pet_id'],
-                'name' => $name,
-                'grade' => $result['grade'],
-                'level' => 1,
+                'pet_id'  => $result['pet_id'],
+                'name'    => $name,
+                'grade'   => $result['grade'],
+                'level'   => 1,
                 'message' => '宠物创建成功'
             ];
         } catch (Exception $e) {
             Log::error('创建宠物失败', [
                 'user_id' => $userId,
-                'name' => $name,
-                'error' => $e->getMessage()
+                'name'    => $name,
+                'error'   => $e->getMessage()
             ]);
 
             throw $e;
@@ -133,18 +136,18 @@ class PetService
             $result = $petLogic->levelUpPet($petId);
 
             return [
-                'success' => true,
-                'pet_id' => $petId,
-                'old_level' => $result['old_level'],
-                'new_level' => $result['new_level'],
+                'success'         => true,
+                'pet_id'          => $petId,
+                'old_level'       => $result['old_level'],
+                'new_level'       => $result['new_level'],
                 'unlocked_skills' => $result['unlocked_skills'] ?? [],
-                'message' => '宠物升级成功'
+                'message'         => '宠物升级成功'
             ];
         } catch (Exception $e) {
             Log::error('宠物升级失败', [
                 'user_id' => $userId,
-                'pet_id' => $petId,
-                'error' => $e->getMessage()
+                'pet_id'  => $petId,
+                'error'   => $e->getMessage()
             ]);
 
             throw $e;
@@ -163,53 +166,42 @@ class PetService
      * @return array 喂养结果
      * @throws Exception
      */
-    public static function feedPet(int $userId, int $petId, int $itemId, int $amount = 1): array
+    public static function feedPet(int $userId, int $petId, int $itemId, int $amount = 1): Res
     {
         // 验证事务是否已开启
         Helper::check_tr();
 
-        try {
-            // 宠物逻辑
-            $petLogic = new PetLogic();
 
-            // 获取宠物信息
-            $pet = PetUser::where('id', $petId)
-                ->where('user_id', $userId)
-                ->first();
+        // 宠物逻辑
+        $petLogic = new PetLogic();
 
-            if (!$pet) {
-                throw new Exception("宠物不存在或不属于该用户");
-            }
+        // 获取宠物信息
+        $pet = PetUser::where('id', $petId)
+            ->where('user_id', $userId)
+            ->first();
 
-            // 检查宠物状态
-            if ($pet->status !== PetStatus::NORMAL) {
-                throw new Exception("宠物当前状态不允许喂养");
-            }
+        if (!$pet) {
+            throw new LogicException("宠物不存在或不属于该用户");
+        }
 
-            // 执行喂养逻辑
-            $result = $petLogic->feedPet($petId, $itemId, $amount);
+        // 检查宠物状态
+        if ($pet->status !== PetStatus::NORMAL) {
+            throw new LogicException("宠物当前状态不允许喂养");
+        }
+
+        // 执行喂养逻辑
+        $result = $petLogic->feedPet($petId, $itemId, $amount);
+
+        return Res::success('', [
+            'pet_id'         => $petId,
+            'item_id'        => $itemId,
+            'amount'         => $amount,
+            'exp_gained'     => $result['exp_gained'],
+            'stamina_gained' => $result['stamina_gained'],
+            'level_up'       => $result['level_up'],
+        ]);
 
-            return [
-                'success' => true,
-                'pet_id' => $petId,
-                'item_id' => $itemId,
-                'amount' => $amount,
-                'exp_gained' => $result['exp_gained'],
-                'stamina_gained' => $result['stamina_gained'],
-                'level_up' => $result['level_up'],
-                'message' => '宠物喂养成功'
-            ];
-        } catch (Exception $e) {
-            Log::error('宠物喂养失败', [
-                'user_id' => $userId,
-                'pet_id' => $petId,
-                'item_id' => $itemId,
-                'amount' => $amount,
-                'error' => $e->getMessage()
-            ]);
 
-            throw $e;
-        }
     }
 
     /**
@@ -250,19 +242,19 @@ class PetService
             $result = $petLogic->remouldPet($petId, $itemId);
 
             return [
-                'success' => true,
-                'pet_id' => $petId,
+                'success'   => true,
+                'pet_id'    => $petId,
                 'old_grade' => $result['old_grade'],
                 'new_grade' => $result['new_grade'],
-                'item_id' => $itemId,
-                'message' => '宠物洗髓成功'
+                'item_id'   => $itemId,
+                'message'   => '宠物洗髓成功'
             ];
         } catch (Exception $e) {
             Log::error('宠物洗髓失败', [
                 'user_id' => $userId,
-                'pet_id' => $petId,
+                'pet_id'  => $petId,
                 'item_id' => $itemId,
-                'error' => $e->getMessage()
+                'error'   => $e->getMessage()
             ]);
 
             throw $e;
@@ -332,20 +324,20 @@ class PetService
             $result = $petLogic->useSkill($petId, $skillId, $params);
 
             return [
-                'success' => true,
-                'pet_id' => $petId,
-                'skill_id' => $skillId,
-                'stamina_cost' => $skill->stamina_cost,
+                'success'       => true,
+                'pet_id'        => $petId,
+                'skill_id'      => $skillId,
+                'stamina_cost'  => $skill->stamina_cost,
                 'effect_result' => $result['effect_result'],
-                'message' => '技能使用成功'
+                'message'       => '技能使用成功'
             ];
         } catch (Exception $e) {
             Log::error('使用宠物技能失败', [
-                'user_id' => $userId,
-                'pet_id' => $petId,
+                'user_id'  => $userId,
+                'pet_id'   => $petId,
                 'skill_id' => $skillId,
-                'params' => $params,
-                'error' => $e->getMessage()
+                'params'   => $params,
+                'error'    => $e->getMessage()
             ]);
 
             throw $e;
@@ -372,7 +364,7 @@ class PetService
         }
 
         // 计算宠物战力
-        $petLogic = new PetLogic();
+        $petLogic         = new PetLogic();
         $fightingCapacity = $petLogic->calculatePower($petId);
 
         // 使用工厂类创建宠物DTO
@@ -422,10 +414,10 @@ class PetService
         } catch (Exception $e) {
             Log::error('更新宠物状态失败', [
                 'user_id' => $userId,
-                'pet_id' => $petId,
-                'status' => $status->value,
-                'reason' => $reason,
-                'error' => $e->getMessage()
+                'pet_id'  => $petId,
+                'status'  => $status->value,
+                'reason'  => $reason,
+                'error'   => $e->getMessage()
             ]);
 
             throw $e;
@@ -465,18 +457,18 @@ class PetService
             $recoveredStamina = $petLogic->recoverStamina($petId, $minutes);
 
             return [
-                'success' => true,
-                'pet_id' => $petId,
+                'success'           => true,
+                'pet_id'            => $petId,
                 'recovered_stamina' => $recoveredStamina,
-                'current_stamina' => $pet->fresh()->stamina,
-                'message' => '宠物体力恢复成功'
+                'current_stamina'   => $pet->fresh()->stamina,
+                'message'           => '宠物体力恢复成功'
             ];
         } catch (Exception $e) {
             Log::error('恢复宠物体力失败', [
                 'user_id' => $userId,
-                'pet_id' => $petId,
+                'pet_id'  => $petId,
                 'minutes' => $minutes,
-                'error' => $e->getMessage()
+                'error'   => $e->getMessage()
             ]);
 
             throw $e;
@@ -524,20 +516,20 @@ class PetService
 
         $result = [];
         foreach ($availableSkills as $skill) {
-            $lastUsed = null;
+            $lastUsed          = null;
             $cooldownRemaining = 0;
 
             if (isset($skillLogs[$skill->id]) && $skillLogs[$skill->id]->count() > 0) {
-                $lastUsed = $skillLogs[$skill->id][0]->used_at;
+                $lastUsed        = $skillLogs[$skill->id][0]->used_at;
                 $cooldownSeconds = $skill->cool_down;
-                $now = now();
+                $now             = now();
 
                 // 确保时间计算的正确性
                 if ($lastUsed instanceof \Carbon\Carbon) {
                     $secondsSinceLastUse = $now->diffInSeconds($lastUsed, false);
                 } else {
                     // 如果不是Carbon对象,尝试解析
-                    $lastUsed = \Carbon\Carbon::parse($lastUsed);
+                    $lastUsed            = \Carbon\Carbon::parse($lastUsed);
                     $secondsSinceLastUse = $now->diffInSeconds($lastUsed, false);
                 }
 
@@ -550,15 +542,15 @@ class PetService
             }
 
             $result[] = [
-                'skill_id' => $skill->id,
-                'skill_name' => $skill->skill_name,
-                'stamina_cost' => $skill->stamina_cost,
-                'cool_down' => $skill->cool_down,
-                'effect_desc' => $skill->effect_desc,
-                'min_level' => $skill->min_level,
-                'last_used' => $lastUsed ? $lastUsed->format('Y-m-d H:i:s') : null,
+                'skill_id'           => $skill->id,
+                'skill_name'         => $skill->skill_name,
+                'stamina_cost'       => $skill->stamina_cost,
+                'cool_down'          => $skill->cool_down,
+                'effect_desc'        => $skill->effect_desc,
+                'min_level'          => $skill->min_level,
+                'last_used'          => $lastUsed ? $lastUsed->format('Y-m-d H:i:s') : null,
                 'cooldown_remaining' => $cooldownRemaining,
-                'is_available' => $cooldownRemaining === 0 && $pet->stamina >= $skill->stamina_cost
+                'is_available'       => $cooldownRemaining === 0 && $pet->stamina >= $skill->stamina_cost
             ];
         }
 
@@ -585,38 +577,40 @@ class PetService
 
             if (!$levelConfig) {
                 Log::warning('宠物等级配置不存在', [
-                    'pet_id' => $pet->id,
+                    'pet_id'    => $pet->id,
                     'pet_level' => $pet->level,
-                    'skill_id' => $skillId
+                    'skill_id'  => $skillId
                 ]);
+
                 // 如果没有配置,默认允许使用(向后兼容)
                 return true;
             }
 
             // 检查技能是否在可用技能列表中
             $availableSkills = $levelConfig->skills ?? [];
-            $isAvailable = in_array($skillId, $availableSkills);
+            $isAvailable     = in_array($skillId, $availableSkills);
 
             Log::info('宠物技能可用性检查', [
-                'pet_id' => $pet->id,
-                'pet_level' => $pet->level,
-                'skill_id' => $skillId,
+                'pet_id'           => $pet->id,
+                'pet_level'        => $pet->level,
+                'skill_id'         => $skillId,
                 'available_skills' => $availableSkills,
-                'is_available' => $isAvailable
+                'is_available'     => $isAvailable
             ]);
 
             return $isAvailable;
 
         } catch (\Exception $e) {
             Log::error('检查宠物技能可用性时发生错误', [
-                'pet_id' => $pet->id,
+                'pet_id'    => $pet->id,
                 'pet_level' => $pet->level,
-                'skill_id' => $skillId,
-                'error' => $e->getMessage()
+                'skill_id'  => $skillId,
+                'error'     => $e->getMessage()
             ]);
 
             // 发生错误时默认允许使用(向后兼容)
             return true;
         }
     }
+
 }

+ 1 - 1
config/proto_route.php

@@ -90,7 +90,7 @@ return array (
       7 => 'query_data',
     ),
   ),
-  'generated_at' => '+08:00 2025-06-04 21:53:01',
+  'generated_at' => '+08:00 2025-06-05 10:42:34',
   'conventions' => 
   array (
     'handler_namespace' => 'App\\Module\\AppGame\\Handler',

+ 9 - 5
protophp/GPBMetadata/Proto/Game.php

@@ -16,7 +16,7 @@ class Game
         }
         $pool->internalAddGeneratedFile(
             '
-åž
+½Ÿ
 proto/game.proto	uraus.kku"„4
 Request
 request_unid (	;
@@ -477,7 +477,7 @@ last_times (
 APPLYING	
 AGREE
 
-REFUSE"Í-
+REFUSE"¥.
 Common)
 KeyValue
 kname (	
@@ -500,16 +500,20 @@ last_times (
 lands (2.uraus.kku.Common.RewardLand*
 pets (2.uraus.kku.Common.RewardPets5
 
-pet_powers (2!.uraus.kku.Common.RewardPetPowers,
+pet_powers (2!.uraus.kku.Common.RewardPetPowersX
 
 RewardCoin
 type (
-quantity (D
+quantity (
+min_quantity (
+max_quantity (p
 
 RewardItem
 item_id (
 instance_id (
-quantity (L
+quantity (
+min_quantity (
+max_quantity (L
 
 RewardLand0
 type (2".uraus.kku.Common.LANG_CHANGE_TYPE

+ 68 - 0
protophp/Uraus/Kku/Common/RewardCoin.php

@@ -27,6 +27,18 @@ class RewardCoin extends \Google\Protobuf\Internal\Message
      * Generated from protobuf field <code>int64 quantity = 2;</code>
      */
     protected $quantity = 0;
+    /**
+     * 奖励数量,最少(用于奖励预览)
+     *
+     * Generated from protobuf field <code>int64 min_quantity = 4;</code>
+     */
+    protected $min_quantity = 0;
+    /**
+     * 奖励数量,最大(用于奖励预览)
+     *
+     * Generated from protobuf field <code>int64 max_quantity = 5;</code>
+     */
+    protected $max_quantity = 0;
 
     /**
      * Constructor.
@@ -38,6 +50,10 @@ class RewardCoin extends \Google\Protobuf\Internal\Message
      *           奖励类型
      *     @type int|string $quantity
      *           奖励数量
+     *     @type int|string $min_quantity
+     *           奖励数量,最少(用于奖励预览)
+     *     @type int|string $max_quantity
+     *           奖励数量,最大(用于奖励预览)
      * }
      */
     public function __construct($data = NULL) {
@@ -97,6 +113,58 @@ class RewardCoin extends \Google\Protobuf\Internal\Message
         return $this;
     }
 
+    /**
+     * 奖励数量,最少(用于奖励预览)
+     *
+     * Generated from protobuf field <code>int64 min_quantity = 4;</code>
+     * @return int|string
+     */
+    public function getMinQuantity()
+    {
+        return $this->min_quantity;
+    }
+
+    /**
+     * 奖励数量,最少(用于奖励预览)
+     *
+     * Generated from protobuf field <code>int64 min_quantity = 4;</code>
+     * @param int|string $var
+     * @return $this
+     */
+    public function setMinQuantity($var)
+    {
+        GPBUtil::checkInt64($var);
+        $this->min_quantity = $var;
+
+        return $this;
+    }
+
+    /**
+     * 奖励数量,最大(用于奖励预览)
+     *
+     * Generated from protobuf field <code>int64 max_quantity = 5;</code>
+     * @return int|string
+     */
+    public function getMaxQuantity()
+    {
+        return $this->max_quantity;
+    }
+
+    /**
+     * 奖励数量,最大(用于奖励预览)
+     *
+     * Generated from protobuf field <code>int64 max_quantity = 5;</code>
+     * @param int|string $var
+     * @return $this
+     */
+    public function setMaxQuantity($var)
+    {
+        GPBUtil::checkInt64($var);
+        $this->max_quantity = $var;
+
+        return $this;
+    }
+
 }
 
 // Adding a class alias for backwards compatibility with the previous class name.

+ 68 - 0
protophp/Uraus/Kku/Common/RewardItem.php

@@ -33,6 +33,18 @@ class RewardItem extends \Google\Protobuf\Internal\Message
      * Generated from protobuf field <code>int64 quantity = 3;</code>
      */
     protected $quantity = 0;
+    /**
+     * 奖励数量,最少(用于奖励预览)
+     *
+     * Generated from protobuf field <code>int64 min_quantity = 4;</code>
+     */
+    protected $min_quantity = 0;
+    /**
+     * 奖励数量,最大(用于奖励预览)
+     *
+     * Generated from protobuf field <code>int64 max_quantity = 5;</code>
+     */
+    protected $max_quantity = 0;
 
     /**
      * Constructor.
@@ -46,6 +58,10 @@ class RewardItem extends \Google\Protobuf\Internal\Message
      *           奖励物品实例ID
      *     @type int|string $quantity
      *           奖励数量
+     *     @type int|string $min_quantity
+     *           奖励数量,最少(用于奖励预览)
+     *     @type int|string $max_quantity
+     *           奖励数量,最大(用于奖励预览)
      * }
      */
     public function __construct($data = NULL) {
@@ -131,6 +147,58 @@ class RewardItem extends \Google\Protobuf\Internal\Message
         return $this;
     }
 
+    /**
+     * 奖励数量,最少(用于奖励预览)
+     *
+     * Generated from protobuf field <code>int64 min_quantity = 4;</code>
+     * @return int|string
+     */
+    public function getMinQuantity()
+    {
+        return $this->min_quantity;
+    }
+
+    /**
+     * 奖励数量,最少(用于奖励预览)
+     *
+     * Generated from protobuf field <code>int64 min_quantity = 4;</code>
+     * @param int|string $var
+     * @return $this
+     */
+    public function setMinQuantity($var)
+    {
+        GPBUtil::checkInt64($var);
+        $this->min_quantity = $var;
+
+        return $this;
+    }
+
+    /**
+     * 奖励数量,最大(用于奖励预览)
+     *
+     * Generated from protobuf field <code>int64 max_quantity = 5;</code>
+     * @return int|string
+     */
+    public function getMaxQuantity()
+    {
+        return $this->max_quantity;
+    }
+
+    /**
+     * 奖励数量,最大(用于奖励预览)
+     *
+     * Generated from protobuf field <code>int64 max_quantity = 5;</code>
+     * @param int|string $var
+     * @return $this
+     */
+    public function setMaxQuantity($var)
+    {
+        GPBUtil::checkInt64($var);
+        $this->max_quantity = $var;
+
+        return $this;
+    }
+
 }
 
 // Adding a class alias for backwards compatibility with the previous class name.

+ 3 - 1
vendor/composer/autoload_classmap.php

@@ -112,7 +112,7 @@ return array(
     'App\\Module\\AppGame\\Handler\\House\\UpHandler' => $baseDir . '/app/Module/AppGame/Handler/House/UpHandler.php',
     'App\\Module\\AppGame\\Handler\\Item\\CraftHandler' => $baseDir . '/app/Module/AppGame/Handler/Item/CraftHandler.php',
     'App\\Module\\AppGame\\Handler\\Item\\DismantleHandler' => $baseDir . '/app/Module/AppGame/Handler/Item/DismantleHandler.php',
-    'App\\Module\\AppGame\\Handler\\Item\\OpenBoxHandler' => $baseDir . '/app/Module/AppGame/Handler/Item/OpenBoxHandler.php',
+    'App\\Module\\AppGame\\Handler\\Item\\OpenboxHandler' => $baseDir . '/app/Module/AppGame/Handler/Item/OpenboxHandler.php',
     'App\\Module\\AppGame\\Handler\\Item\\QueryHandler' => $baseDir . '/app/Module/AppGame/Handler/Item/QueryHandler.php',
     'App\\Module\\AppGame\\Handler\\Land\\FertilizerHandler' => $baseDir . '/app/Module/AppGame/Handler/Land/FertilizerHandler.php',
     'App\\Module\\AppGame\\Handler\\Land\\HarvestHandler' => $baseDir . '/app/Module/AppGame/Handler/Land/HarvestHandler.php',
@@ -163,6 +163,7 @@ return array(
     'App\\Module\\AppGame\\Service\\MinerService' => $baseDir . '/app/Module/AppGame/Service/MinerService.php',
     'App\\Module\\AppGame\\Service\\TransactionService' => $baseDir . '/app/Module/AppGame/Service/TransactionService.php',
     'App\\Module\\AppGame\\SessionApp' => $baseDir . '/app/Module/AppGame/SessionApp.php',
+    'App\\Module\\AppGame\\SessionHelper' => $baseDir . '/app/Module/AppGame/SessionHelper.php',
     'App\\Module\\AppGame\\Tests\\Land\\DisasterRemovalBaseTest' => $baseDir . '/app/Module/AppGame/Tests/Land/DisasterRemovalBaseTest.php',
     'App\\Module\\AppGame\\Tests\\Land\\DisasterRemovalTestSuite' => $baseDir . '/app/Module/AppGame/Tests/Land/DisasterRemovalTestSuite.php',
     'App\\Module\\AppGame\\Tests\\Land\\FertilizerHandlerTest' => $baseDir . '/app/Module/AppGame/Tests/Land/FertilizerHandlerTest.php',
@@ -694,6 +695,7 @@ return array(
     'App\\Module\\GameItems\\Validations\\ChestOpenValidation' => $baseDir . '/app/Module/GameItems/Validations/ChestOpenValidation.php',
     'App\\Module\\GameItems\\Validations\\ItemCraftValidation' => $baseDir . '/app/Module/GameItems/Validations/ItemCraftValidation.php',
     'App\\Module\\GameItems\\Validations\\ItemDismantleValidation' => $baseDir . '/app/Module/GameItems/Validations/ItemDismantleValidation.php',
+    'App\\Module\\GameItems\\Validators\\ChestConsumeValidator' => $baseDir . '/app/Module/GameItems/Validators/ChestConsumeValidator.php',
     'App\\Module\\GameItems\\Validators\\ChestItemValidator' => $baseDir . '/app/Module/GameItems/Validators/ChestItemValidator.php',
     'App\\Module\\GameItems\\Validators\\ChestOwnershipValidator' => $baseDir . '/app/Module/GameItems/Validators/ChestOwnershipValidator.php',
     'App\\Module\\GameItems\\Validators\\CraftMaterialsValidator' => $baseDir . '/app/Module/GameItems/Validators/CraftMaterialsValidator.php',

+ 3 - 1
vendor/composer/autoload_static.php

@@ -832,7 +832,7 @@ class ComposerStaticInita2207959542f13e6e79e83f2b0d9a425
         'App\\Module\\AppGame\\Handler\\House\\UpHandler' => __DIR__ . '/../..' . '/app/Module/AppGame/Handler/House/UpHandler.php',
         'App\\Module\\AppGame\\Handler\\Item\\CraftHandler' => __DIR__ . '/../..' . '/app/Module/AppGame/Handler/Item/CraftHandler.php',
         'App\\Module\\AppGame\\Handler\\Item\\DismantleHandler' => __DIR__ . '/../..' . '/app/Module/AppGame/Handler/Item/DismantleHandler.php',
-        'App\\Module\\AppGame\\Handler\\Item\\OpenBoxHandler' => __DIR__ . '/../..' . '/app/Module/AppGame/Handler/Item/OpenBoxHandler.php',
+        'App\\Module\\AppGame\\Handler\\Item\\OpenboxHandler' => __DIR__ . '/../..' . '/app/Module/AppGame/Handler/Item/OpenboxHandler.php',
         'App\\Module\\AppGame\\Handler\\Item\\QueryHandler' => __DIR__ . '/../..' . '/app/Module/AppGame/Handler/Item/QueryHandler.php',
         'App\\Module\\AppGame\\Handler\\Land\\FertilizerHandler' => __DIR__ . '/../..' . '/app/Module/AppGame/Handler/Land/FertilizerHandler.php',
         'App\\Module\\AppGame\\Handler\\Land\\HarvestHandler' => __DIR__ . '/../..' . '/app/Module/AppGame/Handler/Land/HarvestHandler.php',
@@ -883,6 +883,7 @@ class ComposerStaticInita2207959542f13e6e79e83f2b0d9a425
         'App\\Module\\AppGame\\Service\\MinerService' => __DIR__ . '/../..' . '/app/Module/AppGame/Service/MinerService.php',
         'App\\Module\\AppGame\\Service\\TransactionService' => __DIR__ . '/../..' . '/app/Module/AppGame/Service/TransactionService.php',
         'App\\Module\\AppGame\\SessionApp' => __DIR__ . '/../..' . '/app/Module/AppGame/SessionApp.php',
+        'App\\Module\\AppGame\\SessionHelper' => __DIR__ . '/../..' . '/app/Module/AppGame/SessionHelper.php',
         'App\\Module\\AppGame\\Tests\\Land\\DisasterRemovalBaseTest' => __DIR__ . '/../..' . '/app/Module/AppGame/Tests/Land/DisasterRemovalBaseTest.php',
         'App\\Module\\AppGame\\Tests\\Land\\DisasterRemovalTestSuite' => __DIR__ . '/../..' . '/app/Module/AppGame/Tests/Land/DisasterRemovalTestSuite.php',
         'App\\Module\\AppGame\\Tests\\Land\\FertilizerHandlerTest' => __DIR__ . '/../..' . '/app/Module/AppGame/Tests/Land/FertilizerHandlerTest.php',
@@ -1414,6 +1415,7 @@ class ComposerStaticInita2207959542f13e6e79e83f2b0d9a425
         'App\\Module\\GameItems\\Validations\\ChestOpenValidation' => __DIR__ . '/../..' . '/app/Module/GameItems/Validations/ChestOpenValidation.php',
         'App\\Module\\GameItems\\Validations\\ItemCraftValidation' => __DIR__ . '/../..' . '/app/Module/GameItems/Validations/ItemCraftValidation.php',
         'App\\Module\\GameItems\\Validations\\ItemDismantleValidation' => __DIR__ . '/../..' . '/app/Module/GameItems/Validations/ItemDismantleValidation.php',
+        'App\\Module\\GameItems\\Validators\\ChestConsumeValidator' => __DIR__ . '/../..' . '/app/Module/GameItems/Validators/ChestConsumeValidator.php',
         'App\\Module\\GameItems\\Validators\\ChestItemValidator' => __DIR__ . '/../..' . '/app/Module/GameItems/Validators/ChestItemValidator.php',
         'App\\Module\\GameItems\\Validators\\ChestOwnershipValidator' => __DIR__ . '/../..' . '/app/Module/GameItems/Validators/ChestOwnershipValidator.php',
         'App\\Module\\GameItems\\Validators\\CraftMaterialsValidator' => __DIR__ . '/../..' . '/app/Module/GameItems/Validators/CraftMaterialsValidator.php',