1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
#-------------------------------------------------------------------------------
#
##@package Player.PlayerWeekParty
#
# @todo:ÖÜ¿ñ»¶
# @author xdh
# @date 2018-07-12 16:50
# @version 1.0
#
#
# ÏêϸÃèÊö: ÖÜ¿ñ»¶
#
#---------------------------------------------------------------------
"""Version = 2018-07-12 16:50"""
#---------------------------------------------------------------------
 
import IPY_GameWorld
import GameWorld
import ChConfig
import IpyGameDataPY
import PlayerControl
import ItemControler
import ChPyNetSendPack
import Operate_EquipStone
import PlayerFeastWeekParty
import DataRecordPack
import PlayerGodWeapon
import NetPackCommon
import ShareDefine
import PyGameData
import ItemCommon
 
 
def OnLogin(curPlayer):
    isReset = __CheckPlayerWeekPartyAction(curPlayer)
    if not isReset:
        actCostRebateInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WeekParty, {})
        # »î¶¯ÖÐͬ²½»î¶¯ÐÅÏ¢
        SyncWeekPartyInfo(curPlayer)
        if actCostRebateInfo.get(ShareDefine.ActKey_State):
            AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_Login, 1, False, False, False)
            SyncWeekPartyPlayerInfo(curPlayer)
    return
 
 
def RefreshOperationAction_WeekParty():
    playerManager = GameWorld.GetPlayerManager()
    for i in xrange(playerManager.GetPlayerCount()):
        curPlayer = playerManager.GetPlayerByIndex(i)
        if not GameWorld.IsNormalPlayer(curPlayer):
            continue
        __CheckPlayerWeekPartyAction(curPlayer)
    return
 
 
def __CheckPlayerWeekPartyAction(curPlayer):
    ## ¼ì²éÍæ¼ÒÖÜ¿ñ»¶»î¶¯Êý¾ÝÐÅÏ¢
    playerID = curPlayer.GetPlayerID()
    
    actWeekPartyInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WeekParty, {})
    state = actWeekPartyInfo.get(ShareDefine.ActKey_State, 0)
    actID = actWeekPartyInfo.get(ShareDefine.ActKey_ID, 0)
    cfgID = actWeekPartyInfo.get(ShareDefine.ActKey_CfgID, 0)
    playerActID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyActID, 0, ChConfig.Def_PDictType_WeekParty)  # Íæ¼ÒÉíÉϵĻID
    playerWeekPartyID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyID, 0, ChConfig.Def_PDictType_WeekParty)  # Íæ¼ÒÉíÉϵĻÅäÖÃID
    playerWorldLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyWorldLV, 0, ChConfig.Def_PDictType_WeekParty)  # Íæ¼ÒÉíÉϵĻÊÀ½çµÈ¼¶
    # »î¶¯ID ÏàͬµÄ»°²»´¦Àí
    if actID == playerActID:
        GameWorld.DebugLog("ÖÜ¿ñ»¶»î¶¯ID²»±ä£¬²»´¦Àí£¡playerActID=%s" % playerActID, curPlayer.GetPlayerID())
        if state:
            CheckWeekPartyActionCnt(curPlayer, True)
        return
    # Î´ÁìÈ¡µÄ½±ÀøÓʼþ·¢·Å
    if playerWeekPartyID:
        __SendWeekPartyMail(curPlayer, playerWeekPartyID, playerWorldLV)
        
    GameWorld.DebugLog('ÖÜ¿ñ»¶»î¶¯ÖØÖÃ!')
    curPlayer.ClearNomalDict(ChConfig.Def_PDictType_WeekParty)
    
    worldLV = actWeekPartyInfo.get(ShareDefine.ActKey_WorldLV, 0)
    GameWorld.DebugLog("ÖÜ¿ñ»¶±ä¸ü! state=%s,actID=%s,cfgID=%s,playerWeekPartyID=%s,worldLV=%s" % (state, actID, cfgID, playerWeekPartyID, worldLV), playerID)
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WeekPartyActID, actID, ChConfig.Def_PDictType_WeekParty)
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WeekPartyID, cfgID, ChConfig.Def_PDictType_WeekParty)
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WeekPartyWorldLV, worldLV, ChConfig.Def_PDictType_WeekParty)
    if state:
        CheckWeekPartyActionCnt(curPlayer,  False)
        SyncWeekPartyInfo(curPlayer)
        SyncWeekPartyPlayerInfo(curPlayer)
        
    return True
 
def __SendWeekPartyMail(curPlayer, cfgID, playerWorldLV):
    # Î´ÁìÈ¡µÄ½±ÀøÓʼþ·¢·Å
    actBossIpyData = IpyGameDataPY.GetIpyGameData("ActWeekParty", cfgID)
    if not actBossIpyData:
        return
    templateIDList = actBossIpyData.GetTemplateID()
    if not templateIDList:
        return
    
    totalItemDict = {}
    for day, tidList in enumerate(templateIDList):
        for tid in tidList:
            ipyData = IpyGameDataPY.GetIpyGameData('WeekParty', tid)
            if not ipyData:
                continue
            singleTimes = ipyData.GetSingleTimes()
            curTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyCurTimes % (day, tid), 0, ChConfig.Def_PDictType_WeekParty)
            gotTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyGotTimes % (day, tid), 0, ChConfig.Def_PDictType_WeekParty)
            canGotCnt = (curTimes - gotTimes) / singleTimes
            if not canGotCnt:
                continue
            itemDict = __GetAwardItem(curPlayer, ipyData, playerWorldLV, canGotCnt)
            GameWorld.AddDictValue(totalItemDict, itemDict)
    #»ý·Ö½±Àø
    pointAwardInfo = __GetPointAwardInfo(actBossIpyData.GetPointAward(), playerWorldLV)
    for day, awardDict in pointAwardInfo.items():
        pointList = awardDict.keys()
        pointList.sort()
        for i, point in enumerate(pointList):
            curPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyPoint % day, 0, ChConfig.Def_PDictType_WeekParty)
            if curPoint < point:
                continue
            awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyAwardRecord % day, 0, ChConfig.Def_PDictType_WeekParty)
            if awardRecord & pow(2, i):
                continue
            itemList = awardDict[point]
            for itemID, itemCnt, isBind in itemList:
                totalItemDict[itemID] = totalItemDict.get(itemID, 0) + itemCnt
            DataRecordPack.DR_WeekPartyPoint(curPlayer, day, point)
    if not totalItemDict:
        return
    totalItemList = [[itemID, itemCnt, 1] for itemID, itemCnt in totalItemDict.items()]
    PlayerControl.SendMailByKey('SecondWeekReward', [curPlayer.GetID()], totalItemList)
    return
 
def __GetPointAwardInfo(cfgPointAwardInfo, worldLV):
    return GameWorld.GetDictValueByRangeKey(cfgPointAwardInfo, worldLV, {})
 
def AddWeekPartyActionCnt(curPlayer, actionID, addCnt=1, isAdd=True, isCompatible=False, isSync=True):
    '''Ôö¼ÓÖÜ¿ñ»¶Ïà¹Ø»î¶¯Íê³É´ÎÊý'''
    PlayerFeastWeekParty.AddFeastWeekPartyActionCnt(curPlayer, actionID, addCnt, isAdd, isCompatible, isSync)
    #ÅжϻÊÇ·ñ¿ªÆô
    if not addCnt:
        return
    actWeekPartyInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WeekParty, {})
    state = actWeekPartyInfo.get(ShareDefine.ActKey_State, 0)
    cfgID = actWeekPartyInfo.get(ShareDefine.ActKey_CfgID, 0)
    
    if not cfgID:
        return
    if not state:
        return
    
    actBossIpyData = IpyGameDataPY.GetIpyGameData("ActWeekParty", cfgID)
    if not actBossIpyData:
        return
    templateIDList = actBossIpyData.GetTemplateID()
    dayIndex = actWeekPartyInfo.get(ShareDefine.ActKey_DayIndex, 0)
    if dayIndex >= len(templateIDList):
        return
    if actionID in [ChConfig.Def_WPAct_Login]:
        addDayIndexList = [dayIndex]
    else:
        addDayIndexList = range(dayIndex + 1)
    for dayIndex in addDayIndexList:
        dayTidList = templateIDList[dayIndex]
        findTidList = []
        for tid in dayTidList:
            if tid / 100 == actionID:
                findTidList.append(tid)
        if not findTidList:
            continue
        for findTid in findTidList:
            ipyData = IpyGameDataPY.GetIpyGameData('WeekParty', findTid)
            if not ipyData:
                continue
            totalTimes = ipyData.GetTotalTimes()
            curTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyCurTimes % (dayIndex, findTid), 0, ChConfig.Def_PDictType_WeekParty)
            if isAdd:
                curAddCnt = addCnt if totalTimes == 0 else min(totalTimes - curTimes, addCnt)
                if curAddCnt <= 0:
                    continue
                updTimes = curTimes + curAddCnt
            else:
                if not isCompatible and addCnt != totalTimes:
                    continue
                updTimes = min(addCnt, totalTimes)
            realAddCnt = updTimes - curTimes
            if realAddCnt <= 0:
                continue
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WeekPartyCurTimes % (dayIndex, findTid), updTimes, ChConfig.Def_PDictType_WeekParty)
            #¼Ó»ý·Ö
            singleTimes = ipyData.GetSingleTimes()
            addPoint = (curTimes % singleTimes + realAddCnt) / singleTimes * ipyData.GetPoint()
            curPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyPoint % dayIndex, 0, ChConfig.Def_PDictType_WeekParty)
            updPoint = curPoint + addPoint
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WeekPartyPoint % dayIndex, updPoint, ChConfig.Def_PDictType_WeekParty)
            GameWorld.DebugLog('   Ôö¼ÓÖÜ¿ñ»¶Ïà¹Ø»î¶¯Íê³É´ÎÊý dayIndex=%s, findTid=%s, curTimes=%s, updTimes=%s, realAddCnt=%s,addPoint=%s' % (dayIndex, findTid, curTimes, updTimes, realAddCnt, addPoint))
            if isSync:
                SyncWeekPartyPlayerInfo(curPlayer, dayIndex, findTid)
    return True
 
def CheckWeekPartyActionCnt(curPlayer, isSync):
    ## Í¬²½»î¶¯×´Ì¬Ê±ÐèÒª´¥·¢µÄ
    
    # Áé³è¼¤»î
    petDataPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptPet)
    for petDataIndex in range(petDataPack.GetCount()):
        petItem = petDataPack.GetAt(petDataIndex)
        if petItem.IsEmpty():
            continue
        petNPCID = petItem.GetUserAttr(ShareDefine.Def_IudetPet_NPCID)
        AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_Pet, petNPCID, False, isSync=isSync)
        
    # ³öÕ½ÉñÊÞ
    ipyDataMgr = IpyGameDataPY.IPY_Data()
    for i in xrange(ipyDataMgr.GetDogzCount()):
        ipyData = ipyDataMgr.GetDogzByIndex(i)
        if GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_DogzFightState, i):
            AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_Dogz, ipyData.GetDogzID(), False, isSync=isSync)
            
    # ´©´÷ijƷÖÊ·ûÓ¡
    runeHoleCnt = IpyGameDataPY.GetFuncCfg("RuneUnlock", 4)
    for holeNum in xrange(1, runeHoleCnt + 1):
        runeData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Rune_Data % holeNum, 0)
        if not runeData:
            continue
        runeItemID = ItemControler.GetRuneItemID(runeData)
        itemData = GameWorld.GetGameData().GetItemByTypeID(runeItemID)
        if not itemData:
            continue
        itemColor = itemData.GetItemColor()
        AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_Rune, itemColor, False, isSync=isSync)
        
    AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_Login, 1, False, False, isSync)
    passlv = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_TrialTower_PassLV)
    AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_Tower, passlv, False, True, isSync)
    AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_Stone, Operate_EquipStone.GetTotalStoneLV(curPlayer), False, True, isSync)
    AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_GodWeapon, PlayerGodWeapon.GetGodWeaponTotalLV(curPlayer), False, True, isSync)
    return
 
def GetWeekPartyActionAward(curPlayer, day, templateID):
    '''ÁìÈ¡ÖÜ¿ñ»¶»î¶¯½±Àø'''
    templateID = GameWorld.ToIntDef(templateID, 0)
    actWeekPartyInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WeekParty, {})
    state = actWeekPartyInfo.get(ShareDefine.ActKey_State, 0)
    cfgID = actWeekPartyInfo.get(ShareDefine.ActKey_CfgID, 0)
    if not state or not cfgID:
        return
    actBossIpyData = IpyGameDataPY.GetIpyGameData("ActWeekParty", cfgID)
    if not actBossIpyData:
        return
    templateIDList = actBossIpyData.GetTemplateID()
    if not templateIDList:
        return
    if day >= len(templateIDList):
        return
    dayTempIDList = templateIDList[day]
    if templateID not in dayTempIDList:
        return
    ipyData = IpyGameDataPY.GetIpyGameData('WeekParty', templateID)
    if not ipyData:
        return
    singleTimes = ipyData.GetSingleTimes()
    curTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyCurTimes % (day, templateID), 0, ChConfig.Def_PDictType_WeekParty)
    gotTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyGotTimes % (day, templateID), 0, ChConfig.Def_PDictType_WeekParty)
    if curTimes - gotTimes < singleTimes:
        return
    
    #¸ø½±Àø
    playerWorldLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyWorldLV, 0, ChConfig.Def_PDictType_WeekParty)
    awardDict = __GetAwardItem(curPlayer, ipyData, playerWorldLV)
    # ¼ì²é±³°ü
    needSpace = len(awardDict)
    packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, needSpace)
    if needSpace > packSpace:
        PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_998371")
        return
    #¸üдÎÊý Ã¿´ÎÁì½±Ö»ÁìÒ»´Î
    newGotTimes = gotTimes + singleTimes
    
    #GameWorld.Log('  actionID=%s,curTimes=%s,gotTimes=%s,singleTimes=%s,newGotTimes=%s'%(actionID, curTimes, gotTimes,singleTimes, newGotTimes))
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WeekPartyGotTimes % (day, templateID), newGotTimes, ChConfig.Def_PDictType_WeekParty)
    for itemID, itemCnt in awardDict.items():
        ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, 0, [IPY_GameWorld.rptItem])
    ItemControler.NotifyGiveAwardInfo(curPlayer, awardDict, "WeekParty")
    SyncWeekPartyPlayerInfo(curPlayer, day, templateID)
    return
 
 
def GetWeekPartyPointAward(curPlayer, day, getPoint):
    ##ÁìÈ¡ÖÜ¿ñ»¶»ý·Ö½±Àø
    getPoint = GameWorld.ToIntDef(getPoint, 0)
    actWeekPartyInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WeekParty, {})
    state = actWeekPartyInfo.get(ShareDefine.ActKey_State, 0)
    cfgID = actWeekPartyInfo.get(ShareDefine.ActKey_CfgID, 0)
    if not state or not cfgID:
        return
    actBossIpyData = IpyGameDataPY.GetIpyGameData("ActWeekParty", cfgID)
    if not actBossIpyData:
        return
    curPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyPoint % day, 0, ChConfig.Def_PDictType_WeekParty)
    if curPoint < getPoint:
        return
    worldLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyWorldLV, 0, ChConfig.Def_PDictType_WeekParty)
    pointAwardInfo = __GetPointAwardInfo(actBossIpyData.GetPointAward(), worldLV)
    pointAwardDict = pointAwardInfo.get(day, {})
    pointList = pointAwardDict.keys()
    pointList.sort()
    if getPoint not in pointList:
        return
    getIndex = pointList.index(getPoint)
    awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyAwardRecord % day, 0, ChConfig.Def_PDictType_WeekParty)
    if awardRecord & pow(2, getIndex):
        GameWorld.Log(' ÁìÈ¡ÖÜ¿ñ»¶»ý·Ö½±Àø£¬ ÒÑÁìÈ¡ day=%s, getPoint=%s' % (day, getPoint))
        return
    itemList = pointAwardDict[getPoint]
    needSpace = len(itemList)
    packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, needSpace)
    if needSpace > packSpace:
        PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_998371")
        return
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WeekPartyAwardRecord % day, awardRecord | pow(2, getIndex), ChConfig.Def_PDictType_WeekParty)
    for itemID, itemCnt, isBind in itemList:
        ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, 0, [IPY_GameWorld.rptItem])
    ItemControler.NotifyGiveAwardInfo(curPlayer, itemList, "WeekParty")
    SyncWeekPartyPlayerInfo(curPlayer, day)
    DataRecordPack.DR_WeekPartyPoint(curPlayer, day, getPoint)
    return
 
 
def __GetAwardItem(curPlayer, ipyData, worldLV, times=1):
    awardDict = {}
    awardItemList = __GetAwardItemListByJob(curPlayer, ipyData.GetReward(), worldLV)
    for itemID, itemCnt, isbind in awardItemList:
        if not itemID or not itemCnt:
            continue
        awardDict[itemID] = awardDict.get(itemID, 0) + itemCnt * times
        
    return awardDict
 
def __GetAwardItemListByJob(curPlayer, rewardItemInfo, worldLV):
    ## ¸ù¾ÝÖ°Òµ»ñÈ¡¶ÔÓ¦½±Àø
    if not rewardItemInfo:
        return []
    if isinstance(rewardItemInfo, dict):
        keyList = rewardItemInfo.keys()
        # ÅäÊÀ½çµÈ¼¶·¶Î§µÄ
        if isinstance(keyList[0], tuple) and len(keyList[0]) == 2:
            return __GetAwardItemListByJob(curPlayer, GameWorld.GetDictValueByRangeKey(rewardItemInfo, worldLV), worldLV)
        return rewardItemInfo.get(curPlayer.GetJob(), [])
    return rewardItemInfo
 
def SyncWeekPartyPlayerInfo(curPlayer, day= -1, templateID= -1):
    #֪ͨµ±Ç°´ÎÊý¡¢ÒÑÁì´ÎÊý 
    actWeekPartyInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WeekParty, {})
    state = actWeekPartyInfo.get(ShareDefine.ActKey_State, 0)
    cfgID = actWeekPartyInfo.get(ShareDefine.ActKey_CfgID, 0)
    if not state or not cfgID:
        return
    actBossIpyData = IpyGameDataPY.GetIpyGameData("ActWeekParty", cfgID)
    if not actBossIpyData:
        return
    templateIDList = actBossIpyData.GetTemplateID()
    if not templateIDList:
        return
    if day != -1:
        if day >= len(templateIDList):
            return
        syncDayList = [day]
    else:
        syncDayList = range(len(templateIDList))
        
    packData = ChPyNetSendPack.tagMCWeekPartyPlayerInfo()
    packData.DayInfoList = []
    for cday in syncDayList:
        tiemInfo = ChPyNetSendPack.tagMCWeekPartyDayPlayerInfo()
        tiemInfo.DayIndex = cday
        tiemInfo.Point = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyPoint % cday, 0, ChConfig.Def_PDictType_WeekParty)
        tiemInfo.AwardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyAwardRecord % cday, 0, ChConfig.Def_PDictType_WeekParty)
        tiemInfo.TaskList = []
        for tID in templateIDList[cday]:
            if templateID != -1 and tID != templateID:
                continue
            tipyData = IpyGameDataPY.GetIpyGameData('WeekParty', tID)
            if not tipyData:
                continue
            taskInfo = ChPyNetSendPack.tagMCWeekPartyTaskInfo()
            taskInfo.TemplateID = tID
            taskInfo.CurTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyCurTimes % (cday, tID), 0, ChConfig.Def_PDictType_WeekParty)
            taskInfo.GotTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyGotTimes % (cday, tID), 0, ChConfig.Def_PDictType_WeekParty)
            tiemInfo.TaskList.append(taskInfo)
        tiemInfo.ACount = len(tiemInfo.TaskList)
        packData.DayInfoList.append(tiemInfo)
    packData.Count = len(packData.DayInfoList)
    NetPackCommon.SendFakePack(curPlayer, packData)
    return
 
 
def SyncWeekPartyInfo(curPlayer):
    actWeekPartyInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WeekParty, {})
    state = actWeekPartyInfo.get(ShareDefine.ActKey_State, 0)
    cfgID = actWeekPartyInfo.get(ShareDefine.ActKey_CfgID, 0)
    if not cfgID:
        return
    actBossIpyData = IpyGameDataPY.GetIpyGameData("ActWeekParty", cfgID)
    if not actBossIpyData:
        return
    templateIDList = actBossIpyData.GetTemplateID()
    if not templateIDList:
        return
    worldLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyWorldLV, 0, ChConfig.Def_PDictType_WeekParty)
    pointAwardDict = __GetPointAwardInfo(actBossIpyData.GetPointAward(), worldLV)
    startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(actBossIpyData)
    actInfo = ChPyNetSendPack.tagMCWeekPartyInfo()
    actInfo.Clear()
    actInfo.StartDate = startDateStr
    actInfo.EndtDate = endDateStr
    actInfo.AdvanceMinutes = actBossIpyData.GetAdvanceMinutes()
    actInfo.IsDayReset = actBossIpyData.GetIsDayReset()
    actInfo.ResetType = actBossIpyData.GetResetType()
    actInfo.LimitLV = actBossIpyData.GetLVLimit()
    actInfo.DayInfoList = []
    tidList = []
    for day, dayActList in enumerate(templateIDList):
        dayInfo = ChPyNetSendPack.tagMCWeekPartyDayInfo()
        dayInfo.TemplateList = dayActList
        dayInfo.ActCnt = len(dayActList)
        for tid in dayActList:
            if tid not in tidList:
                tidList.append(tid)
        dayInfo.PItemInfo = []
        for point, itemList in pointAwardDict.get(day, {}).items():
            for itemID, itemCnt, isBind in itemList:
                awardItem = ChPyNetSendPack.tagMCWeekPartyItem()
                awardItem.ItemID = itemID
                awardItem.ItemCnt = itemCnt
                awardItem.IsBind = isBind
                awardItem.NeedPoint = point
                dayInfo.PItemInfo.append(awardItem)
        dayInfo.PCount = len(dayInfo.PItemInfo)
        actInfo.DayInfoList.append(dayInfo)
    actInfo.DayCnt = len(actInfo.DayInfoList)
    actInfo.ActionInfo = []
    for tid in tidList:
        ipyData = IpyGameDataPY.GetIpyGameData('WeekParty', tid)
        if not ipyData:
            GameWorld.ErrLog('    ÖÜ¿ñ»¶Ä£°å±íÕÒ²»µ½Ä£°å%s' % tid)
            continue
        tInfo = ChPyNetSendPack.tagMCWeekPartyAction()
        tInfo.TemplateID = tid
        tInfo.ActionType = ipyData.GetActionType()
        tInfo.TotalTimes = ipyData.GetTotalTimes()
        tInfo.SingleTimes = ipyData.GetSingleTimes()
        tInfo.Point = ipyData.GetPoint()
        tInfo.ItemInfo = []
        awardItemList = __GetAwardItemListByJob(curPlayer, ipyData.GetReward(), worldLV)
        for itemID, itemCnt, isBind in awardItemList:
            awardItem = ChPyNetSendPack.tagMCWeekPartyItem()
            awardItem.ItemID = itemID
            awardItem.ItemCnt = itemCnt
            awardItem.IsBind = isBind
            awardItem.NeedPoint = 0
            tInfo.ItemInfo.append(awardItem)
        tInfo.Count = len(tInfo.ItemInfo)
        actInfo.ActionInfo.append(tInfo)
    actInfo.TCount = len(actInfo.ActionInfo)
    NetPackCommon.SendFakePack(curPlayer, actInfo)
    return