Bladeren bron

头像红点,初始账号默认英雄

cyzhao 11 maanden geleden
bovenliggende
commit
e06b400585

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

@@ -101,6 +101,11 @@ class CmdCode {
      * 删除账号
      */
     const cmd_user_delUserUid = 6006;
+    
+    /**
+     * 移除新头像标志
+     */
+    const cmd_user_removeNewHeadImgTip = 6007;
 
     // </editor-fold>
     // <editor-fold defaultstate="collapsed" desc="活动操作码 - 61xx">

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-06-27 09:43:36
+ // 日期: 2024-06-28 15:30:08
 ////////////////////
 
 /**

+ 6 - 1
Gameserver/App/model/Const/sm_globalsettings.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-06-25 11:05:46
+ // 日期: 2024-06-28 15:29:34
 ////////////////////
 
 
@@ -233,5 +233,10 @@ class sm_globalsettings
     */
     public $tili_RecoverrMax_Add_HonourCard;
 
+    /**
+    * @var int 初始账号默认英雄id  
+    */
+    public $CreateUserGame_defaultHeroId;
+
 }
 

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-06-26 17:05:46
+ // 日期: 2024-06-28 15:02:09
 ////////////////////
 
 

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-06-26 17:05:46
+ // 日期: 2024-06-28 15:02:09
 ////////////////////
 
 

+ 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 
- // 日期: 2024-06-26 16:09:57
+ // 日期: 2024-06-27 17:22:39
 ////////////////////
 
 

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

@@ -29,7 +29,7 @@ class sm_token_publicgift
     public $plat;
 
     /**
-    * @var String 奖品  
+    * @var String 奖品。第一个是道具ID,逗号分割,逗号后是数量。不同物品之间使用;(分号)分割  
     */
     public $reward;
 

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-06-27 09:37:09
+ // 日期: 2024-06-28 15:02:08
 ////////////////////
 
 

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-06-27 09:37:09
+ // 日期: 2024-06-28 15:02:08
 ////////////////////
 
 

+ 6 - 7
Gameserver/App/model/User/Info_Heros.php

@@ -32,18 +32,17 @@ class Info_Heros extends Object_ext {
             if (!StlUtil::dictHasProperty($this->Dic, $heroId) && $mo->starLv == 1) {
                 $insHero = new Ins_Hero();
                 $insHero->Id = $heroId;
-                $insHero->isUnlock = 0;
-                if ($mo->heroDebris_need == null) {                   
+                $insHero->isUnlock = 0;               
+                if ($mo->heroDebris_need == null) {
                     $insHero->isUnlock = 1;
-                    if($this->CurrentHeroId == 0){
-                        $this->CurrentHeroId = $heroId;
-                    }                   
-                }
+                }                              
                 $this->Dic->$heroId = $insHero;
             }
         }
 
-
+        if ($this->CurrentHeroId == 0) {
+            $this->CurrentHeroId = glc()->CreateUserGame_defaultHeroId;
+        }
 //        
 //        foreach ($heroConf as $heroId => $mo) {
 //            if(!StlUtil::dictHasProperty($this->Dic, $heroId) ){

+ 6 - 0
Gameserver/App/model/User/Ins_Hero.php

@@ -27,6 +27,12 @@ class Ins_Hero extends Object_ext {
      */
     public $isUnlock = 1;
     
+    /**
+     * 新头像标志 0:没有标志 1:有新头像标志
+     * @var type
+     */
+    public $isNewHeadImgTip = 0;
+
     /**
      * 通关的关卡记录
      * @var type

+ 2 - 1
Gameserver/App/process/HeroProc.php

@@ -116,7 +116,8 @@ class HeroProc {
         ctx()->store->removeItem($itemId, $itemNum);
         
         ctx()->heros->Dic->$heroId->isUnlock = 1;//解锁
-                           
+        ctx()->heros->Dic->$heroId->isNewHeadImgTip = 1;                   
+        
         UserProc::updateUserInfo();
         return Resp::ok(array(                   
                     'store' => ctx()->store,

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

@@ -32,10 +32,30 @@ class UserProc {
                 return UserProc::replaceHeadImg();
             case CmdCode::cmd_user_delUserUid:                                  # 6006 删除账号
                 return UserProc::delUserUid();
+            case CmdCode::cmd_user_removeNewHeadImgTip:                         # 6007 移除新头像标志
+                return UserProc::removeNewHeadImgTip();
             default:
                 Err(ErrCode::cmd_err);
         }
     }
+    
+    /**
+     * 6007 移除新头像标志
+     */
+    public static function removeNewHeadImgTip() {       
+        //list($gateId) = req()->paras;
+        
+        $dic = ctx()->heros->Dic;
+        foreach ($dic as $heroId => $ins_Hero) {
+            if($ins_Hero->isUnlock == 1 && $ins_Hero->isNewHeadImgTip == 1){
+                ctx()->heros->Dic->$heroId->isNewHeadImgTip = 0;
+            }
+        }
+                
+        UserProc::updateUserInfo();
+      
+        return Resp::ok(array());
+    }
 
     /**
      * 6006 删除账号