From 3ae8c1cc2fb821f554aa57e63525ce85135fc1c2 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 29 五月 2019 13:59:29 +0800
Subject: [PATCH] 6970 【2.0】【后端】缥缈仙域仙草园(修复草园中下线重上会看到其他NPC的bug) 修复跨服复活bug、进出跨服的视野管理由原来的设置不可见改为按视野层级管理;

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
index a2d2c12..d07bd51 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -1033,11 +1033,10 @@
     __CheckClearBuffOnMapChange(curPlayer, tick)
             
     #刷新玩家的视野
-    if not GameWorld.IsCrossServer() and (PlayerControl.GetCrossMapID(curPlayer) or curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene)):
+    if not GameWorld.IsCrossServer() and (PlayerControl.GetCrossMapID(curPlayer) or PlayerControl.GetCustomMapID(curPlayer)):
         GameWorld.DebugLog("===登录本服地图时,处于跨服或自定义场景状态,不刷新视野!", curPlayer.GetPlayerID())
         PlayerControl.SetPlayerSightLevel(curPlayer, curPlayer.GetID())
-    if curPlayer.GetLV() > 1:
-        PlayerState.ChangePlayerSigh(curPlayer, tick)
+    PlayerState.ChangePlayerSigh(curPlayer, tick)
     
     if GameWorld.IsCrossServer():
         curPlayer.SetForbiddenSyncClientState(False)
@@ -1404,10 +1403,10 @@
         #刷新自己的视野
         if not GameWorld.IsCrossServer() and (PlayerControl.GetCrossMapID(curPlayer) or curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene)):
             GameWorld.DebugLog("===本服LoadMapOK时玩家处于跨服或自定义场景状态,不设置可见!", curPlayer.GetPlayerID())
-        else:
-            curPlayer.RefreshView()
-            curPlayer.SetVisible(True)
-    
+            PlayerControl.SetPlayerSightLevel(curPlayer, curPlayer.GetID())
+        curPlayer.RefreshView()
+        curPlayer.SetVisible(True)
+        
     #如果玩家hp为0,设置玩家为死亡状态
     if curPlayer.GetHP() <= 0:
         curPlayer.SetPlayerAction(IPY_GameWorld.paDie)
@@ -2454,7 +2453,7 @@
         GameWorld.DebugLog("当前无跨服地图!")
         return
     
-    if not __CheckCanReborn(curPlayer, rebornType):
+    if not __CheckCanReborn(curPlayer, rebornType, checkHPState=False):
         return
     
     msgDict = {"PlayerID":curPlayer.GetPlayerID(), "RebornType":rebornType}
@@ -4089,12 +4088,12 @@
 
 #---------------------------------------------------------------------
 
-def __CheckCanReborn(curPlayer, rebornType, gameMap=None):
+def __CheckCanReborn(curPlayer, rebornType, gameMap=None, checkHPState=True):
     ''' 检查可否复活,为了逻辑统一,这里不适用玩家所在的地图,支持跨服状态下判断跨服地图
                 本函数不验证玩家死亡状态等,因为有可能前后端复活状态不一致,如果这里拦住可能导致前端躺尸复活不了
     '''
-
-    if curPlayer.GetHP() > 0 and curPlayer.GetPlayerAction() != IPY_GameWorld.paDie:
+    
+    if checkHPState and curPlayer.GetHP() > 0 and curPlayer.GetPlayerAction() != IPY_GameWorld.paDie:
         # 当血量大于0收到复活请求时,一般是前后端复活状态不一致的情况下导致的
         # 由于前端需要根据复活状态判断复活界面相关逻辑,所以这里需要做一些特殊处理,防止某些情况下前后端复活状态不一致导致的一些异常问题
         # 后端非死亡状态的情况,补同步一次复活包给前端

--
Gitblit v1.8.0