Преглед на файлове

1. fixed: 查询对手信息, heros返回的就是战队中的英雄, 其他英雄经过服务端筛选,不返回.

gwang преди 5 години
родител
ревизия
544194ceb4
променени са 2 файла, в които са добавени 15 реда и са изтрити 2 реда
  1. 1 1
      Gameserver/Amfphp/base/MemKey_GameRun.php
  2. 14 1
      Gameserver/Amfphp/process/FightProc/PVPProc.php

+ 1 - 1
Gameserver/Amfphp/base/MemKey_GameRun.php

@@ -147,7 +147,7 @@ class MemKey_GameRun {
      * @param type $zoneid
      */
     public static function Game_FightPowerRank_zset($zoneid) {
-        return "gamerun-rank-fightpower-zone$zoneid";
+        return "gamerun-rank-fpower-zone$zoneid";
     }
 
     /**

+ 14 - 1
Gameserver/Amfphp/process/FightProc/PVPProc.php

@@ -19,6 +19,19 @@ class PVPProc {
         // 参数: 无
         $targetUID = $req->paras[0];                                            # 对手的UID
         $uinfo = UserProc::getUserInfo($req->mem, $req->zoneid, $targetUID);    # 读取玩家信息
+        if (null == $uinfo) {
+            Err(ErrCode::user_no_err);
+        }
+        $team = JsonUtil::decode($uinfo->game->heroTeamConfig);
+        var_dump($team);
+        $heros = new \stdClass();
+        $curTeamId = $team->curUseTeamID;
+        foreach ($team->teamDic->$curTeamId->heros as $hid) {
+            if ($hid > 0) {
+                $heros->$hid = $uinfo->game->heros->collectHeros->$hid;
+            }
+        }
+
         $adversary = array(#                                                    # 拼装玩家信息
             'uid' => $targetUID,
             'name' => my_null_default($uinfo->game->name, ""),
@@ -27,7 +40,7 @@ class PVPProc {
 //            'skills' => null, #                                                  # skills暂时没有实例数据 
             'equipment' => my_null_default($uinfo->game->store->equipment, new \stdClass()), # 武器
             'yanling' => my_null_default($uinfo->game->store->yanling, new \stdClass()), # 言灵
-            'heros' => my_null_default($uinfo->game->heros->collectHeros, new \stdClass()), # 英雄集合
+            'heros' => my_null_default($heros, new \stdClass()), #              # 英雄集合
         );
 
         $result = array(#                                                       # 拼装返回值