Переглянути джерело

feat(AppGame): 添加 JSON 控制器并优化 Protobuf 响应逻辑

- 新增 JsonController 类,用于处理 JSON 请求
- 在 AppGameServiceProvider 中注册 JSON路由
- 修改 Protobuf 类,增加对 Force-Json 请求头的支持
- 删除公共 JSON 文件夹下的所有 JSON 配置文件
Your Name 8 місяців тому
батько
коміт
1b5603a1b9

+ 42 - 0
app/Module/AppGame/HttpControllers/JsonController.php

@@ -0,0 +1,42 @@
+<?php
+
+namespace App\Module\AppGame\HttpControllers;
+
+use App\Http\Controllers\Controller;
+use App\Module\AppGame\Tools\Protobuf;
+use App\Module\Game\DCache\ItemJsonConfig;
+use Illuminate\Http\Request as HttpRequest;
+use Illuminate\Support\Facades\Log;
+use Illuminate\Support\Str;
+use UCore\App;
+use UCore\Exception\HandleNotException;
+use UCore\Exception\ValidateException;
+use UCore\Helper\Logger;
+use Uraus\Kku\Common\RESPONSE_CODE;
+use Uraus\Kku\Request;
+use Uraus\Kku\Response;
+
+/**
+ * Protobuf 控制器
+ *
+ * 负责处理来自客户端的 Protobuf 请求,并将其路由到相应的处理器
+ */
+class JsonController extends Controller
+{
+
+    /**
+     * 配置表
+     * @param string $key
+     * @return \Illuminate\Contracts\Routing\ResponseFactory|\Illuminate\Foundation\Application|\Illuminate\Http\JsonResponse|\Illuminate\Http\Response|object
+     * @throws HandleNotException
+     */
+    public function config($key)
+    {
+        $map =[
+            'items'=>ItemJsonConfig::class
+        ];
+        dump($key);
+    }
+
+
+}

+ 9 - 0
app/Module/AppGame/Providers/AppGameServiceProvider.php

@@ -4,6 +4,7 @@ namespace App\Module\AppGame\Providers;
 
 use App\Module\AppGame\Events\LoginSuccessEvent;
 use App\Module\AppGame\Events\ProtobufResponseEvent;
+use App\Module\AppGame\HttpControllers\JsonController;
 use App\Module\AppGame\HttpControllers\ProtobufController;
 use App\Module\AppGame\Listeners\AppGameProtobufResponseListener;
 use Illuminate\Support\ServiceProvider;
@@ -64,5 +65,13 @@ class AppGameServiceProvider extends ServiceProvider
     {
         // 注册 Protobuf 路由
         Route::post('/gameapi', [ProtobufController::class, 'gameapi']);
+        Route::get('/json/{key}.json', [JsonController::class, 'config']);
+
+        // 注册 Proto 调试路由
+        Route::prefix('proto-debug')->group(function () {
+            Route::get('/json', [\App\Module\AppGame\HttpControllers\ProtoDebugController::class, 'showJson']);
+            Route::get('/binary', [\App\Module\AppGame\HttpControllers\ProtoDebugController::class, 'showBinary']);
+            Route::get('/base64', [\App\Module\AppGame\HttpControllers\ProtoDebugController::class, 'showBase64']);
+        });
     }
 }

+ 32 - 15
app/Module/AppGame/Tools/Protobuf.php

@@ -29,31 +29,48 @@ class Protobuf
         // 根据请求的 Accept 头决定响应格式
         $acceptHeader = $httpRequest->header('Accept');
         $contentType = $httpRequest->header('Content-Type');
-        $ContentTypeBase64 = $httpRequest->header('Content-Type-Base64',0);
-        $ContentTypeBin = $httpRequest->header('Content-Type-Bin',0);
+        $ContentTypeBase64 = $httpRequest->header('Content-Type-Base64', 0);
+        $ContentTypeBin = $httpRequest->header('Content-Type-Bin', 0);
+        $forceJson = $httpRequest->header('Force-Json', 0);
 
-        if($ContentTypeBase64){
-            return response(base64_encode($response->serializeToString()))
+        // 记录响应信息,便于调试
+        \Illuminate\Support\Facades\Log::debug('Proto响应信息', [
+            'Accept' => $acceptHeader,
+            'Content-Type' => $contentType,
+            'Content-Type-Base64' => $ContentTypeBase64,
+            'Content-Type-Bin' => $ContentTypeBin,
+            'Force-Json' => $forceJson,
+            'response_size' => strlen($response->serializeToString()),
+            'response_json_size' => strlen($response->serializeToJsonString())
+        ]);
+
+        // 强制返回JSON格式(用于调试或客户端不支持二进制解析时)
+        if ($forceJson) {
+            return response()->json(
+                self::protobufToArray($response)
+            )->header('Content-Type', 'application/json');
+        }
+
+        // 返回Base64编码的Protobuf数据
+        if ($ContentTypeBase64) {
+            $base64Data = base64_encode($response->serializeToString());
+            return response($base64Data)
                 ->header('Content-Type', 'application/x-protobuf-base64');
         }
-        // base64 的protobuf格式
-        if ($ContentTypeBin==0 ) {
-            if(stripos($acceptHeader, 'json') !== false || stripos($contentType, 'json') !== false){
-                // 返回 JSON 格式
+
+        // 返回JSON格式(当客户端请求JSON或发送JSON请求时)
+        if ($ContentTypeBin == 0) {
+            if (stripos($acceptHeader, 'json') !== false || stripos($contentType, 'json') !== false) {
                 return response()->json(
                     self::protobufToArray($response)
                 );
             }
         }
-        //
 
-
-//        dump(base64_encode($response->serializeToString()));// 这个base64的数据是正确的
-
-        // 返回 Protobuf 格式
-        return response($response->serializeToString())
+        // 返回二进制Protobuf格式(默认)
+        $binaryData = $response->serializeToString();
+        return response($binaryData)
             ->header('Content-Type', 'application/x-protobuf');
-
     }
 
     /**

+ 0 - 1
public/json/chest.json

@@ -1 +0,0 @@
-{"generated_at":"2025-05-12 08:06:08","chests":[{"id":27,"name":"铜宝箱","min_drop_count":0,"max_drop_count":4,"contents":[{"id":2,"weight":50,"min_quantity":1,"max_quantity":3,"item_id":2,"item_name":"萝卜","type":"item"},{"id":3,"weight":50,"min_quantity":1,"max_quantity":3,"item_id":2,"item_name":"萝卜","type":"item"}],"costs":[]},{"id":28,"name":"银宝箱","min_drop_count":0,"max_drop_count":4,"contents":[],"costs":[]},{"id":29,"name":"金宝箱","min_drop_count":0,"max_drop_count":4,"contents":[],"costs":[]},{"id":30,"name":"钻石宝箱","min_drop_count":0,"max_drop_count":4,"contents":[],"costs":[]},{"id":32,"name":"神奇宝箱","min_drop_count":0,"max_drop_count":4,"contents":[{"id":5,"weight":10,"min_quantity":1,"max_quantity":2,"item_id":2,"item_name":"萝卜","type":"item"}],"costs":[{"cost_type":1,"cost_id":31,"cost_quantity":1,"item_name":"钥匙"}]}]}

+ 0 - 81
public/json/chest_pretty.json

@@ -1,81 +0,0 @@
-{
-    "generated_at": "2025-05-12 08:06:08",
-    "chests": [
-        {
-            "id": 27,
-            "name": "铜宝箱",
-            "min_drop_count": 0,
-            "max_drop_count": 4,
-            "contents": [
-                {
-                    "id": 2,
-                    "weight": 50,
-                    "min_quantity": 1,
-                    "max_quantity": 3,
-                    "item_id": 2,
-                    "item_name": "萝卜",
-                    "type": "item"
-                },
-                {
-                    "id": 3,
-                    "weight": 50,
-                    "min_quantity": 1,
-                    "max_quantity": 3,
-                    "item_id": 2,
-                    "item_name": "萝卜",
-                    "type": "item"
-                }
-            ],
-            "costs": []
-        },
-        {
-            "id": 28,
-            "name": "银宝箱",
-            "min_drop_count": 0,
-            "max_drop_count": 4,
-            "contents": [],
-            "costs": []
-        },
-        {
-            "id": 29,
-            "name": "金宝箱",
-            "min_drop_count": 0,
-            "max_drop_count": 4,
-            "contents": [],
-            "costs": []
-        },
-        {
-            "id": 30,
-            "name": "钻石宝箱",
-            "min_drop_count": 0,
-            "max_drop_count": 4,
-            "contents": [],
-            "costs": []
-        },
-        {
-            "id": 32,
-            "name": "神奇宝箱",
-            "min_drop_count": 0,
-            "max_drop_count": 4,
-            "contents": [
-                {
-                    "id": 5,
-                    "weight": 10,
-                    "min_quantity": 1,
-                    "max_quantity": 2,
-                    "item_id": 2,
-                    "item_name": "萝卜",
-                    "type": "item"
-                }
-            ],
-            "costs": [
-                {
-                    "cost_type": 1,
-                    "cost_id": 31,
-                    "cost_quantity": 1,
-                    "item_name": "钥匙"
-                }
-            ]
-        }
-    ]
-}

+ 0 - 4
public/json/farm_house.json

@@ -1,4 +0,0 @@
-{
-    "generated_at": "2025-05-09 04:49:18",
-    "house_configs": []
-}

+ 0 - 4
public/json/farm_land_type.json

@@ -1,4 +0,0 @@
-{
-    "generated_at": "2025-05-09 04:49:18",
-    "land_types": []
-}

+ 0 - 4
public/json/farm_land_upgrade.json

@@ -1,4 +0,0 @@
-{
-    "generated_at": "2025-05-09 04:49:19",
-    "upgrade_configs": []
-}

+ 0 - 4
public/json/farm_seed.json

@@ -1,4 +0,0 @@
-{
-    "generated_at": "2025-05-09 04:49:18",
-    "seeds": []
-}

+ 0 - 4
public/json/farm_seed_output.json

@@ -1,4 +0,0 @@
-{
-    "generated_at": "2025-05-09 04:49:18",
-    "seed_outputs": []
-}

+ 0 - 677
public/json/items.json

@@ -1,677 +0,0 @@
-{
-    "generated_at": "2025-05-12 08:08:50",
-    "items": [
-        {
-            "id": 1,
-            "name": "神秘种子",
-            "description": "神秘种子",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": "icon\/item\/4_7_png"
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0.1,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": " "
-            }
-        },
-        {
-            "id": 2,
-            "name": "萝卜",
-            "description": "萝卜",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": "0"
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0.1,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": "0"
-            }
-        },
-        {
-            "id": 3,
-            "name": "辣椒",
-            "description": "辣椒",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": " "
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0.1,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": " "
-            }
-        },
-        {
-            "id": 4,
-            "name": "苹果",
-            "description": "苹果",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": " "
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0.1,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": " "
-            }
-        },
-        {
-            "id": 5,
-            "name": "西瓜",
-            "description": "西瓜",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": " "
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0.1,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": " "
-            }
-        },
-        {
-            "id": 6,
-            "name": "草莓",
-            "description": "草莓",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": " "
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0.1,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": " "
-            }
-        },
-        {
-            "id": 7,
-            "name": "南瓜",
-            "description": "南瓜",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": " "
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0.1,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": " "
-            }
-        },
-        {
-            "id": 8,
-            "name": "核桃",
-            "description": "核桃",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": " "
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0.1,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": " "
-            }
-        },
-        {
-            "id": 9,
-            "name": "可可",
-            "description": "可可",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": " "
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0.1,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": " "
-            }
-        },
-        {
-            "id": 10,
-            "name": "人参",
-            "description": "人参",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": " "
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0.1,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": " "
-            }
-        },
-        {
-            "id": 11,
-            "name": "玫瑰",
-            "description": "玫瑰",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": " "
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0.1,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": " "
-            }
-        },
-        {
-            "id": 12,
-            "name": "草莓种⼦",
-            "description": "草莓种⼦",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": " "
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0.1,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": " "
-            }
-        },
-        {
-            "id": 13,
-            "name": "南⽠种⼦",
-            "description": "南⽠种⼦",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": " "
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0.1,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": " "
-            }
-        },
-        {
-            "id": 14,
-            "name": "核桃种⼦",
-            "description": "核桃种⼦",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": " "
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0.1,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": " "
-            }
-        },
-        {
-            "id": 15,
-            "name": "可可种⼦",
-            "description": "可可种⼦",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": " "
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0.1,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": " "
-            }
-        },
-        {
-            "id": 16,
-            "name": "⼈参种⼦",
-            "description": "⼈参种⼦",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": " "
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0.1,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": " "
-            }
-        },
-        {
-            "id": 17,
-            "name": "玫瑰种⼦",
-            "description": "玫瑰种⼦",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": " "
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0.1,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": " "
-            }
-        },
-        {
-            "id": 18,
-            "name": "测试",
-            "description": "测试",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": " "
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0.1,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": " "
-            }
-        },
-        {
-            "id": 19,
-            "name": "普通化肥",
-            "description": "普通化肥",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": "2"
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0.1,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": " "
-            }
-        },
-        {
-            "id": 20,
-            "name": "普通化肥 (复制)",
-            "description": "普通化肥",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": "2"
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0.1,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": " "
-            }
-        },
-        {
-            "id": 21,
-            "name": "高级化肥",
-            "description": "高级化肥",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": "2"
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0.1,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": " "
-            }
-        },
-        {
-            "id": 22,
-            "name": "除草剂",
-            "description": "除草剂",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": " "
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0.1,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": " "
-            }
-        },
-        {
-            "id": 23,
-            "name": "杀虫剂",
-            "description": "杀虫剂",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": "icon\/item\/4_7_png"
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0.1,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": " "
-            }
-        },
-        {
-            "id": 24,
-            "name": "洒水壶",
-            "description": "洒水壶",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": "11"
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 1,
-                "fint": 0,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": "0",
-                "intd": 0
-            }
-        },
-        {
-            "id": 25,
-            "name": "银锄头",
-            "description": "银锄头",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": ""
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": "0",
-                "intd": 0
-            }
-        },
-        {
-            "id": 26,
-            "name": "金锄头",
-            "description": "金锄头",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": ""
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": "0",
-                "intd": 0
-            }
-        },
-        {
-            "id": 27,
-            "name": "铜宝箱",
-            "description": "铜宝箱",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": ""
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 4,
-                "fint": 0,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": "0",
-                "intd": 0
-            }
-        },
-        {
-            "id": 28,
-            "name": "银宝箱",
-            "description": "银宝箱",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": ""
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 4,
-                "fint": 0,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": "0",
-                "intd": 0
-            }
-        },
-        {
-            "id": 29,
-            "name": "金宝箱",
-            "description": "金宝箱",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": ""
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 4,
-                "fint": 0,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": "0",
-                "intd": 0
-            }
-        },
-        {
-            "id": 30,
-            "name": "钻石宝箱",
-            "description": "钻石宝箱",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": ""
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 4,
-                "fint": 0,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": "0",
-                "intd": 0
-            }
-        },
-        {
-            "id": 31,
-            "name": "钥匙",
-            "description": "钥匙",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": "0"
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": "0"
-            }
-        },
-        {
-            "id": 32,
-            "name": "神奇宝箱",
-            "description": "神奇宝箱",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": "0"
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 4,
-                "fint": 0,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": "0"
-            }
-        },
-        {
-            "id": 33,
-            "name": "木材",
-            "description": "木材",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": "0"
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": "0"
-            }
-        },
-        {
-            "id": 34,
-            "name": "石材",
-            "description": "石材",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": "0"
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": "0"
-            }
-        },
-        {
-            "id": 35,
-            "name": "钢材",
-            "description": "钢材",
-            "sell_price": 0,
-            "display_attributes": {
-                "img": "0"
-            },
-            "numeric_attributes": {
-                "min_drop_count": 0,
-                "max_drop_count": 0,
-                "fint": 0,
-                "crop_growth_time": 0,
-                "pet_power": 0,
-                "reward_group_id": 0,
-                "pet_exp": 0,
-                "stval": "0"
-            }
-        }
-    ]
-}

+ 0 - 21
public/json/pet_config.json

@@ -1,21 +0,0 @@
-{
-    "generated_at": "2025-05-09 04:49:09",
-    "pets": [
-        {
-            "id": 1,
-            "pet_type": "松狮",
-            "grade_probability": {
-                "grade1": 20,
-                "grade2": 20,
-                "grade3": 20,
-                "grade4": 20,
-                "grade5": 20
-            },
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        }
-    ]
-}

+ 0 - 395
public/json/pet_level_config.json

@@ -1,395 +0,0 @@
-{
-    "generated_at": "2025-05-09 04:49:09",
-    "pet_levels": [
-        {
-            "level": 1,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 2,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 3,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 4,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 5,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 6,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 7,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 8,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 9,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 10,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 11,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 12,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 13,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 14,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 15,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 16,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 17,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 18,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 19,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 20,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 21,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 22,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 23,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 24,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 25,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 26,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 27,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 28,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 29,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        },
-        {
-            "level": 30,
-            "exp_required": 100,
-            "skills": [
-                "1",
-                "2"
-            ],
-            "display_attributes": {},
-            "numeric_attributes": {
-                "stamina_recovery": 0,
-                "stamina_max": 100
-            }
-        }
-    ]
-}

+ 0 - 45
public/json/pet_skill_config.json

@@ -1,45 +0,0 @@
-{
-    "generated_at": "2025-05-09 04:49:09",
-    "pet_skills": [
-        {
-            "id": 1,
-            "skill_name": "自动除草",
-            "stamina_cost": 10,
-            "cool_down": 0,
-            "effect_desc": null,
-            "min_level": 1
-        },
-        {
-            "id": 2,
-            "skill_name": "自动种植",
-            "stamina_cost": 10,
-            "cool_down": 0,
-            "effect_desc": null,
-            "min_level": 1
-        },
-        {
-            "id": 3,
-            "skill_name": "自动收获",
-            "stamina_cost": 10,
-            "cool_down": 0,
-            "effect_desc": null,
-            "min_level": 1
-        },
-        {
-            "id": 4,
-            "skill_name": "自动浇水",
-            "stamina_cost": 10,
-            "cool_down": 0,
-            "effect_desc": null,
-            "min_level": 1
-        },
-        {
-            "id": 5,
-            "skill_name": "自动杀虫",
-            "stamina_cost": 10,
-            "cool_down": 0,
-            "effect_desc": null,
-            "min_level": 1
-        }
-    ]
-}

+ 0 - 4
public/json/task_condition_config.json

@@ -1,4 +0,0 @@
-{
-    "conditions": [],
-    "condition_types": []
-}

+ 0 - 4
public/json/task_config.json

@@ -1,4 +0,0 @@
-{
-    "tasks": [],
-    "categories": []
-}

+ 0 - 3
public/json/task_cost_config.json

@@ -1,3 +0,0 @@
-{
-    "costs": []
-}

+ 0 - 3
public/json/task_reward_config.json

@@ -1,3 +0,0 @@
-{
-    "rewards": []
-}

+ 1 - 1
tests/Unit/ExampleTest.php

@@ -12,7 +12,7 @@ class ExampleTest extends TestCase
      */
     public function test_that_true_is_true(): void
     {
-        $base64 ='Cg02ODIyZWQxM2VmNjY1EAIYASoMUHVibGljLVRva2VumgYAogYiCiAxZTk2MjEzNWQ3ZjMwYzYwZjQ0MjVkOWRmNzY2MmQyYQ==';
+        $base64 ='Cg02ODIzMWRlMTg3ZTc3EAQYASoMUHVibGljLVRva2Vu77+9BgDvv70GIgogZTViMGJkYjYyNjM2MGRhZGI5ZjJjMTQ1ZjBjYmM0ZDU=';
         $b2 = base64_decode($base64);
         dump($b2);
         $resp =new  Response();