|
@@ -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 背包扩容
|