Quellcode durchsuchen

背包标志清理和引导

cyzhao vor 1 Tag
Ursprung
Commit
895be1ba0a

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

@@ -461,6 +461,11 @@ class CmdCode {
      * 6439 宠物休息
      */
     const store_pet_removeFightPosition = 6439;
+    
+    /**
+     * 
+     */
+    const store_clearNewGemTip = 6440;
 // </editor-fold>
 // <editor-fold defaultstate="collapsed" desc="商城操作码 - 65xx">
 

+ 1 - 1
Gameserver/App/model/Const/GameConfig.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2025-06-11 12:03:29
+ // 日期: 2025-06-12 10:34:07
 ////////////////////
 
 /**

+ 1 - 1
Gameserver/App/model/Const/sm_item.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2025-06-11 10:09:12
+ // 日期: 2025-06-11 15:14:34
 ////////////////////
 
 

+ 7 - 0
Gameserver/App/model/User/Info_Store.php

@@ -115,6 +115,13 @@ class Info_Store extends Object_ext {
      * @var type
      */
     public $exploreArea;
+    
+    /**
+     * 背包新获得的技能宝石加个标识
+     * @var type
+     */
+    #[ArrayType]
+    public $newGem_Store = array();
 
     public function initialize() {
         StoreProc::AddMultiItemInStore(glc()->Init_Packet_Items, "UsrInit");

+ 3 - 3
Gameserver/App/process/PetProc.php

@@ -483,10 +483,10 @@ class PetProc {
      */
     public static function Pet_BreedEgg() {
         list($slotId,$eggId) = req()->paras;
-        
-        my_Assert(StlUtil::dictHasProperty(ctx()->store->items, $eggId), ErrCode::user_store_NoItem);
+                      
+        my_Assert(StlUtil::dictHasProperty(ctx()->store()->items, $eggId), ErrCode::user_store_NoItem);
         $mo = GameConfig::item_getItem($eggId);
-        my_Assert($mo != null, ErrCode::err_const_no);
+        my_Assert($mo != null, ErrCode::err_const_no);      
         my_Assert($mo->itemType == 105, ErrCode::user_store_NoItem);             
         
         $ins_breed = new Ins_BreedEggSlot(ctx()->store()->breedEggLocation->$slotId);       

+ 34 - 1
Gameserver/App/process/StoreProc.php

@@ -99,10 +99,30 @@ class StoreProc {
                 return PetProc::ResetDispatchPet();
             case CmdCode::store_pet_removeFightPosition:                        # 6439 
                 return PetProc::RemoveFightPosition();
+                
+            case CmdCode::store_clearNewGemTip:                                 # 6440 清理背包里新宝石标识
+                return self::clearNewGemTip();
+                
             default:
                 Err(ErrCode::cmd_err);
         }
     }
+    
+    /**
+     * 6440 清理背包里新宝石标识
+     */
+    public static function clearNewGemTip(){
+        list($uid) = req()->paras;
+      
+        if(in_array($uid, ctx()->store()->newGem_Store)){
+            StlUtil::arrayRemove( ctx()->store()->newGem_Store, $uid);
+        }
+        
+        UserProc::updateUserInfo();
+        return Resp::ok(array(               
+                    'store' => ctx()->store,
+        ));
+    }
 
     /**
      * 6420 降品
@@ -1280,7 +1300,20 @@ class StoreProc {
                     for ($i = 0; $i < $num; $i++) {
                         $gem = self::initGem($itemId);
                         if ($src != 1) {
-                            self::$reward_Gem[] = $gem->uid;
+                            self::$reward_Gem[] = $gem->uid;                          
+                            $gemStore = ctx()->store()->gemStore;
+                            $predicateId = $gem->predicateId;
+                            $isExistSameGem = false;
+                            foreach ($gemStore as $uid => $gemValue) {
+                                if($gemValue->predicateId == $predicateId){
+                                    $isExistSameGem = true;
+                                    break;
+                                }                                   
+                            }
+                            
+                            if(!$isExistSameGem){
+                                ctx()->store()->newGem_Store[] = $gem->uid;
+                            }                           
                         }
                         self::PutGemInStore($gem);
                         if ($src == Enum_StoreSourceType::ShopBox) {

+ 5 - 0
Gameserver/App/process/UserProc.php

@@ -73,6 +73,11 @@ class UserProc {
 
         if (in_array($guideType, ctx()->privateState->funUnlockRecord_3) && $guide_type_forceSave == true) {
             StlUtil::arrayRemove(ctx()->privateState->funUnlockRecord_3, $guideType);
+            
+            if ($guideType == E_GuideTypeState::MainTaskPrize_PetEgg_Guide)
+            {
+                ctx()->privateState->funUnlockRecord_3[] = E_GuideTypeState::MainTaskPrize_PetEgg_Guide;            
+            }         
         }
 
         UserProc::updateUserInfo();                                             # 回写数据