8262 【主干】【后端】仙盟宴会及传功优化(增加宴会结束倒计时显示)
4个文件已修改
59 ■■■■■ 已修改文件
PySysDB/PySysDBPY.h 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyParty.py 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PySysDB/PySysDBPY.h
@@ -641,6 +641,8 @@
struct tagDailyAction
{
    DWORD        _DailyID;    //活动ID
    dict        OpenTimeDict;    //开启时间
    DWORD        Duration;    //持续时间, 0为不限制
    DWORD        DayTimes;    //每日次数, 0为不限制
    DWORD        DayBuyTimes;    //每日可购买次数
    DWORD        BuyNeedMoney;    //购买次数需要仙玉
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyParty.py
@@ -131,7 +131,8 @@
    gameWorld = GameWorld.GetGameWorld()
    partyActionState = gameWorld.GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_DailyActionState % ShareDefine.DailyActionID_FamilyParty)
    if partyActionState:
        __DoEnterJoinFamilyParty(curPlayer)
        remainSeconds = PlayerActivity.GetDailyActionRemainSeconds(ShareDefine.DailyActionID_FamilyParty)
        __DoEnterJoinFamilyParty(curPlayer, remainSeconds)
        
    lineID = GameWorld.GetGameWorld().GetLineID()
    if lineID not in g_familyMapPlayerIDDict:
@@ -148,13 +149,16 @@
        
    return
def __DoEnterJoinFamilyParty(curPlayer):
def __DoEnterJoinFamilyParty(curPlayer, remainSeconds):
    ## 玩家正式开始参与仙盟宴会,因为多个仙盟活动可能共用该地图,玩家可能活动开始时已经在该地图
    GameWorld.DebugLog("玩家参加仙盟宴会!remainSeconds=%s" % remainSeconds, curPlayer.GetPlayerID())
    if remainSeconds:
        curPlayer.Sync_TimeTick(IPY_GameWorld.tttTowerTake, 0, remainSeconds * 1000, True)
    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)
@@ -234,12 +238,13 @@
    
    GameWorld.DebugLog('仙盟宴会活动状态变更 state=%s' % state)
    if state == 1:
        remainSeconds = PlayerActivity.GetDailyActionRemainSeconds(ShareDefine.DailyActionID_FamilyParty)
        playerManager = GameWorld.GetPlayerManager()
        for i in xrange(playerManager.GetPlayerCount()):
            curPlayer = playerManager.GetPlayerByIndex(i)
            if not curPlayer or curPlayer.IsEmpty():
                continue
            __DoEnterJoinFamilyParty(curPlayer)
            __DoEnterJoinFamilyParty(curPlayer, remainSeconds)
    else:
        PyGameData.g_familyPartyInfo = []
        
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -533,6 +533,8 @@
                "DailyAction":(
                        ("DWORD", "DailyID", 1),
                        ("dict", "OpenTimeDict", 0),
                        ("DWORD", "Duration", 0),
                        ("DWORD", "DayTimes", 0),
                        ("DWORD", "DayBuyTimes", 0),
                        ("DWORD", "BuyNeedMoney", 0),
@@ -2564,6 +2566,8 @@
    
    def __init__(self):
        self.DailyID = 0
        self.OpenTimeDict = {}
        self.Duration = 0
        self.DayTimes = 0
        self.DayBuyTimes = 0
        self.BuyNeedMoney = 0
@@ -2575,6 +2579,8 @@
        return
        
    def GetDailyID(self): return self.DailyID # 活动ID
    def GetOpenTimeDict(self): return self.OpenTimeDict # 开启时间
    def GetDuration(self): return self.Duration # 持续时间, 0为不限制
    def GetDayTimes(self): return self.DayTimes # 每日次数, 0为不限制
    def GetDayBuyTimes(self): return self.DayBuyTimes # 每日可购买次数
    def GetBuyNeedMoney(self): return self.BuyNeedMoney # 购买次数需要仙玉
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py
@@ -30,6 +30,7 @@
import GameFuncComm
import EventShell
import PlayerPet
import datetime
#关联类型
(
@@ -426,6 +427,43 @@
#########################################日常活动###########################################
def GetDailyActionOpenEndTime(dailyID):
    ## 获取日常活动开启结束时间点
    ipyData = IpyGameDataPY.GetIpyGameData('DailyAction', dailyID)
    if not ipyData:
        return
    openTimeDict = ipyData.GetOpenTimeDict()
    duration = ipyData.GetDuration()
    if not openTimeDict or not duration:
        return
    allOpenTimeList = openTimeDict.values()
    if not allOpenTimeList:
        return
    openTimeList = allOpenTimeList[0] # 这边默认为每日的开启时间段一样,直接取第一日
    if len(openTimeList) == 1:
        openHour, openMinute = openTimeList[0]
    else:
        #openHour, openMinute =
        # 每天多个时间段的再说,暂时没用到
        return
    curDateTime = GameWorld.GetCurrentTime()
    openTimeStr = "%d-%d-%d %02d:%02d:00" % (curDateTime.year, curDateTime.month, curDateTime.day, openHour, openMinute)
    openDateTime = datetime.datetime.strptime(openTimeStr, ChConfig.TYPE_Time_Format)
    endDateTime = openDateTime + datetime.timedelta(minutes=duration)
    return openDateTime, endDateTime
def GetDailyActionRemainSeconds(dailyID):
    ## 获取日常活动当前剩余秒数
    openEndTimeInfo = GetDailyActionOpenEndTime(dailyID)
    if not openEndTimeInfo:
        return 0
    openDateTime, endDateTime = openEndTimeInfo
    curDateTime = GameWorld.GetCurrentTime()
    if curDateTime < openDateTime or curDateTime >= endDateTime:
        return 0
    remainDateTime = endDateTime - curDateTime
    return remainDateTime.seconds
def AddDailyActionFinishCnt(curPlayer, dailyID, addCnt=1):
    ##增加日常活动完成次数