From fdda19a424007b36196501ae9f828b8978b3f5f0 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期六, 20 四月 2019 15:14:55 +0800
Subject: [PATCH] 6459 【后端】【2.0】缥缈仙域开发单(增加请求进入跨服CD,暂定5秒)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_CrossRealmReg.py | 3 ++-
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py | 21 +++++++++++++++++----
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py | 1 +
3 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 6075bcf..9582bcb 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3067,6 +3067,7 @@
Def_PlayerKey_TransMoneyType = 'TransMoneyType' # 扣除的金钱类型
Def_PlayerKey_TransTick = 'TransTick' # 传送tick
Def_PlayerKey_SyncVIPKillNPCLVInfo = 'SyncVIPKillNPCLVInfo' # 击杀NPC增加VIP杀怪等级经验信息同步开关
+Def_PlayerKey_RequestEnterCrossServerTick = 'RequestEnterCrossServerTick' # 上次请求进入跨服tick
Def_PlayerKey_FamilyArrestQueryState = 'ArrestQueryState' # 家族悬赏任务完成查询状态
Def_PlayerKey_Frist_Lock = "Frist_Lock" # 是否接受了任务1
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
index 7abbf6a..88d8d75 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -1592,6 +1592,18 @@
if mapID not in ChConfig.Def_CrossMapIDList:
return
+ tick = GameWorld.GetGameWorld().GetTick()
+ lastRequestTick = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_RequestEnterCrossServerTick)
+ if lastRequestTick and tick - lastRequestTick < 5000:
+ GameWorld.DebugLog(" 请求进入跨服CD中!", playerID)
+ NotifyCode(curPlayer, "RequestEnterCrossServerCD")
+ return
+
+ crossRegisterMap = curPlayer.NomalDictGetProperty(ChConfig.Def_PlayerKey_CrossRegisterMap)
+ if crossRegisterMap:
+ GameWorld.ErrLog("跨服已经在上传数据,不重复提交!crossRegisterMap=%s,mapID=%s" % (crossRegisterMap, mapID), playerID)
+ return
+
if GameWorld.IsCrossServer():
GameWorld.DebugLog("跨服服务器不允许该操作!")
return
@@ -1626,7 +1638,6 @@
if ret != ShareDefine.EntFBAskRet_OK:
return
- tick = GameWorld.GetGameWorld().GetTick()
if not FBLogic.OnEnterFBEvent(curPlayer, mapID, lineID, tick):
GameWorld.DebugLog(" OnEnterFBEvent False!", curPlayer.GetPlayerID())
NotifyCode(curPlayer, "SingleEnterDefaul")
@@ -1645,9 +1656,11 @@
if extendInfo:
msgDict.update(extendInfo)
GameWorld.SendMsgToCrossServer(ShareDefine.ClientServerMsg_EnterFB, msgDict)
- return
-
- GY_Query_CrossRealmReg.RegisterEnterCrossServer(curPlayer, mapID, lineID=lineID)
+ else:
+ isSend = GY_Query_CrossRealmReg.RegisterEnterCrossServer(curPlayer, mapID, lineID=lineID)
+ if not isSend:
+ return
+ curPlayer.SetDict(ChConfig.Def_PlayerKey_RequestEnterCrossServerTick, tick)
return
##玩家进入副本
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_CrossRealmReg.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_CrossRealmReg.py
index 3797090..b01ff53 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_CrossRealmReg.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_CrossRealmReg.py
@@ -111,7 +111,7 @@
curPlayer.SendMergeRegisterPlayerAfterChange(CrossRealmPlayer.GetCrossPlayerName(curPlayer), mapID, dataMapID, copyMapID, posX, posY)
GameWorld.Log(" 发送跨服玩家数据注册: registerMap=%s,lineID=%s,zoneID=%s,mapID=%s,dataMapID=%s,copyMapID=%s,posX=%s,posY=%s,GetVsRoomId=%s"
% (registerMap, lineID, zoneID, mapID, dataMapID, copyMapID, posX, posY, curPlayer.GetVsRoomId()), playerID)
- return
+ return True
## 跨服赛报名结果(上传数据)
# @param index 玩家索引
@@ -122,6 +122,7 @@
curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
registerMap = curPlayer.NomalDictGetProperty(ChConfig.Def_PlayerKey_CrossRegisterMap)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PlayerKey_CrossRegisterMap, 0)
+ curPlayer.SetDict(ChConfig.Def_PlayerKey_RequestEnterCrossServerTick, 0)
playerID = curPlayer.GetPlayerID()
result = registerResult.GetResult()
GameWorld.Log("GameServer_MergeRegisterResult registerMap=%s,result=%s" % (registerMap, result), playerID)
--
Gitblit v1.8.0