瀏覽代碼

替换头像,头像解锁bug修复

cyzhao 1 年之前
父節點
當前提交
bfc2e5e829
共有 3 個文件被更改,包括 24 次插入2 次删除
  1. 6 0
      Gameserver/App/base/CmdCode.php
  2. 1 1
      Gameserver/App/model/User/Info_Heros.php
  3. 17 1
      Gameserver/App/process/UserProc.php

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

@@ -92,6 +92,12 @@ class CmdCode {
      */
     const cmd_user_setAnimation = 6004;
     
+    /**
+     * 替换头像
+     */
+    const cmd_user_replaceHeadImg = 6005;
+
+
     // </editor-fold>
     // <editor-fold defaultstate="collapsed" desc="活动操作码 - 61xx">
 

+ 1 - 1
Gameserver/App/model/User/Info_Heros.php

@@ -34,7 +34,7 @@ class Info_Heros extends Object_ext {
                 $insHero = new Ins_Hero();
                 $insHero->Id = $heroId;
                 $insHero->isUnlock = 0;
-                if($heroId == 1 && $heroId == 2){
+                if($heroId == 1 || $heroId == 2){
                     $insHero->isUnlock = 1;
                 }
                 

+ 17 - 1
Gameserver/App/process/UserProc.php

@@ -27,11 +27,27 @@ class UserProc {
             case CmdCode::cmd_user_gameconstinfo:                               # 6002 下载游戏配置
                 return UserProc::downloadConstInfo();
             case CmdCode::cmd_user_setAnimation:                                # 6004 片头播放记录
-                return UserProc::setAnimation();          
+                return UserProc::setAnimation();         
+            case CmdCode::cmd_user_replaceHeadImg:                              # 6005 替换头像
+                return UserProc::replaceHeadImg();
             default:
                 Err(ErrCode::cmd_err);
         }
     }
+    
+    /**
+     * 6005 替换头像
+     * @return type
+     */
+    public static function replaceHeadImg() {
+        list($img) = req()->paras;
+
+        ctx()->baseInfo->headImg = $img;
+
+        UserProc::updateUserInfo();
+        $ret = array();
+        return Resp::ok($ret);
+    }
 
     /**
      * 6004 设置片头播放记录