Browse Source

mod: 玩家PVP数据调整.

gwang 5 years ago
parent
commit
69d45d23d0

+ 1 - 0
Gameserver/Amfphp/model/User/UserGameModel.php

@@ -184,6 +184,7 @@ class UserGameModel extends HashSaver {
         $this->store->initialize();                                             # 添加默认物品
         $this->privateState->currentId = count((array) $this->store->equipment) + 1;
         $this->heros->InitializeHero();                                         # 添加初始英雄
+        $this->pvp = new UserPVPModel();
     }
 
     /**

+ 3 - 14
Gameserver/Amfphp/model/User/UserPVPModel.php

@@ -20,7 +20,7 @@ class UserPVPModel extends Object_ext {
     /**
      * @var object 防守阵容 
      */
-    public $defTeam;
+    public $defTeam = array();
 
     /**
      * @var int 竞技币
@@ -67,29 +67,18 @@ class UserPVPModel extends Object_ext {
      */
     public $haventReward_season = 0;
 
-    /**
-     * 刷新竞技商店道具列表
-     */
-    public function refreshShopItem() {
-        if ($this->shopRefreshTs <= now()) {                                       # 刷新ts<now(), 该刷新了
-            // ...            
-        }
-    }
-
     public function refreshDailyData() {
         // 刷新免费挑战次数
         if (tsDay($this->fightTicketRefreshTs) <= tsDay()) {                    # 刷新时间<=今天,该刷新了
             $this->freeFightTickets = 3;                                        # 重置为3, 此处的3可以改为读取配置数据
             $this->fightTicketRefreshTs = now() + 86400;                        # 刷新时间设置为明天 
         }
-        // 刷新商店道具列表
-        $this->refreshShowItem();
     }
 
     public function __construct($arg) {
         parent::__construct($arg);
-        if (null == $this->defTeam) {
-            $this->defTeam = JsonUtil::decode('{"heros":[]}');
+        if (null == $this->curShopItems) {
+            $this->curShopItems = GameConfig::pvp_shop();
         }
     }
 

+ 3 - 3
Gameserver/Amfphp/process/FightProc/PVPProc.php

@@ -315,6 +315,7 @@ class PVPProc {
         $uid = $req->uid;                                                       # 快速访问UID
         $zoneid = $req->zoneid;                                                 # 快速访问zoneid
         $pvp = new UserPVPModel($req->userInfo->game->pvp);                     # 设计玩家pvp数据结构
+        $pvp->refreshDailyData();                                               # 刷新免费挑战次数
         $seasonId = self::GetCurSeasonID();                                     # 当前赛季ID
         $key = MemKey_GameRun::Game_PVPScoreByZoneSeason_zset($zoneid, $seasonId); # 积分总榜
 
@@ -440,9 +441,8 @@ class PVPProc {
     public static function pvp_setTeam($req) {
         $heros = $req->paras[0];                                                # para: 新阵容
         $pvp = new UserPVPModel($req->userInfo->game->pvp);
-        if (is_array($heros)) {                                                 # 更新阵容
-            $pvp->defTeam->heros = $heros;
-        }
+        my_Assert(is_array($heros), ErrCode::paras_err);                        # 参数检查
+        $pvp->defTeam = $heros;                                                 # 更新阵容
         $req->userInfo->game->pvp = $pvp;
         UserProc::updateUserInfo();                                             # 回存数据
         return Resp::ok($pvp->defTeam);                                         # 返回

+ 3 - 2
Gameserver/nbproject/private/private.xml

@@ -13,10 +13,11 @@
     <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
         <group>
             <file>file:/E:/www/ylsj2019/Gameserver/Amfphp/model/User/UserPVPModel.php</file>
-            <file>file:/E:/www/ylsj2019/Gameserver/Amfphp/base/CmdCode.php</file>
+            <file>file:/E:/www/ylsj2019/Gameserver/Amfphp/process/EmailProc.php</file>
             <file>file:/E:/www/ylsj2019/Gameserver/Amfphp/process/FightProc/PVPProc.php</file>
-            <file>file:/E:/www/ylsj2019/Gameserver/Amfphp/base/MemKey_GameRun.php</file>
+            <file>file:/E:/www/ylsj2019/Gameserver/Amfphp/service_call/pay/official/alipay/aop/AopClient.php</file>
             <file>file:/E:/www/ylsj2019/Gameserver/Amfphp/test.php</file>
+            <file>file:/E:/www/ylsj2019/Gameserver/Amfphp/service_call/pay/official/alipay/notify.php</file>
             <file>file:/E:/www/ylsj2019/Gameserver/Amfphp/model/Const/globalsettings.php</file>
             <file>file:/E:/www/ylsj2019/Gameserver/Amfphp/process/FightProc.php</file>
         </group>