cyzhao преди 3 години
родител
ревизия
ea507f8a87

+ 5 - 0
Gameserver/Amfphp/base/CmdCode.php

@@ -644,6 +644,11 @@ class CmdCode {
      * 宝石卸下
      */
     const cmd_store_GemRemove = 6427;
+    
+    /**
+     * 背包扩展
+     */
+    const cmd_store_unlockStore = 6428;
 
 // </editor-fold>
     //

+ 17 - 1
Gameserver/Amfphp/configs/GameConfig.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-11-03 10:28:24
+ // 日期: 2021-11-09 10:50:24
 ////////////////////
 namespace loyalsoft;
 /**
@@ -1544,6 +1544,22 @@ class GameConfig {
         return self::get_hash_item('item_taskcard_type', $key);
     }
     /**
+    * 背包扩容次数及消耗
+    * @return \expandStoreNum
+    */
+    public static function expandStoreNum()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'expandStoreNum');
+    }
+    /**
+    * @return \sm_expandStoreNum expandStoreNum item数据 
+    */
+    public static function expandStoreNum_getItem($itemid)
+    { 
+        return self::get_hash_item('expandStoreNum', $itemid);
+    }
+    /**
     * 当前版本(时间戳)
     * @return \ver
     */

+ 17 - 1
Gameserver/Amfphp/model/Const/GameConfig.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-11-03 10:28:24
+ // 日期: 2021-11-09 11:52:04
 ////////////////////
 
 /**
@@ -1544,6 +1544,22 @@ class GameConfig {
         return self::get_hash_item('item_taskcard_type', $key);
     }
     /**
+    * 背包扩容次数及消耗
+    * @return \expandStoreNum
+    */
+    public static function expandStoreNum()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'expandStoreNum');
+    }
+    /**
+    * @return \sm_expandStoreNum expandStoreNum item数据 
+    */
+    public static function expandStoreNum_getItem($itemid)
+    { 
+        return self::get_hash_item('expandStoreNum', $itemid);
+    }
+    /**
     * 当前版本(时间戳)
     * @return \ver
     */

+ 11 - 1
Gameserver/Amfphp/model/Const/globalsettings.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-10-26 12:10:25
+ // 日期: 2021-11-09 11:50:45
 ////////////////////
 
 
@@ -450,5 +450,15 @@ class globalsettings
     */
     public $Arenas_jixianshanbi_SP;
 
+    /**
+    * @var Object 背包最大数量  
+    */
+    public $Item_Packet_MaxNum_New;
+
+    /**
+    * @var Object 背包起始默认数量  
+    */
+    public $Item_Packet_InitNum_New;
+
 }
 

+ 37 - 0
Gameserver/Amfphp/model/Const/sm_expandStoreNum.php

@@ -0,0 +1,37 @@
+<?php
+////////////////////
+ // 由CodeGenerator创建。
+ // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
+ // author: gwang 
+ // 日期: 2021-11-09 10:58:00
+////////////////////
+
+
+/**
+ * Static Model expandStoreNum 背包扩容次数及消耗
+ */
+class sm_expandStoreNum
+{
+
+    /**
+    * @var Int32 扩充次数 default(0) 
+    */
+    public $id;
+
+    /**
+    * @var Int32 扩容格子数量 default(0) 
+    */
+    public $expandNum;
+
+    /**
+    * @var String 每次扩容消耗  
+    */
+    public $cost;
+
+    /**
+    * @var String 额外字段  
+    */
+    public $etc;
+
+}
+

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_gate.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-08-11 15:21:40
+ // 日期: 2021-11-03 16:17:05
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_hero.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-09-23 17:59:19
+ // 日期: 2021-11-03 16:16:03
 ////////////////////
 
 

+ 6 - 0
Gameserver/Amfphp/model/User/Info_PrivateState.php

@@ -127,6 +127,12 @@ class Info_PrivateState extends Object_ext {
      * @var stdClass 任务卡追踪信息 { "1":2345,"2":0,"3":0,"4":0 }
      */
     public $taskCardTracing;
+    
+    /**
+     * 背包扩容次数
+     * @var type
+     */
+    public $expandNum = 0;
 
 // <editor-fold defaultstate="collapsed" desc="    初始化    ">
 

+ 1 - 1
Gameserver/Amfphp/model/User/Info_Store.php

@@ -44,7 +44,7 @@ class Info_Store extends Object_ext {
      * @deprecated since version 0
      */
     public $segement;
-
+        
     /**
      * 玩家注册时初始化
      */

+ 41 - 10
Gameserver/Amfphp/process/StoreProc.php

@@ -73,11 +73,36 @@ class StoreProc {
                 return StoreProc::GemSetYanLing();
             case CmdCode::cmd_store_GemRemove:
                 return StoreProc::GemRemoveYanLing();
+            case CmdCode::cmd_store_unlockStore:
+                StoreProc::unlockStore();
             default:
                 Err(ErrCode::cmd_err);
         }
     }
     
+    /**
+     * 扩容
+     * @return type
+     */
+    static function unlockStore() {
+        list() = req()->paras;                                        
+        $user = req()->userInfo->game;
+        
+        $mo = GameConfig::expandStoreNum_getItem($user->privateState->expandNum+1);
+        my_Assert($mo != null, ErrCode::err_const_no);                 
+        my_Assert($user->baseInfo->gold >= $mo->cost, ErrCode::notenough_gold_msg);  
+        
+        $user->base(true)->Consume_Gold($mo->cost);
+        $user->privateState->expandNum += 1;
+        req()->userInfo->game = $user;
+               
+        UserProc::updateUserInfo();                                             # 回写玩家数据
+        return Resp::ok(array(
+                    "gold"=>$user->baseInfo->gold,
+                    "expandNum"=>$user->privateState->expandNum,                                                        
+        ));
+    }
+    
     /**
      * 宝石镶嵌
      */
@@ -615,12 +640,13 @@ class StoreProc {
      * @return type
      */
     public static function AddMultiItemInStore($goodsStr, $src = 1, $mask = 0) {
-        $user = req()->userInfo->game;
+        $user = req()->userInfo->game;    
         $ary = explode(";", $goodsStr);
         foreach ($ary as $value) {
             $val = explode(",", $value);
             $cid = "";
             my_Assert(count($val) > 1, "解析奖励字符串出错");
+            //my_Assert($user->privateState->currentId< GameConfig::expandStoreNum_getItem($user->privateState->expandNum)->expandNum+50, "背包容量不够请扩容");
             list( $itemId, $num) = $val;                                        # ID, 数量
             $smItem = GameConfig::item_base_getItem($itemId);                   # 道具mo
             switch ($smItem->subType) {                                         # 根据类型分别添加到容器中
@@ -862,8 +888,13 @@ class StoreProc {
         } else {                                                                # 如果仓库中没有这种元素,则其数目置为num
             $items->$itemId = $num;
         }
+        
+//        if (!CommUtil::isPropertyExists(req()->userInfo->game->privateState, "currentId")) {          
+//            req()->userInfo->game->privateState->currentId = 1;
+//        }
+//        req()->userInfo->game->privateState->currentId++;
     }
-
+    
     /**
      * 物品包裹打散成独立道具到仓库
      * @param GoodsItemModel $itemModel
@@ -1074,16 +1105,16 @@ class StoreProc {
     }
 
     /**
-     * 获取物品格子的上限值
+     * 获取物品格子的上限值---废弃了
      * @return int 上限数值
      */
-    public static function GetItemMaxNum() {
-        $user = req()->userInfo->game;
-        if (!CommUtil::isPropertyExists($user->privateState, "maxItemNum")) {
-            $user->privateState->maxItemNum = glc()->Item_Packet_MaxNum;
-        }
-        return $user->privateState->maxItemNum;
-    }
+//    public static function GetItemMaxNum() {
+//        $user = req()->userInfo->game;
+//        if (!CommUtil::isPropertyExists($user->privateState, "maxItemNum")) {
+//            $user->privateState->maxItemNum = glc()->Item_Packet_MaxNum;
+//        }
+//        return $user->privateState->maxItemNum;
+//    }
 
     /**
      * 6412 背包扩容