浏览代码

fixed: 升级召唤师时未同步任务卡状态.

gwang 4 年之前
父节点
当前提交
f91c5ad42a
共有 1 个文件被更改,包括 37 次插入34 次删除
  1. 37 34
      Gameserver/Amfphp/process/HeroProc.php

+ 37 - 34
Gameserver/Amfphp/process/HeroProc.php

@@ -237,7 +237,11 @@ class HeroProc {
         }
 //        var_dump($user->task->taskListDaily);
         self::CalcUserFightPower($req->zoneid, $req->uid, $req->userInfo->game); # 跟新战力统计
-        return Resp::ok($targetHero);
+        $ret = array(
+            'hero' => $targetHero,
+            'store' => $user->store
+        );
+        return Resp::ok($ret);
     }
 
 // </editor-fold>
@@ -964,88 +968,87 @@ class HeroProc {
      * @return type
      */
     static function StrengthenStar($req) {
-        list($yanlingUid,$uidList) = $req->paras;
-   
+        list($yanlingUid, $uidList) = $req->paras;
+
         $store = $req->userInfo->game->store;
-        if(!StlUtil::dictHasProperty($store->yanling,$yanlingUid)){
+        if (!StlUtil::dictHasProperty($store->yanling, $yanlingUid)) {
             return Resp::err(ErrCode::hero_yanling_notfound);
         }
         $tag = true;
         foreach ($uidList as $costUid) {
-            if(StlUtil::dictHasProperty($store->yanling,$costUid)){//校验是否是同类型
+            if (StlUtil::dictHasProperty($store->yanling, $costUid)) {//校验是否是同类型
                 $confDic = GameConfig::item_yanling_getItem($costUid);
-                if($confDic->type != GameConfig::item_yanling_getItem($yanlingUid)->type){
+                if ($confDic->type != GameConfig::item_yanling_getItem($yanlingUid)->type) {
                     $tag = false;
                     break;
-                }                
+                }
             } else {
                 $tag = false;
                 break;
             }
         }
-        
-        if(!$tag){
+
+        if (!$tag) {
             return Resp::err(ErrCode::hero_yanling_notfound);
         }
-             
+
         $exp = 0;
         foreach ($uidList as $costuid) {
             $confDic = GameConfig::item_yanling_getItem($costuid);
             $exp += $confDic->addStarExp;
-            
+
             StlUtil::dictRemove($store->yanling, $costuid);
         }
-        
+
         $store->yanling->$yanlingUid->curStarExp += $exp;
         $dic = GameConfig::item_yanling_getItem($store->yanling->$yanlingUid->typeId);
-        
-        if($store->yanling->$yanlingUid->curStarExp >= $dic->maxStarExp){
+
+        if ($store->yanling->$yanlingUid->curStarExp >= $dic->maxStarExp) {
             $store->yanling->$yanlingUid->curStarExp = 0;
             $store->yanling->$yanlingUid->starLv += 1;
-            if($dic->nextId = 0){
+            if ($dic->nextId = 0) {
                 $store->yanling->$yanlingUid->starLv = 5;
             }
         }
-        
-        $req->userInfo->game->store = $store;                                     
-        UserProc::updateUserInfo();   
-        return Resp::ok(array('store' => $req->userInfo->game->store,)); 
-    }
 
+        $req->userInfo->game->store = $store;
+        UserProc::updateUserInfo();
+        return Resp::ok(array('store' => $req->userInfo->game->store,));
+    }
 
     /**
      * 言灵升级
      * @param req $req
      */
     static function YanlinUpLevel($req) {
-        list($yanlingUid,$type) = $req->paras;
+        list($yanlingUid, $type) = $req->paras;
         $store = $req->userInfo->game->store;
-        if(!StlUtil::dictHasProperty($store->yanling,$yanlingUid)){
+        if (!StlUtil::dictHasProperty($store->yanling, $yanlingUid)) {
             return Resp::err(ErrCode::hero_yanling_notfound);
         }
         $curlv = $store->yanling->$yanlingUid->level;
         $maxLv = $curlv + $type;
-       
+
         for ($index = $curlv; $index < $maxLv; $index++) {
-            $mo = GameConfig::yanlingLeve_getItem($index); 
-            $costList = explode(';', $mo->cost);             
+            $mo = GameConfig::yanlingLeve_getItem($index);
+            $costList = explode(';', $mo->cost);
             foreach ($costList as $item) {
                 $list = explode(',', $item);
-                if($list[0] == META_GOLD_ITEMID){//扣金币
+                if ($list[0] == META_GOLD_ITEMID) {//扣金币
                     Data_UserGame::Consume_Gold($req->userInfo->game->baseInfo, $list[1]);
                 } elseif ($list[0] == META_RESPOINT_ITEMID) {//扣除资源点
-                    Data_UserGame::Consume_ResPoint($req->userInfo->game->baseInfo,  $list[1]);
+                    Data_UserGame::Consume_ResPoint($req->userInfo->game->baseInfo, $list[1]);
                 }
-            }                            
-            
+            }
         }
-        
+
         $store->yanling->$yanlingUid->level += $type;
-        $req->userInfo->game->store = $store;   
-        
-        UserProc::updateUserInfo();   
-        return Resp::ok(array('store' => $req->userInfo->game->store,'gold'=>$req->userInfo->game->baseInfo->gold,'resPoint'=>$req->userInfo->game->baseInfo->resPoint));
+        $req->userInfo->game->store = $store;
+
+        UserProc::updateUserInfo();
+        return Resp::ok(array('store' => $req->userInfo->game->store, 'gold' => $req->userInfo->game->baseInfo->gold, 'resPoint' => $req->userInfo->game->baseInfo->resPoint));
     }
+
 //
 // <editor-fold defaultstate="collapsed" desc="计算战队战斗力, for pvp back matchers, -wg 2017.07.13">