xdh
2019-02-14 fc7847f19424c902c7e6fdac1d024b5039b3d725
5315 【后端】【1.6】登录奖励活动
11个文件已修改
301 ■■■■ 已修改文件
PySysDB/PySysDBPY.h 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py 79 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldAverageLv.py 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py 79 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActLogin.py 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerLuckyTreasure.py 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PySysDB/PySysDBPY.h
@@ -1633,7 +1633,7 @@
    BYTE        ActionType;    //活动条目ID
    DWORD        TotalTimes;    //可完成的总次数,0表示不限次数
    WORD        SingleTimes;    //单次领奖需要的次数
    list        Reward;    //奖励物品
    char        Reward;    //奖励物品
};
//诛仙装备套装属性表
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -20479,56 +20479,13 @@
#------------------------------------------------------
# AA 0C 登录奖励活动信息 #tagMCActLoginAwardInfo
class  tagMCActLoginAwardItem(Structure):
    _pack_ = 1
    _fields_ = [
                  ("ItemID", c_int),    # 物品ID
                  ("ItemCnt", c_ushort),    # 物品数量
                  ("IsBind", c_ubyte),    # 是否绑定
                  ]
    def __init__(self):
        self.Clear()
        return
    def ReadData(self, stringData, _pos=0, _len=0):
        self.Clear()
        memmove(addressof(self), stringData[_pos:], self.GetLength())
        return _pos + self.GetLength()
    def Clear(self):
        self.ItemID = 0
        self.ItemCnt = 0
        self.IsBind = 0
        return
    def GetLength(self):
        return sizeof(tagMCActLoginAwardItem)
    def GetBuffer(self):
        return string_at(addressof(self), self.GetLength())
    def OutputString(self):
        DumpString = '''// AA 0C 登录奖励活动信息 //tagMCActLoginAwardInfo:
                                ItemID:%d,
                                ItemCnt:%d,
                                IsBind:%d
                                '''\
                                %(
                                self.ItemID,
                                self.ItemCnt,
                                self.IsBind
                                )
        return DumpString
class  tagMCActLoginAwardAction(Structure):
    TemplateID = 0    #(DWORD TemplateID)// 模板ID
    ActionType = 0    #(WORD ActionType)// 活动类别
    TotalTimes = 0    #(DWORD TotalTimes)// 可完成的总次数,0表示不限次数
    SingleTimes = 0    #(DWORD SingleTimes)// 单次领奖需要的次数
    Count = 0    #(BYTE Count)// 物品数
    ItemInfo = list()    #(vector<tagMCActLoginAwardItem> ItemInfo)// 物品信息
    Count = 0    #(WORD Count)// 物品配置长度
    ItemInfo = ""    #(String ItemInfo)// 物品信息
    data = None
    def __init__(self):
@@ -20541,11 +20498,8 @@
        self.ActionType,_pos = CommFunc.ReadWORD(_lpData, _pos)
        self.TotalTimes,_pos = CommFunc.ReadDWORD(_lpData, _pos)
        self.SingleTimes,_pos = CommFunc.ReadDWORD(_lpData, _pos)
        self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
        for i in range(self.Count):
            temItemInfo = tagMCActLoginAwardItem()
            _pos = temItemInfo.ReadData(_lpData, _pos)
            self.ItemInfo.append(temItemInfo)
        self.Count,_pos = CommFunc.ReadWORD(_lpData, _pos)
        self.ItemInfo,_pos = CommFunc.ReadString(_lpData, _pos,self.Count)
        return _pos
    def Clear(self):
@@ -20554,7 +20508,7 @@
        self.TotalTimes = 0
        self.SingleTimes = 0
        self.Count = 0
        self.ItemInfo = list()
        self.ItemInfo = ""
        return
    def GetLength(self):
@@ -20563,9 +20517,8 @@
        length += 2
        length += 4
        length += 4
        length += 1
        for i in range(self.Count):
            length += self.ItemInfo[i].GetLength()
        length += 2
        length += len(self.ItemInfo)
        return length
@@ -20575,9 +20528,8 @@
        data = CommFunc.WriteWORD(data, self.ActionType)
        data = CommFunc.WriteDWORD(data, self.TotalTimes)
        data = CommFunc.WriteDWORD(data, self.SingleTimes)
        data = CommFunc.WriteBYTE(data, self.Count)
        for i in range(self.Count):
            data = CommFunc.WriteString(data, self.ItemInfo[i].GetLength(), self.ItemInfo[i].GetBuffer())
        data = CommFunc.WriteWORD(data, self.Count)
        data = CommFunc.WriteString(data, self.Count, self.ItemInfo)
        return data
    def OutputString(self):
@@ -20595,7 +20547,7 @@
                                self.TotalTimes,
                                self.SingleTimes,
                                self.Count,
                                "..."
                                self.ItemInfo
                                )
        return DumpString
@@ -20603,6 +20555,7 @@
class  tagMCActLoginAwardDayInfo(Structure):
    ActCnt = 0    #(BYTE ActCnt)// 数量
    TemplateList = list()    #(vector<WORD> TemplateList)// 模板列表
    WorldLV = 0    #(WORD WorldLV)// 世界等级
    data = None
    def __init__(self):
@@ -20615,17 +20568,20 @@
        for i in range(self.ActCnt):
            value,_pos=CommFunc.ReadWORD(_lpData,_pos)
            self.TemplateList.append(value)
        self.WorldLV,_pos = CommFunc.ReadWORD(_lpData, _pos)
        return _pos
    def Clear(self):
        self.ActCnt = 0
        self.TemplateList = list()
        self.WorldLV = 0
        return
    def GetLength(self):
        length = 0
        length += 1
        length += 2 * self.ActCnt
        length += 2
        return length
@@ -20634,16 +20590,19 @@
        data = CommFunc.WriteBYTE(data, self.ActCnt)
        for i in range(self.ActCnt):
            data = CommFunc.WriteWORD(data, self.TemplateList[i])
        data = CommFunc.WriteWORD(data, self.WorldLV)
        return data
    def OutputString(self):
        DumpString = '''
                                ActCnt:%d,
                                TemplateList:%s
                                TemplateList:%s,
                                WorldLV:%d
                                '''\
                                %(
                                self.ActCnt,
                                "..."
                                "...",
                                self.WorldLV
                                )
        return DumpString
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py
@@ -34,6 +34,7 @@
import PlayerFairyCeremony
import PlayerNewFairyCeremony
import PlayerUniversalGameRec
import GameWorldAverageLv
import GameWorldProcess
import ChPyNetSendPack
import NetPackCommon
@@ -312,6 +313,9 @@
                if not activityIpyData or (isActivity and not isEnd):
                    activityIpyData = ipyData
                    activityInfoDict = {ShareDefine.ActKey_CfgID:cfgID}
                    if actName == ShareDefine.OperationActionName_LoginAward:
                        #活动每天的世界等级
                        activityInfoDict[ShareDefine.ActKey_WorldLVList] = GameWorldAverageLv.GetWorldLVListByTime(startDayDate, (endDayDate - startDayDate).days)
                    
                    if startDayDate <= curDateTime < endDayDate:
                        dayIndex = 0
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldAverageLv.py
@@ -23,6 +23,8 @@
import PlayerDBGSEvent
import ChConfig
import IpyGameDataPY
import datetime
#------------------------------------------------------------------------------
        
@@ -87,3 +89,33 @@
    
    return worldLV
def GetWorldLVListByTime(startTime, day=1):
    ##根据时间计算多个世界等级
    initOpenServerTime = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_InitOpenServerTime)
    if initOpenServerTime <= 0:
        return []
    worldlvList = []
    diffSecond = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_WorldLVExtraTime) #额外时间参数
    initOpenServerTime = GameWorld.ChangeTimeNumToDatetime(initOpenServerTime, ChConfig.TYPE_Time_Format)
    if startTime < initOpenServerTime:
        return []
    ipyMgr = IpyGameDataPY.IPY_Data()
    for dayIndex in xrange(day):
        nextTime = startTime + datetime.timedelta(days=dayIndex)
        pastTimeDelta = nextTime - initOpenServerTime
        pastSeconds = max(0, pastTimeDelta.days * 24 * 60 * 60 + pastTimeDelta.seconds + diffSecond)
        maxCnt = ipyMgr.GetWorldLVCount()
        worldLV = 0
        for i in xrange(maxCnt):
            curIpyData = ipyMgr.GetWorldLVByIndex(i)
            if i == maxCnt - 1:
                worldLV = curIpyData.GetWorldLV()
            else:
                nextIpyData = ipyMgr.GetWorldLVByIndex(i+1)
                if curIpyData.GetOpenServerSecond() <= pastSeconds < nextIpyData.GetOpenServerSecond():
                    worldLV = curIpyData.GetWorldLV()
                    break
        worldlvList.append(worldLV)
    GameWorld.DebugLog('    GetWorldLVByTime startTime=%s,day=%s,worldlvList=%s'%(str(startTime), day, worldlvList))
    return worldlvList
ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
@@ -256,6 +256,7 @@
ActKey_CfgID = "CfgID" # 活动表配置ID
ActKey_DayIndex = "DayIndex" # 活动表配置ID
ActKey_WorldLV = "WorldLV" # 活动开启时世界等级
ActKey_WorldLVList = "WorldLVList" # 活动每天的世界等级列表
#答题类型枚举
Def_Game_ExamTypeList = range(1, 4 + 1)
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3775,6 +3775,7 @@
Def_PDict_LoginAwardID = "LoginAwardID"  # 玩家身上的BOSS复活活动ID,唯一标识,取活动开始日期time值
Def_PDict_LoginAwardCurTimes = "LoginAwardCurTimes_%s_%s" #当前完成次数 参数(第X天,模板ID)
Def_PDict_LoginAwardGotTimes = "LoginAwardGotTimes_%s_%s" #当前已领次数 参数(第X天,模板ID)
Def_PDict_LoginAwardWorldLV = "LoginAwardWorldLV%s" #活动开启时世界等级参数(第X天)
#诛仙BOSS
Def_PDict_ZhuXianBossHelpCnt = "ZhuXianBossHelpCnt"  # 协助次数
@@ -3783,6 +3784,7 @@
Def_PDict_LuckyTreasureID = "LuckyTreasureID"  # 玩家身上的活动ID,唯一标识,取活动开始日期time值
Def_PDict_LuckyTreasureFree = "LuckyTreasureFree" #是否免费过
Def_PDict_LuckyTreasurePoint = "LuckyTreasurePoint" #幸运值
Def_PDict_LuckyTreasureCnt = "LuckyTreasureCnt" #鉴宝次数
#-------------------------------------------------------------------------------
#类型 Def_PDictType_OnlinePrize
Def_PDict1_OnlinePrizeCnt = "OnlinePrizeCnt"  # 新手在线已领取奖励次数
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -20479,56 +20479,13 @@
#------------------------------------------------------
# AA 0C 登录奖励活动信息 #tagMCActLoginAwardInfo
class  tagMCActLoginAwardItem(Structure):
    _pack_ = 1
    _fields_ = [
                  ("ItemID", c_int),    # 物品ID
                  ("ItemCnt", c_ushort),    # 物品数量
                  ("IsBind", c_ubyte),    # 是否绑定
                  ]
    def __init__(self):
        self.Clear()
        return
    def ReadData(self, stringData, _pos=0, _len=0):
        self.Clear()
        memmove(addressof(self), stringData[_pos:], self.GetLength())
        return _pos + self.GetLength()
    def Clear(self):
        self.ItemID = 0
        self.ItemCnt = 0
        self.IsBind = 0
        return
    def GetLength(self):
        return sizeof(tagMCActLoginAwardItem)
    def GetBuffer(self):
        return string_at(addressof(self), self.GetLength())
    def OutputString(self):
        DumpString = '''// AA 0C 登录奖励活动信息 //tagMCActLoginAwardInfo:
                                ItemID:%d,
                                ItemCnt:%d,
                                IsBind:%d
                                '''\
                                %(
                                self.ItemID,
                                self.ItemCnt,
                                self.IsBind
                                )
        return DumpString
class  tagMCActLoginAwardAction(Structure):
    TemplateID = 0    #(DWORD TemplateID)// 模板ID
    ActionType = 0    #(WORD ActionType)// 活动类别
    TotalTimes = 0    #(DWORD TotalTimes)// 可完成的总次数,0表示不限次数
    SingleTimes = 0    #(DWORD SingleTimes)// 单次领奖需要的次数
    Count = 0    #(BYTE Count)// 物品数
    ItemInfo = list()    #(vector<tagMCActLoginAwardItem> ItemInfo)// 物品信息
    Count = 0    #(WORD Count)// 物品配置长度
    ItemInfo = ""    #(String ItemInfo)// 物品信息
    data = None
    def __init__(self):
@@ -20541,11 +20498,8 @@
        self.ActionType,_pos = CommFunc.ReadWORD(_lpData, _pos)
        self.TotalTimes,_pos = CommFunc.ReadDWORD(_lpData, _pos)
        self.SingleTimes,_pos = CommFunc.ReadDWORD(_lpData, _pos)
        self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
        for i in range(self.Count):
            temItemInfo = tagMCActLoginAwardItem()
            _pos = temItemInfo.ReadData(_lpData, _pos)
            self.ItemInfo.append(temItemInfo)
        self.Count,_pos = CommFunc.ReadWORD(_lpData, _pos)
        self.ItemInfo,_pos = CommFunc.ReadString(_lpData, _pos,self.Count)
        return _pos
    def Clear(self):
@@ -20554,7 +20508,7 @@
        self.TotalTimes = 0
        self.SingleTimes = 0
        self.Count = 0
        self.ItemInfo = list()
        self.ItemInfo = ""
        return
    def GetLength(self):
@@ -20563,9 +20517,8 @@
        length += 2
        length += 4
        length += 4
        length += 1
        for i in range(self.Count):
            length += self.ItemInfo[i].GetLength()
        length += 2
        length += len(self.ItemInfo)
        return length
@@ -20575,9 +20528,8 @@
        data = CommFunc.WriteWORD(data, self.ActionType)
        data = CommFunc.WriteDWORD(data, self.TotalTimes)
        data = CommFunc.WriteDWORD(data, self.SingleTimes)
        data = CommFunc.WriteBYTE(data, self.Count)
        for i in range(self.Count):
            data = CommFunc.WriteString(data, self.ItemInfo[i].GetLength(), self.ItemInfo[i].GetBuffer())
        data = CommFunc.WriteWORD(data, self.Count)
        data = CommFunc.WriteString(data, self.Count, self.ItemInfo)
        return data
    def OutputString(self):
@@ -20595,7 +20547,7 @@
                                self.TotalTimes,
                                self.SingleTimes,
                                self.Count,
                                "..."
                                self.ItemInfo
                                )
        return DumpString
@@ -20603,6 +20555,7 @@
class  tagMCActLoginAwardDayInfo(Structure):
    ActCnt = 0    #(BYTE ActCnt)// 数量
    TemplateList = list()    #(vector<WORD> TemplateList)// 模板列表
    WorldLV = 0    #(WORD WorldLV)// 世界等级
    data = None
    def __init__(self):
@@ -20615,17 +20568,20 @@
        for i in range(self.ActCnt):
            value,_pos=CommFunc.ReadWORD(_lpData,_pos)
            self.TemplateList.append(value)
        self.WorldLV,_pos = CommFunc.ReadWORD(_lpData, _pos)
        return _pos
    def Clear(self):
        self.ActCnt = 0
        self.TemplateList = list()
        self.WorldLV = 0
        return
    def GetLength(self):
        length = 0
        length += 1
        length += 2 * self.ActCnt
        length += 2
        return length
@@ -20634,16 +20590,19 @@
        data = CommFunc.WriteBYTE(data, self.ActCnt)
        for i in range(self.ActCnt):
            data = CommFunc.WriteWORD(data, self.TemplateList[i])
        data = CommFunc.WriteWORD(data, self.WorldLV)
        return data
    def OutputString(self):
        DumpString = '''
                                ActCnt:%d,
                                TemplateList:%s
                                TemplateList:%s,
                                WorldLV:%d
                                '''\
                                %(
                                self.ActCnt,
                                "..."
                                "...",
                                self.WorldLV
                                )
        return DumpString
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -1282,7 +1282,7 @@
                        ("BYTE", "ActionType", 0),
                        ("DWORD", "TotalTimes", 0),
                        ("WORD", "SingleTimes", 0),
                        ("list", "Reward", 0),
                        ("char", "Reward", 0),
                        ),
                "ZhuXianSuitAttr":(
@@ -3995,7 +3995,7 @@
        self.ActionType = 0
        self.TotalTimes = 0
        self.SingleTimes = 0
        self.Reward = []
        self.Reward = ""
        return
        
    def GetTemplateID(self): return self.TemplateID # 模板ID
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActLogin.py
@@ -30,6 +30,7 @@
import PyGameData
import ItemCommon
import json
def OnLogin(curPlayer):
    isReset = __CheckPlayerLoginAwardAction(curPlayer)
@@ -57,7 +58,7 @@
    playerID = curPlayer.GetPlayerID()
    
    actLoginAwardInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_LoginAward, {})
    #LoginAwardID = actLoginAwardInfo.get(ShareDefine.ActKey_ID, 0)
    #loginAwardID = actLoginAwardInfo.get(ShareDefine.ActKey_ID, 0)
    state = actLoginAwardInfo.get(ShareDefine.ActKey_State, 0)
    cfgID = actLoginAwardInfo.get(ShareDefine.ActKey_CfgID, 0)
    if state:
@@ -70,16 +71,20 @@
    if cfgID == playerLoginAwardID:
        #GameWorld.DebugLog("登录奖励活动ID不变,不处理!", curPlayer.GetPlayerID())
        return
    actWorldLVList = actLoginAwardInfo.get(ShareDefine.ActKey_WorldLVList, [])
    # 未领取的奖励邮件发放
    if playerLoginAwardID:
    __SendLoginAwardMail(curPlayer, playerLoginAwardID)
    
    if not cfgID:
    #if not cfgID:
        GameWorld.DebugLog('    登录奖励活动重置!')
        curPlayer.ClearNomalDict(ChConfig.Def_PDictType_LoginAward)
    
    GameWorld.DebugLog("登录奖励变更! state=%s,cfgID=%s,playerLoginAwardID=%s" % (state, cfgID, playerLoginAwardID), playerID)
    GameWorld.DebugLog("登录奖励变更! state=%s,cfgID=%s,playerLoginAwardID=%s,actWorldLVList=%s" % (state, cfgID, playerLoginAwardID, actWorldLVList), playerID)
    
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_LoginAwardID, cfgID, ChConfig.Def_PDictType_LoginAward)
    for i, actWorldLV in enumerate(actWorldLVList):
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_LoginAwardWorldLV % i, actWorldLV, ChConfig.Def_PDictType_LoginAward)
        
    SyncLoginAwardInfo(curPlayer)
    return True
@@ -87,15 +92,17 @@
def __SendLoginAwardMail(curPlayer, cfgID):
    # 未领取的奖励邮件发放
    actBossIpyData = IpyGameDataPY.GetIpyGameData("ActLoginAward", cfgID)
    if not actBossIpyData:
    actIpyData = IpyGameDataPY.GetIpyGameData("ActLoginAward", cfgID)
    if not actIpyData:
        return
    templateIDList = actBossIpyData.GetTemplateID()
    templateIDList = actIpyData.GetTemplateID()
    if not templateIDList:
        return
    
    totalItemDict = {}
    for day, tidList in enumerate(templateIDList):
        playerWorldLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_LoginAwardWorldLV % day, 0, ChConfig.Def_PDictType_LoginAward)
        for tid in tidList:
            ipyData = IpyGameDataPY.GetIpyGameData('LoginAward', tid)
            if not ipyData:
@@ -106,13 +113,13 @@
            canGotCnt = (curTimes - gotTimes) / singleTimes
            if not canGotCnt:
                continue
            itemDict = __GetAwardItem(curPlayer, ipyData, canGotCnt)
            itemDict = __GetAwardItem(curPlayer, ipyData, playerWorldLV, canGotCnt)
            GameWorld.AddDictValue(totalItemDict, itemDict)
    
    if not totalItemDict:
        return
    totalItemList = [[itemID, itemCnt, 1] for itemID, itemCnt in totalItemDict.items()]
    PlayerControl.SendMailByKey('SecondWeekReward', [curPlayer.GetID()], totalItemList)
    PlayerControl.SendMailByKey('LoginAward_1', [curPlayer.GetID()], totalItemList)
    return
@@ -127,10 +134,10 @@
    
    if not state or not cfgID:
        return
    actBossIpyData = IpyGameDataPY.GetIpyGameData("ActLoginAward", cfgID)
    if not actBossIpyData:
    actIpyData = IpyGameDataPY.GetIpyGameData("ActLoginAward", cfgID)
    if not actIpyData:
        return
    templateIDList = actBossIpyData.GetTemplateID()
    templateIDList = actIpyData.GetTemplateID()
    dayIndex = actLoginAwardInfo.get(ShareDefine.ActKey_DayIndex, 0)
    if dayIndex >= len(templateIDList):
        return
@@ -175,9 +182,9 @@
    gotTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_LoginAwardGotTimes % (day, templateID), 0, ChConfig.Def_PDictType_LoginAward)
    if curTimes - gotTimes < singleTimes:
        return
    playerWorldLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_LoginAwardWorldLV % day, 0, ChConfig.Def_PDictType_LoginAward)
    #给奖励
    awardDict = __GetAwardItem(curPlayer, ipyData)
    awardDict = __GetAwardItem(curPlayer, ipyData, playerWorldLV)
    # 检查背包
    needSpace = len(awardDict)
    packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, needSpace)
@@ -195,15 +202,23 @@
    return
def __GetAwardItem(curPlayer, ipyData, times=1):
    awardDict = {}
    for itemID, itemCnt, isbind in ipyData.GetReward():
def __GetAwardItem(curPlayer, ipyData, worldLV, times=1):
    awardItemDict = {}
    awardDict = eval(ipyData.GetReward())
    wlvList = [int(lv) for lv in awardDict]
    wlvList.sort()
    findWlv = wlvList[-1]
    for wlv in wlvList:
        if worldLV <= wlv:
            findWlv = wlv
            break
    itemList = awardDict[findWlv]
    for itemID, itemCnt, isbind in itemList:
        if not itemID or not itemCnt:
            continue
        awardDict[itemID] = awardDict.get(itemID, 0) + itemCnt * times
        awardItemDict[itemID] = awardItemDict.get(itemID, 0) + itemCnt * times
        
    return awardDict
    return awardItemDict
def SyncLoginAwardPlayerInfo(curPlayer, day=-1, templateID=-1):
@@ -213,10 +228,10 @@
    cfgID = actLoginAwardInfo.get(ShareDefine.ActKey_CfgID, 0)
    if not state or not cfgID:
        return
    actBossIpyData = IpyGameDataPY.GetIpyGameData("ActLoginAward", cfgID)
    if not actBossIpyData:
    actIpyData = IpyGameDataPY.GetIpyGameData("ActLoginAward", cfgID)
    if not actIpyData:
        return
    templateIDList = actBossIpyData.GetTemplateID()
    templateIDList = actIpyData.GetTemplateID()
    if not templateIDList:
        return
    if day != -1:
@@ -256,21 +271,22 @@
    cfgID = actLoginAwardInfo.get(ShareDefine.ActKey_CfgID, 0)
    if not cfgID:
        return
    actBossIpyData = IpyGameDataPY.GetIpyGameData("ActLoginAward", cfgID)
    if not actBossIpyData:
    actIpyData = IpyGameDataPY.GetIpyGameData("ActLoginAward", cfgID)
    if not actIpyData:
        return
    templateIDList = actBossIpyData.GetTemplateID()
    templateIDList = actIpyData.GetTemplateID()
    if not templateIDList:
        return
    actWorldLVList = actLoginAwardInfo.get(ShareDefine.ActKey_WorldLVList, [])
    openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
    actInfo = ChPyNetSendPack.tagMCActLoginAwardInfo()
    actInfo.Clear()
    actInfo.StartDate = GameWorld.GetOperationActionDateStr(actBossIpyData.GetStartDate(), openServerDay)
    actInfo.EndtDate = GameWorld.GetOperationActionDateStr(actBossIpyData.GetEndDate(), openServerDay)
    actInfo.AdvanceMinutes = actBossIpyData.GetAdvanceMinutes()
    actInfo.IsDayReset = actBossIpyData.GetIsDayReset()
    actInfo.ResetType = actBossIpyData.GetResetType()
    actInfo.LimitLV = actBossIpyData.GetLVLimit()
    actInfo.StartDate = GameWorld.GetOperationActionDateStr(actIpyData.GetStartDate(), openServerDay)
    actInfo.EndtDate = GameWorld.GetOperationActionDateStr(actIpyData.GetEndDate(), openServerDay)
    actInfo.AdvanceMinutes = actIpyData.GetAdvanceMinutes()
    actInfo.IsDayReset = actIpyData.GetIsDayReset()
    actInfo.ResetType = actIpyData.GetResetType()
    actInfo.LimitLV = actIpyData.GetLVLimit()
    actInfo.DayInfoList = []
    tidList = []
    for day, dayActList in enumerate(templateIDList):
@@ -280,7 +296,7 @@
        for tid in dayActList:
            if tid not in tidList:
                tidList.append(tid)
        dayInfo.WorldLV = actWorldLVList[day] if day < len(actWorldLVList) else 0
        actInfo.DayInfoList.append(dayInfo)
    actInfo.DayCnt = len(actInfo.DayInfoList)
    actInfo.ActionInfo = []
@@ -294,13 +310,7 @@
        tInfo.ActionType = ipyData.GetActionType()
        tInfo.TotalTimes = ipyData.GetTotalTimes()
        tInfo.SingleTimes = ipyData.GetSingleTimes()
        tInfo.ItemInfo = []
        for itemID, itemCnt, isBind in ipyData.GetReward():
            awardItem = ChPyNetSendPack.tagMCActLoginAwardItem()
            awardItem.ItemID = itemID
            awardItem.ItemCnt = itemCnt
            awardItem.IsBind = isBind
            tInfo.ItemInfo.append(awardItem)
        tInfo.ItemInfo = ipyData.GetReward()
        tInfo.Count = len(tInfo.ItemInfo)
        actInfo.ActionInfo.append(tInfo)
    actInfo.TCount = len(actInfo.ActionInfo)
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerLuckyTreasure.py
@@ -79,6 +79,8 @@
    
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_LuckyTreasureFree, 0)
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_LuckyTreasurePoint, 0)
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_LuckyTreasureCnt, 0)
    
    SyncLuckyTreasureInfo(curPlayer)
    SyncLuckyTreasureResultInfo(curPlayer)
@@ -153,11 +155,17 @@
    greatItem = randomRateList[-1][1]
    
    curLuckyPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_LuckyTreasurePoint)
    curLuckyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_LuckyTreasureCnt)
    maxLuckyPoint = actIpyData.GetLuckyPoint()
    singlePoint = IpyGameDataPY.GetFuncCfg('LuckyAppraisal', 2)
    if curLuckyPoint + singlePoint >= maxLuckyPoint:
        giveItem = greatItem
        newLuckyPoint = 0
    else:
        if curLuckyCnt < IpyGameDataPY.GetFuncCfg('LuckyAppraisal', 3):
            #前X次鉴宝不能出大奖
            randomResultList = GameWorld.GetResultByRandomListEx(randomRateList[:-1], 1, [])
    else:
        randomResultList = GameWorld.GetResultByRandomListEx(randomRateList, 1, [])
        if len(randomResultList) != 1:
@@ -179,6 +187,7 @@
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_LuckyTreasureFree, 1)
    #更新幸运值
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_LuckyTreasurePoint, newLuckyPoint)
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_LuckyTreasureCnt, curLuckyCnt + 1)
    
    for itemID, itemCount, isBind in [giveItem]:
        ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isBind, [IPY_GameWorld.rptItem], event=[ChConfig.ItemGive_LuckyTreasure, False, {"isFree":not hasFree}])
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
@@ -256,6 +256,7 @@
ActKey_CfgID = "CfgID" # 活动表配置ID
ActKey_DayIndex = "DayIndex" # 活动表配置ID
ActKey_WorldLV = "WorldLV" # 活动开启时世界等级
ActKey_WorldLVList = "WorldLVList" # 活动每天的世界等级列表
#答题类型枚举
Def_Game_ExamTypeList = range(1, 4 + 1)