From 5619e084f4f0e33e30d92cfe5c9ab78c13243171 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 12 九月 2019 19:53:48 +0800
Subject: [PATCH] 8262 【主干】【后端】仙盟宴会及传功优化

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyParty.py |  284 +++++++++++++++++---------------------------------------
 1 files changed, 89 insertions(+), 195 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyParty.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyParty.py
index 8e6064a..9f102df 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyParty.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyParty.py
@@ -24,7 +24,6 @@
 import GameWorld
 import PlayerFamily
 import IpyGameDataPY
-import GameWorldProcess
 import PlayerFairyCeremony
 import PlayerNewFairyCeremony
 import PlayerActLogin
@@ -34,39 +33,30 @@
 import ItemControler
 import Item_AddLV
 import PlayerTalk
-
-#当前副本地图的状态
-(
-FB_Step_Open,  # 地图开启
-FB_Step_Fighting,  # 战斗中
-FB_Step_Over,  # 副本关闭
-) = range(3)
+import PlayerActivity
 
 #---战盟副本---
-Map_FamilyPartyFB_StartTick = "Map_FamilyPartyFB_StartTick"  # 副本开始时间
-GameFBDict_LastEnterFbDay = 'LastEnterFbDay_%s'  #上次进入活动的开服天
-FBPlayerDict_TotalExp = 'XMYH_TotalExp%s'  # 获得的总经验
-FBPlayerDict_TotalExpPoint = 'XMYH_TotalExpPoint%s'  # 获得的总经验点
-FBPlayerDict_TotalPoint = 'XMYH_TotalPoint%s'  # 获得的总仙盟贡献值
-FBPlayerDict_HasCollect = 'XMYH_HasCollect%s'  # 是否已采集
-FBPlayerDict_HasSit = 'XMYH_HasSit%s'  # 是否已传功
 FBPlayerDict_TagPlayerID = 'XMYH_TagPlayerID%s'  # 邀请传功目标玩家ID
-FBPlayerDict_HelpCount = 'XMYH_HelpCount%s'  # 已经帮助传功次数
 
-g_familyMapPlayerIDDict = {}#{lineid:[playerid,..]}
-def OnFBPlayerOnDay(curPlayer):
+g_familyMapPlayerIDDict = {}#{lineID:[playerID,..]}
+
+def OnDayFamilyPartyPlayer(curPlayer):
+    GameWorld.DebugLog("重置仙盟宴会相关数据,含传功!", curPlayer.GetPlayerID())
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartyJoinSign, 0)
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartyAnswerCnt, 0)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartySitState, 0)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartyHelpSitCount, 0)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartyCollectState, 0)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartyTotalExp, 0)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartyTotalExpPoint, 0)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartyTotalPoint, 0)
     return
-
 
 ##开启副本
 # @param tick 时间戳
 # @return 返回值无意义
 # @remarks 开启副本
 def OnOpenFB(tick):
-    gameFB = GameWorld.GetGameFB()
-    gameFB.ClearAllPlayerGameFBDict()  # 清除所有玩家对应的副本字典信息
-    gameFB.SetGameFBDict(ChConfig.Map_FBDict_NotifyStart, 0)
     return
 
 
@@ -75,8 +65,9 @@
 # @return 无意义
 # @remarks 
 def OnCloseFB(tick):
-    #副本踢出玩家
-    FBCommon.DoLogic_FBKickAllPlayer()
+    global g_familyMapPlayerIDDict
+    lineID = GameWorld.GetGameWorld().GetLineID()
+    g_familyMapPlayerIDDict.pop(lineID, None)
     return
 
 
@@ -121,26 +112,6 @@
 # @param tick 时间戳
 # @return
 def OnChangeMapAsk(ask, tick):
-    GameWorld.DebugLog("OnChangeMapAsk  CopyMapID=%s" % (ask.GetCopyMapID()))
-    playerIDStr = ask.GetMsg()
-    GameWorld.DebugLog("OnChangeMapAsk playerIDStr=%s" % playerIDStr)
-    #携带玩家ID入场
-    if playerIDStr in ['', '0']:
-        return IPY_GameWorld.cmeCustom
-    playerID = int(playerIDStr)
-#    
-#    # 判断是否已经进场过
-#    gameFB = GameWorld.GetGameFB()
-#    fbStep = gameFB.GetFBStep()
-#
-#    GameWorld.DebugLog("OnChangeMapAsk fbStep=%s" % fbStep)
-#    # 超过准备阶段,如果已经进去过不让再进
-#    openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay)
-#    isEnter = GameWorld.GetGameWorld().GetGameWorldDictByKey(GameFBDict_LastEnterFbDay % playerID) == openServerDay + 1
-#    GameWorld.DebugLog("OnChangeMapAsk isEnter=%s" % isEnter)
-#    if isEnter:
-#        return IPY_GameWorld.cmeCustom, "GeRen_liubo_676165"
-    #可进入
     return IPY_GameWorld.cmeAccept
 
 
@@ -156,35 +127,12 @@
     if not __CheckEnter(curPlayer, mapID):
         PlayerControl.PlayerLeaveFB(curPlayer)
         return
-    gameFB = GameWorld.GetGameFB()
-    gameWorld = GameWorld.GetGameWorld()
     
-    closeFB_RemainTick = __GetRemainTick(tick)
-    if not closeFB_RemainTick:
-        PlayerControl.PlayerLeaveFB(curPlayer)
-        return
-    curPlayer.Sync_TimeTick(IPY_GameWorld.tttTowerTake, 0, closeFB_RemainTick, True) 
-    GameWorld.DebugLog('closeFB_RemainTick=%s' % closeFB_RemainTick)
-       
-    openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay)
-    if gameWorld.GetGameWorldDictByKey(GameFBDict_LastEnterFbDay % playerID) != openServerDay + 1:
-        gameWorld.SetGameWorldDict(GameFBDict_LastEnterFbDay % playerID, openServerDay + 1)
-        gameWorld.SetGameWorldDict(FBPlayerDict_TotalExp % playerID, 0)
-        gameWorld.SetGameWorldDict(FBPlayerDict_TotalExpPoint % playerID, 0)
-        gameWorld.SetGameWorldDict(FBPlayerDict_TotalPoint % playerID, 0)
-        gameWorld.SetGameWorldDict(FBPlayerDict_HasCollect % playerID, 0)
-        gameWorld.SetGameWorldDict(FBPlayerDict_HasSit % playerID, 0)
-        gameWorld.SetGameWorldDict(FBPlayerDict_TagPlayerID % playerID, 0)
-        gameWorld.SetGameWorldDict(FBPlayerDict_HelpCount % playerID, 0)
+    gameWorld = GameWorld.GetGameWorld()
+    partyActionState = gameWorld.GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_DailyActionState % ShareDefine.DailyActionID_FamilyParty)
+    if partyActionState:
+        __DoEnterJoinFamilyParty(curPlayer)
         
-        FBCommon.ClearAreaRewardRecord(playerID)
-        
-        FBCommon.AddEnterFBCount(curPlayer, ChConfig.Def_FBMapID_FamilyParty)
-        PlayerFamily.AddFamilyActivity(curPlayer, ShareDefine.FamilyActive_Party)
-        EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_FamilyParty, 0, ChConfig.CME_Log_Start)
-        PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_FamilyParty, 1)
-        PlayerNewFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_FamilyParty, 1)
-        PlayerActLogin.AddLoginAwardActionCnt(curPlayer, ChConfig.Def_LoginAct_FamilyParty, 1)
     lineID = GameWorld.GetGameWorld().GetLineID()
     if lineID not in g_familyMapPlayerIDDict:
         g_familyMapPlayerIDDict[lineID] = []
@@ -197,17 +145,30 @@
         if not curPlayer:
             continue
         DoFBHelp(curPlayer, tick, True)
-    
+        
     return
 
+def __DoEnterJoinFamilyParty(curPlayer):
+    ## 玩家正式开始参与仙盟宴会,因为多个仙盟活动可能共用该地图,玩家可能活动开始时已经在该地图
+    if curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyPartyJoinSign):
+        return
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartyJoinSign, 1)
+    
+    GameWorld.DebugLog("玩家参加仙盟宴会!", curPlayer.GetPlayerID())
+    #FBCommon.AddEnterFBCount(curPlayer, ChConfig.Def_FBMapID_FamilyParty)
+    PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_FamilyParty)
+    PlayerFamily.AddFamilyActivity(curPlayer, ShareDefine.FamilyActive_Party)
+    EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_FamilyParty, 0, ChConfig.CME_Log_Start)
+    PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_FamilyParty, 1)
+    PlayerNewFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_FamilyParty, 1)
+    PlayerActLogin.AddLoginAwardActionCnt(curPlayer, ChConfig.Def_LoginAct_FamilyParty, 1)
+    return
 
-def __GetRemainTick(tick):
-    ##活动剩余毫秒
-    mapID = GameWorld.GetMap().GetMapID()
-    startTick = GameWorld.GetGameWorld().GetGameWorldDictByKey(Map_FamilyPartyFB_StartTick)
-    closeFB_RemainTick = max(0, FBCommon.GetFBLineStepTime(mapID)[0] * 1000 - (tick - startTick))
-    return closeFB_RemainTick
-
+## 是否可以获得副本地图区域经验
+def OnCanGetAreaExp(curPlayer):
+    gameWorld = GameWorld.GetGameWorld()
+    partyActionState = gameWorld.GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_DailyActionState % ShareDefine.DailyActionID_FamilyParty)
+    return partyActionState
 
 ##副本定时器
 # @param tick 时间戳
@@ -217,46 +178,17 @@
     familyID = GameWorld.GetGameWorld().GetPropertyID()
     if not familyID:
         return
-    gameFB = GameWorld.GetGameFB()
-    fbStep = gameFB.GetFBStep()
-
-    #GameWorld.DebugLog("    OnProcess...")
-    if fbStep == FB_Step_Open:
-        if FBCommon.GetFBFuncOpenState(ChConfig.Def_FBMapID_FamilyParty):
-            FBCommon.SetFBStep(FB_Step_Fighting, tick)
-    elif fbStep == FB_Step_Fighting:
-        if not FBCommon.GetFBFuncOpenState(ChConfig.Def_FBMapID_FamilyParty):
-            FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0)
-            PyGameData.g_familyPartyInfo = []
-            FBCommon.SetFBStep(FB_Step_Over, tick)
-            #FBCommon.DoLogic_FBKickAllPlayer()
-            #GameWorldProcess.CloseFB(tick)
-        else:
-            #FBCommon.DoLogicAreaReward("FamilyPartyAreaAward", tick)
-            FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 5000)
-            
-            mapID = GameWorld.GetMap().GetMapID()
-            notifyIndex = gameFB.GetGameFBDictByKey(ChConfig.Map_FBDict_NotifyStart)
-            notifySecondList = FBCommon.GetFBLineStepTime(mapID)[1]
-            if notifyIndex < len(notifySecondList):
-                notifySecond = notifySecondList[notifyIndex]
-                remaindTick = max(0, __GetRemainTick(tick) - 1000)
-                if remaindTick <= (notifySecond + 1) * 1000:   
-                    #remaindSecond = remaindTick / 1000
-                    
-                    PlayerControl.FamilyNotify(familyID, "Party_OverTime", [notifySecond])
-                     
-                    GameWorld.GetGameFB().SetGameFBDict(ChConfig.Map_FBDict_NotifyStart, notifyIndex + 1)
-            
+    
+    gameWorld = GameWorld.GetGameWorld()
+    partyActionState = gameWorld.GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_DailyActionState % ShareDefine.DailyActionID_FamilyParty)
+    if partyActionState:
+        FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 5000)
+        
     return
 
 
 def FamilyPartyAnswerRight(curPlayer):
     #回答正确,给奖励
-#    mapID = GameWorld.GetMap().GetMapID()
-#    if mapID != ChConfig.Def_FBMapID_FamilyParty:
-#        return
-#    
     
     addPoint, addExp = IpyGameDataPY.GetFuncEvalCfg('PartyReward', 2)
     #仙盟贡献度
@@ -274,47 +206,22 @@
 
 def OnFamilyPartyStateChange(state, tick):
     #活动状态变更
-    GameWorld.DebugLog('    仙盟宴会活动状态变更 state=%s' % state)
-#    if state == 0:
-#        playerManager = GameWorld.GetPlayerManager()
-#        for i in xrange(playerManager.GetPlayerCount()):
-#            curPlayer = playerManager.GetPlayerByIndex(i)
-#            if not curPlayer or curPlayer.IsEmpty():
-#                continue
-#            #答对题或者进过图的给参与奖励
-#            curAnswerCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyPartyAnswerCnt)
-#            if FBCommon.GetEnterFBCount(curPlayer, ChConfig.Def_FBMapID_FamilyParty) or curAnswerCnt:
-#                GiveJoinPrize(curPlayer)
-    
     mapID = GameWorld.GetMap().GetMapID()
     if mapID != ChConfig.Def_FBMapID_FamilyParty:
         return
-
-    if state:
-        if not GameWorld.GetGameWorld().GetGameWorldDictByKey(Map_FamilyPartyFB_StartTick):
-            GameWorld.GetGameWorld().SetGameWorldDict(Map_FamilyPartyFB_StartTick, tick)
+    
+    GameWorld.DebugLog('仙盟宴会活动状态变更 state=%s' % state)
+    if state == 1:
+        playerManager = GameWorld.GetPlayerManager()
+        for i in xrange(playerManager.GetPlayerCount()):
+            curPlayer = playerManager.GetPlayerByIndex(i)
+            if not curPlayer or curPlayer.IsEmpty():
+                continue
+            __DoEnterJoinFamilyParty(curPlayer)
     else:
-        GameWorld.GetGameWorld().SetGameWorldDict(Map_FamilyPartyFB_StartTick, 0)
+        PyGameData.g_familyPartyInfo = []
+        
     return
-
-#
-#def GiveJoinPrize(curPlayer):
-#    #参与奖
-#    joinAward = IpyGameDataPY.GetFuncCfg('PartyReward')
-#    if not joinAward:
-#        return
-#    
-#    PlayerFamily.AddPlayerFamilyActiveValue(curPlayer, joinAward, True, ShareDefine.Def_AddFAVReason_FamilyParty)
-#    return
-
-
-##获得玩家传入副本需要携带的信息
-# @param curPlayer 玩家实例
-# @param lineId 分线ID
-# @return 字符串
-# @remarks
-def GetPlayerResetWorldPosFBMsg(curPlayer, lineId):
-    return '%s' % (curPlayer.GetPlayerID())
 
 
 ##玩家退出家族处理
@@ -323,17 +230,8 @@
 # @return 返回值无意义
 def OnLeaveFamily(curPlayer, tick):
     #GameWorld.DebugLog("OnLeaveFamily...")
-    curPlayerID = curPlayer.GetPlayerID()
-        
     PlayerControl.PlayerLeaveFB(curPlayer)
     return
-
-
-## 是否副本复活
-#  @param None
-#  @return 是否副本复活
-def OnPlayerReborn():
-    return True
 
 
 ##获得副本帮助信息
@@ -342,23 +240,24 @@
 # @return 无意义
 # @remarks 用于通知阵营比分条
 def DoFBHelp(curPlayer, tick, isSyncPlayerID=False):
-    #gameFB = GameWorld.GetGameFB()
     gameWorld = GameWorld.GetGameWorld()
+    chuangongActionState = gameWorld.GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_DailyActionState % ShareDefine.DailyActionID_FamilyChuanGong)
+    partyActionState = gameWorld.GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_DailyActionState % ShareDefine.DailyActionID_FamilyParty)
+    
     playerID = curPlayer.GetPlayerID()
-    totalExp = FBCommon.GetFBAreaRewardExp(gameWorld, playerID)
     curAnswerCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyPartyAnswerCnt)
     addPoint, addExp = IpyGameDataPY.GetFuncEvalCfg('PartyReward', 2)
-    exp = gameWorld.GetGameWorldDictByKey(FBPlayerDict_TotalExp % playerID)
-    expPoint = gameWorld.GetGameWorldDictByKey(FBPlayerDict_TotalExpPoint % playerID)
-    totalExp = totalExp + expPoint * ChConfig.Def_PerPointValue + exp + addExp * curAnswerCnt
+    exp = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyPartyTotalExp)
+    expPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyPartyTotalExpPoint)
+    totalExp = expPoint * ChConfig.Def_PerPointValue + exp + addExp * curAnswerCnt
     exp = totalExp % ChConfig.Def_PerPointValue
     expPoint = totalExp / ChConfig.Def_PerPointValue
     
-    totalPoint = gameWorld.GetGameWorldDictByKey(FBPlayerDict_TotalPoint % playerID)
+    totalPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyPartyTotalPoint)
     #totalPoint += IpyGameDataPY.GetFuncCfg('PartyReward') #加参与奖
     totalPoint += addPoint * curAnswerCnt
-    hasCollect = gameWorld.GetGameWorldDictByKey(FBPlayerDict_HasCollect % playerID)
-    hasSit = gameWorld.GetGameWorldDictByKey(FBPlayerDict_HasSit % playerID)
+    hasCollect = int(curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyPartyCollectState) or not partyActionState) # 非活动期间也同步已采集,前端根据此状态控制按钮显隐
+    hasSit = int(curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyPartySitState) or not chuangongActionState) # 非活动期间也同步已传功,前端根据此状态控制按钮显隐
     
     helpDict = {FBCommon.Help_exp:exp, FBCommon.Help_expPoint:expPoint, FBCommon.Help_score:totalPoint, "hasCollect":hasCollect, "hasSit":hasSit}
     if PyGameData.g_familyPartyInfo:
@@ -383,7 +282,11 @@
 # @return 无意义
 # @remarks
 def OnCanCollect(curPlayer, curNPC, tick):
-    hasCollect = GameWorld.GetGameWorld().GetGameWorldDictByKey(FBPlayerDict_HasCollect % curPlayer.GetID())
+    partyActionState = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_DailyActionState % ShareDefine.DailyActionID_FamilyParty)
+    if not partyActionState:
+        PlayerControl.NotifyCode(curPlayer, 'Party_NotInPartyTime')
+        return
+    hasCollect = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyPartyCollectState)
     if hasCollect:
         PlayerControl.NotifyCode(curPlayer, 'Party_HadCollected')
         return
@@ -411,8 +314,8 @@
 # @remarks
 def OnCollectOK(curPlayer, npcID, tick):
     playerID = curPlayer.GetID()
-    gameWorld = GameWorld.GetGameWorld()
-    gameWorld.SetGameWorldDict(FBPlayerDict_HasCollect % playerID, 1)
+    #gameWorld = GameWorld.GetGameWorld()
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartyCollectState, 1)
     
     GameWorld.DebugLog('    宴会采集成功!', playerID)
     #给奖励
@@ -423,9 +326,9 @@
     PlayerControl.NotifyCode(curPlayer, 'Party_CollectSuccess', [addPoint])
     PlayerFamily.AddPlayerFamilyActiveValue(curPlayer, addPoint, True, ShareDefine.Def_AddFAVReason_FamilyParty)
     
-    totalPoint = gameWorld.GetGameWorldDictByKey(FBPlayerDict_TotalPoint % playerID)
+    totalPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyPartyTotalPoint)
     updPoint = totalPoint + addPoint
-    gameWorld.SetGameWorldDict(FBPlayerDict_TotalPoint % playerID, updPoint)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartyTotalPoint, updPoint)
     DoFBHelp(curPlayer, 0)
     return
 
@@ -438,19 +341,13 @@
     
     if expViewType != ShareDefine.Def_ViewExpType_SysEx:
         return
-    gameWorld = GameWorld.GetGameWorld()
-    playerID = curPlayer.GetID() 
-    exp = gameWorld.GetGameWorldDictByKey(FBPlayerDict_TotalExp % playerID)
-    expPoint = gameWorld.GetGameWorldDictByKey(FBPlayerDict_TotalExpPoint % playerID)
-    newTotalExp = expPoint*ChConfig.Def_PerPointValue+exp+addExp
-    gameWorld.SetGameWorldDict(FBPlayerDict_TotalExp % playerID, newTotalExp%ChConfig.Def_PerPointValue)
-    gameWorld.SetGameWorldDict(FBPlayerDict_TotalExpPoint % playerID, newTotalExp/ChConfig.Def_PerPointValue)
-    
-    
-    #GameWorld.DebugLog("OnGetExp() addExp=%s,updTotalExp=%s" 
-    #                   % (addExp, newTotalExp), playerID)
-    
+    exp = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyPartyTotalExp)
+    expPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyPartyTotalExpPoint)
+    newTotalExp = expPoint * ChConfig.Def_PerPointValue + exp + addExp
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartyTotalExp, newTotalExp % ChConfig.Def_PerPointValue)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartyTotalExpPoint, newTotalExp / ChConfig.Def_PerPointValue)
     return
+
 ##玩家退出副本
 # @param curPlayer 玩家实例
 # @param tick 时间戳
@@ -485,7 +382,7 @@
         if curPlayer.GetPlayerAction() in [IPY_GameWorld.paSit, IPY_GameWorld.paPreparing]:
             GameWorld.DebugLog('邀请打坐,玩家已处于打坐或采集状态', playerID)
             return
-        hasSit = gameWorld.GetGameWorldDictByKey(FBPlayerDict_HasSit % playerID)
+        hasSit = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyPartySitState)
         if hasSit:
             GameWorld.Log('邀请打坐,玩家已打坐过一次', playerID)
             return
@@ -516,7 +413,7 @@
     #给打坐奖励
     gameWorld = GameWorld.GetGameWorld()
     playerID = curPlayer.GetID()
-    hasSit = gameWorld.GetGameWorldDictByKey(FBPlayerDict_HasSit % playerID)
+    hasSit = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyPartySitState)
     if hasSit:
         GameWorld.Log('打坐结束给奖励,玩家已打坐过一次', playerID)
         return
@@ -534,14 +431,11 @@
     reExp = PlayerControl.GetPlayerReExp(curPlayer)
     giveExp = eval(IpyGameDataPY.GetFuncCompileCfg('FamilyPartySitAward'))
     if giveExp:
-        giveExp = PlayerControl.PlayerControl(curPlayer).AddExp(giveExp)
-        exp = gameWorld.GetGameWorldDictByKey(FBPlayerDict_TotalExp % playerID)
-        expPoint = gameWorld.GetGameWorldDictByKey(FBPlayerDict_TotalExpPoint % playerID)
-        newTotalExp = expPoint*ChConfig.Def_PerPointValue+exp+giveExp+addExp
-        gameWorld.SetGameWorldDict(FBPlayerDict_TotalExp % playerID, newTotalExp%ChConfig.Def_PerPointValue)
-        gameWorld.SetGameWorldDict(FBPlayerDict_TotalExpPoint % playerID, newTotalExp/ChConfig.Def_PerPointValue)
+        PlayerControl.PlayerControl(curPlayer).AddExp(giveExp, ShareDefine.Def_ViewExpType_SysEx)
         
-    gameWorld.SetGameWorldDict(FBPlayerDict_HasSit % playerID, 1)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartySitState, 1)
+    PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_FamilyChuanGong)
+    DoFBHelp(curPlayer, 0)
     
     #帮助传功奖励
     helpSitActivityAward = IpyGameDataPY.GetFuncEvalCfg('FamilyPartySitAward', 3)
@@ -553,8 +447,8 @@
         PlayerTalk.TalkPrivateByID(curPlayer, tagPlayerID, sitThanks)
         tagPlayer = GameWorld.GetMapCopyPlayerManager().FindPlayerByID(tagPlayerID)
         if tagPlayer:
-            helpCount = gameWorld.GetGameWorldDictByKey(FBPlayerDict_HelpCount % tagPlayerID) + 1
-            gameWorld.SetGameWorldDict(FBPlayerDict_HelpCount % tagPlayerID, helpCount)
+            helpCount = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyPartyHelpSitCount) + 1
+            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartyHelpSitCount, helpCount)
             GameWorld.DebugLog("帮助传功奖励: sitPlayerID=%s,tagPlayerID=%s,helpCount=%s" % (playerID, tagPlayerID, helpCount))
             if helpCount <= maxHelpAwardCount:
                 PlayerControl.GiveMoney(tagPlayer, ShareDefine.TYPE_Price_FamilyActivity, helpFamilyActivity)

--
Gitblit v1.8.0