From 545986a8fdde345b28cf3004be84c6cfe79a3dc1 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 19 四月 2019 11:29:12 +0800
Subject: [PATCH] 6459 【后端】【2.0】缥缈仙域开发单(跨服分区逻辑优化,支持跨服妖王分区状态同步)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py | 24 ++++++++++++++++++------
1 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py
index 6a26e61..67302b1 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py
@@ -21,6 +21,7 @@
import NetPackCommon
import ShareDefine
import GameWorld
+import GameLogic_CrossGrassland
import PlayerControl
import IpyGameDataPY
import PlayerActivity
@@ -35,9 +36,9 @@
(
FDEventType0,
FDEventType1,
-FDEventType2,
+FDEventType_GrasslandXian,
FDEventType3,
-FDEventType4,
+FDEventType_GrasslandLing,
) = range(5)
(
@@ -168,7 +169,8 @@
for i in xrange(maxEventCnt):
fdEventID = fdEventIDList[i] if i < len(fdEventIDList) else 0
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainEventID % i, fdEventID)
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainEventState % fdEventID, FDEventState_CanVisit)
+ if fdEventID:
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainEventState % fdEventID, FDEventState_CanVisit)
#设置寻访中
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainState, 1)
#设置初始体力
@@ -235,6 +237,11 @@
GameWorld.Log('缥缈仙域事件状态设置,体力不足!,fdeventID=%s, costEnergy=%s, curEnergy=%s' % (fdeventID, costEnergy, curEnergy))
return
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainEnergy, curEnergy - costEnergy)
+
+ # 草园重置
+ if ipyData.GetEventType() in [FDEventType_GrasslandXian, FDEventType_GrasslandLing]:
+ GameLogic_CrossGrassland.DoResetCrossGrassland(curPlayer, ipyData.GetEventType(), fdeventID)
+
elif state == FDEventState_Visited:
if curState != FDEventState_Visiting:
GameWorld.Log('缥缈仙域事件状态设置错误,fdeventID=%s, state=%s, curState=%s' % (fdeventID, state, curState))
@@ -247,20 +254,23 @@
def NotifyVisitFairyDomainInfo(curPlayer, fdEventList=[], isAll=1):
if not fdEventList:
+ syncFDEventList = []
otherCntRateList = IpyGameDataPY.GetFuncEvalCfg('ImmortalDomain', 2)
maxEventCnt = max([info[1] for info in otherCntRateList]) + 1 #最大可出现事件个数
for i in xrange(maxEventCnt):
fdEventID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainEventID % i)
if fdEventID:
- fdEventList.append(fdEventID)
-
+ syncFDEventList.append(fdEventID)
+ else:
+ syncFDEventList = fdEventList
+
packData = ChPyNetSendPack.tagMCFairyDomainInfo()
packData.IsAll = isAll
packData.State = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainState)
packData.Energy = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainEnergy)
packData.VisitCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainVisitCnt)
packData.InfoList = []
- for fdeventID in fdEventList:
+ for fdeventID in syncFDEventList:
fdeventData = ChPyNetSendPack.tagMCFairyDomainEvent()
fdeventData.EventID = fdeventID
fdeventData.EventState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainEventState % fdeventID)
@@ -281,6 +291,8 @@
maxEventCnt = max([info[1] for info in otherCntRateList]) + 1 #最大可出现事件个数
for i in xrange(maxEventCnt):
fdEventID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainEventID % i)
+ if fdEventID not in AdventuresTypeList:
+ continue
adventuresdata = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyAdventuresData % fdEventID)
if not adventuresdata:
continue
--
Gitblit v1.8.0