hch
2018-09-04 d38c7d1761ffcf23758289dbc9b7a25f700caf6e
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
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
#-------------------------------------------------------------------------------
#
##@package Player.PlayerActivity
#
# @todo:Íæ¼ÒÿÈÕ»îÔ¾¶È
# @author xdh
# @date 2014-07-14
# @version 1.0
#
# ÏêϸÃèÊö: Íæ¼ÒÿÈÕ»îÔ¾¶È¡¢Ã¿Èջ
#---------------------------------------------------------------------
#"""Version = 2017-02-25 11:30"""
#---------------------------------------------------------------------
 
import ChConfig
import ChPyNetSendPack
import NetPackCommon
import ShareDefine
import GameWorld
import ItemCommon
import IPY_GameWorld
import PlayerControl
import ItemControler
import IpyGameDataPY
import PyGameData
import GameFuncComm
 
 
#¹ØÁªÀàÐÍ
(
RelatedType_1, # 1¹ØÁªÈÕ³£»î¶¯±í
RelatedType_2, # 2¹ØÁª¸±±¾×ܱí
) = range(1, 3)
 
 
 
def OnWeek(curPlayer, onWeekType):
    actionIDInfo = []
    ipyDataMgr = IpyGameDataPY.IPY_Data()
    for i in xrange(ipyDataMgr.GetDailyActionCount()):
        ipyData = ipyDataMgr.GetDailyActionByIndex(i)
        weekTimesLimit = ipyData.GetWeekTimes()
        if not weekTimesLimit:
            continue
        # ÖØÖÃÀàÐͲ»Í¬µÄ²»´¦Àí
        if ipyData.GetWeekResetType() != onWeekType:
            continue
        key = ChConfig.Def_PDict_DailyActionWeekTimes%ipyData.GetDailyID()
        __SetPDictValue(curPlayer, key, 0)
    
        actionIDInfo.append(ipyData.GetDailyID())
            
    if actionIDInfo:
        SyncDailyActionInfo(curPlayer, actionIDInfo)
        
    return
 
 
## OnDay
#  @param curPlayer Íæ¼ÒʵÀý
#  @return
def OnDay(curPlayer, onEventType):
    
    ipyDataMgr = IpyGameDataPY.IPY_Data()
    if onEventType == ShareDefine.Def_OnEventTypeEx:
        # ÖØÖÃÍê³É´ÎÊý
        for i in xrange(ipyDataMgr.GetDailyQuestCount()):
            key = ChConfig.Def_PDict_Activity_FinishCnt % (i+1)
            curPBCnt = __GetPDictValue(curPlayer, key) #µ¥´Î½ø¶ÈÖµ
            if curPBCnt:
                __SetPDictValue(curPlayer, key, 0)
        #×Ü»îÔ¾¶ÈÖØÖÃ
        __SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint, 0)
        # ÖØÖÃÁì½±¼Ç¼
        __SetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityAwardRecord, 0)
        #ÖØÐ¼ÆËã½±Àø½×¶Î
        __CalcAwardStage(curPlayer)
        #ÖØÖÿÉÁìÈ¡ÐÞÐе㣬δÁìÈ¡µÄ·¢Óʼþ
        realmPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_RealmPoint)
        if realmPoint and GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Official):
            if GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_DailyQuest):
                PlayerControl.SendMailByKey('XXDForgetToPick', [curPlayer.GetID()], [(ChConfig.Def_ItemID_RealmPoint, realmPoint, 1)], [realmPoint])
            __SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_RealmPoint, 0)
        
        SyncDailyActivityInfo(curPlayer)
    else:
        SendDayActionMail(curPlayer)
    
    #ÈÕ³£»î¶¯ÖØÖÃ
    actionIDInfo = []
    for i in xrange(ipyDataMgr.GetDailyActionCount()):
        ipyData = ipyDataMgr.GetDailyActionByIndex(i)
        dayTimesLimit = GetMaxDayTimes(ipyData)#ipyData.GetDayTimes()
        if not dayTimesLimit:
            continue
        # ÖØÖÃÀàÐͲ»Í¬µÄ²»´¦Àí
        if ipyData.GetDayResetType() != onEventType:
            continue
        key = ChConfig.Def_PDict_DailyActionDayTimes%ipyData.GetDailyID()
        __SetPDictValue(curPlayer, key, 0)
        actionIDInfo.append(ipyData.GetDailyID())
    if actionIDInfo:
        SyncDailyActionInfo(curPlayer, actionIDInfo)
    return
 
def SendDayActionMail(curPlayer):
    ##·¢ËÍÿÈջÓʼþ
    if curPlayer.GetLV()>= IpyGameDataPY.GetFuncCfg('DailyQuestMailLvLimit'):
        PlayerControl.SendMailByKey('TodayDailyTask', [curPlayer.GetID()], [])
    return
 
 
#ÖØÐ¼ÆËã½±Àø½×¶Î
def __CalcAwardStage(curPlayer):
    realmLV= curPlayer.GetOfficialRank()
    ipyData = IpyGameDataPY.IPY_Data().GetDailyLivenessRewardByIndex(0)
    if not ipyData:
        return
    stageLVList = ipyData.GetStageLV()
    curStage = 0
    for i, lv in enumerate(stageLVList):
        if realmLV <lv:
            break
        if realmLV >= lv:
            curStage = i
    __SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_AwardStage, curStage)
    GameWorld.DebugLog('    ÖØÐ¼ÆËã»îÔ¾½±Àø½×¶Î curStage=%s,realmLV=%s'%(curStage, realmLV))
    return
 
## OnLogin
#  @param curPlayer Íæ¼ÒʵÀý
#  @return
def OnLogin(curPlayer):
    # Í¬²½Íê³É¶È¼°Áì½±¼Ç¼
    SyncDailyActivityInfo(curPlayer)
    #ͬ²½ÈÕ³£»î¶¯´ÎÊý
    SyncDailyActionInfo(curPlayer)
    return
 
 
## »ñÈ¡»îÔ¾¶ÈÍæ¼ÒÊý¾Ý¿â×ÖµäÐÅÏ¢Öµ
#  @param curPlayer Íæ¼ÒʵÀý
#  @param key ×Öµäkey
#  @param defaultValue Ä¬ÈÏÖµ
#  @return
def __GetPDictValue(curPlayer, key, defaultValue=0):
    return curPlayer.NomalDictGetProperty(key, defaultValue)
 
## ÉèÖûîÔ¾¶ÈÍæ¼ÒÊý¾Ý¿â×ÖµäÐÅÏ¢Öµ
#  @param curPlayer Íæ¼ÒʵÀý
#  @param key ×Öµäkey
#  @param value ÉèÖõÄÖµ
#  @return
def __SetPDictValue(curPlayer, key, value):
    PlayerControl.NomalDictSetProperty(curPlayer, key, value)
    return
 
 
## ¿Û³ý»õ±Ò»ñµÃ»îÔ¾¶È
#  @param curPlayer Íæ¼ÒʵÀý
#  @param type_Price 
#  @param price 
#  @return
def OnPayMoneyActivity(curPlayer, type_Price, price):
    #½ð×ÓÖ§¸¶
#    if type_Price == IPY_GameWorld.TYPE_Price_Gold_Money:
#        AddActivityFinishCnt(curPlayer, ShareDefine.ActivityNum_UseGoldCnt)
#    #½ðƱ֧¸¶
#    elif type_Price == IPY_GameWorld.TYPE_Price_Gold_Paper:
#        AddActivityFinishCnt(curPlayer, ShareDefine.ActivityNum_UseGoldPaperCnt)
        
    return
 
 
 
## ÃþNPC»ñµÃ»îÔ¾¶È
#  @param atkObj
#  @param curNPC 
#  @return
def OnAttackNPCActivity(atkObj, curNPC):
    atkObjType = atkObj.GetGameObjType()
    
    # ²»ÊÇÍæ¼ÒÔݲ»´¦Àí
    if atkObjType != IPY_GameWorld.gotPlayer:
        return
                
    # »÷ɱboss
#    if curNPC.GetIsBoss():
#        canAddBossIDList = ReadChConfig.GetEvalChConfig("Activity_BossID")
#        
#        if curNPC.GetNPCID() in canAddBossIDList:
#            AddActivityFinishCnt(atkObj, ShareDefine.ActivityNum_KillBoss)
        
    return
 
## Ôö¼ÓÍê³É»îÔ¾¶È´ÎÊý
#  @param curPlayer Íæ¼ÒʵÀý
#  @param activityNum »îÔ¾¶È±àºÅ 
#  @param finishCnt ÒÑÍê³É´ÎÊý
#  @param addCnt Ôö¼Ó´ÎÊý£¬Ä¬ÈÏ1 
#  @return
def AddActivityFinishCnt(curPlayer, activityNum, finishCnt, addCnt):
    
    dailyQuestData = IpyGameDataPY.GetIpyGameDataNotLog('DailyQuest', activityNum)
    if not dailyQuestData:
        return
    
    maxActiveValue = dailyQuestData.GetTotalActiveValue()
    onceActivity = dailyQuestData.GetOnceActivity()
    onceActivityTime = dailyQuestData.GetOnceActivityTime()
    if not onceActivity:
        return
    if maxActiveValue and finishCnt > maxActiveValue/onceActivity*onceActivityTime:
        #GameWorld.DebugLog("»îÔ¾¶È¿ÉÍê³É´ÎÊýÒÑ´ïµ½ÉÏÏÞ,activityNum=%s" % (activityNum))
        return
    
    key = ChConfig.Def_PDict_Activity_FinishCnt % activityNum
    curPBCnt = __GetPDictValue(curPlayer, key) #µ¥´Î½ø¶ÈÖµ
    
    addValue = (addCnt+curPBCnt)/onceActivityTime * onceActivity #Ôö¼ÓµÄ»îÔ¾¶È
    addPbCnt = (addCnt+curPBCnt) % onceActivityTime
    
    __SetPDictValue(curPlayer, key, addPbCnt)
    
    #curTotalPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint)
    multiple = 1
    if addValue:
        #__SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint, nuwTotalPoint)
        multiple = __GetActionAddPer(curPlayer)
        addValue *= multiple
        
        realmPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_RealmPoint)
        __SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_RealmPoint, realmPoint+addValue)
        SyncDailyActivityInfo(curPlayer)
        
    GameWorld.DebugLog("Ôö¼Ó»îÔ¾¶ÈÈÎÎñ´ÎÊý£¬activityNum=%s,addPbCnt=%s,addValue=%s, multiple=%s"  
                       % (activityNum, addPbCnt, addValue, multiple), curPlayer.GetPlayerID())
    return
 
def __GetActionAddPer(curPlayer):
    multiple = 1
    actRealmPointInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_RealmPoint, {})# ¶à±¶ÐÞÐеã»î¶¯
    if not actRealmPointInfo:
        return multiple
    if actRealmPointInfo.get(ShareDefine.ActKey_State) \
            and curPlayer.GetLV() >= actRealmPointInfo.get(ShareDefine.ActKey_LVLimit, 0):
        #´Ó¿ªÊ¼ÌìµÄ5µãµ½½áÊøÌìµÄ5µã
        startData = GameWorld.GetDateTimeByStr(actRealmPointInfo[ShareDefine.ActKey_StartDate], ChConfig.TYPE_Time_Format_Day)
        endData = GameWorld.GetDateTimeByStr(actRealmPointInfo[ShareDefine.ActKey_EndDate], ChConfig.TYPE_Time_Format_Day)
        curTime = GameWorld.GetCurrentTime()
        
        curHour = GameWorld.GetCurrentTime().hour
        if curTime.year == startData.year and curTime.month == startData.month and curTime.day == startData.day:
            if 0<=curHour<5:
                #GameWorld.DebugLog('¶à±¶ÐÞÐе㿪ʼÌìµÄ0-5µã²»ÉúЧ')
                return multiple
        if curTime.year == endData.year and curTime.month == endData.month and curTime.day == endData.day:
            if curHour >=5:
                #GameWorld.DebugLog('¶à±¶ÐÞÐеã½áÊøÌìµÄ5µãÖ®ºó²»ÉúЧ')
                return multiple
        multiple = actRealmPointInfo.get(ShareDefine.ActKey_RealmPointMulti, 1)
    return multiple
 
## Í¬²½»îÔ¾¶ÈÐÅÏ¢
#  @param curPlayer
#  @param syncNum Ä¬ÈÏ-1ʱȫ²¿Í¬²½
#  @return None
def SyncDailyActivityInfo(curPlayer):
    sendPack = ChPyNetSendPack.tagMCDailyActivityInfoList()
    sendPack.Clear()
    sendPack.CurValue = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint)
    sendPack.StageIndex = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_AwardStage)
    sendPack.AwardRecord = __GetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityAwardRecord)
    sendPack.RealmPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_RealmPoint)
    NetPackCommon.SendFakePack(curPlayer, sendPack)
    return
 
 
 
## ÁìÈ¡»îÔ¾¶È½±Àø
#  @param curPlayer
#  @param awardIndex
#  @return None
def GetActivityAward(curPlayer, awardIndex):
    rewardCount = IpyGameDataPY.IPY_Data().GetDailyLivenessRewardCount()
 
    if awardIndex < 0 or awardIndex >= rewardCount:
        GameWorld.ErrLog("»îÔ¾¶È½±ÀøË÷Òý²»ºÏ·¨,index=%s,Len=%s" % (awardIndex, rewardCount))
        return
    
    # ÅжÏÊÇ·ñÒÑÁìÈ¡
    getAwardRecord = __GetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityAwardRecord)
    if getAwardRecord & pow(2, awardIndex):
        GameWorld.Log("ÒѾ­ÁìÈ¡¹ý¸Ã»îÔ¾¶È½±Àø,index=%s" % (awardIndex))
        return
    
    ipyData = IpyGameDataPY.IPY_Data().GetDailyLivenessRewardByIndex(awardIndex)
    
    needActivity = ipyData.GetLiveness()
    totalActivity = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint)
    
    # ÅжϻîÔ¾¶È
    if totalActivity < needActivity:
        GameWorld.Log("Áì½±»îÔ¾¶È²»×ã,index=%s,needActivity=%s,totalActivity=%s" 
                      % (awardIndex, needActivity, totalActivity))
        return
    
    awardStage = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_AwardStage)
   
    itemIDList = ipyData.GetItemID()
    itemCntList = ipyData.GetItemCount()
    itemIsBindList = ipyData.GetItemBind()
    if awardStage >=len(itemIDList) or awardStage >= len(itemCntList) or awardStage >= len(itemIsBindList):
        return
 
    itemID = itemIDList[awardStage]
    itemCnt = itemCntList[awardStage]
    isBind = itemIsBindList[awardStage]
    # ¼ì²é±³°ü
    packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem)
    if 1 > packSpace:
        PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_998371")
        return
    
    # ¸øÎïÆ·
    ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, isBind, [IPY_GameWorld.rptItem], True)
 
    # ¸üÐÂÒÑÁìÈ¡³É¹¦±ê¼Ç
    updAwardRecord = getAwardRecord | (1 << awardIndex)
    __SetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityAwardRecord, updAwardRecord)
    SyncDailyActivityInfo(curPlayer)
    GameWorld.DebugLog("ÁìÈ¡»îÔ¾¶È½±ÀøOK£¡awardStage=%s, index=%s,needActivity=%s,totalActivity=%s,awardRecord=%s" 
                       % (awardStage, awardIndex, needActivity, totalActivity, updAwardRecord))
 
    
    
    return
 
def GetRealmPointAward(curPlayer):
    #ÁìÈ¡»îÔ¾ÐÞÐеã
    realmPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_RealmPoint)
    if not realmPoint:
        return
    PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_RealmPoint, realmPoint)
    __SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_RealmPoint, 0)
    #totalPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint)
    #__SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint, totalPoint+realmPoint)
    SyncDailyActivityInfo(curPlayer)
    return
 
def GetActivityNum(relatedType, relatedID):
    ## »ñÈ¡ÈÕ³£ÈÎÎñID£¨»îÔ¾ID£©
    ipyData = IpyGameDataPY.GetIpyGameDataByCondition('DailyQuest', {"RelatedID":relatedID,"RelatedType":relatedType}, False, False)
    if not ipyData:
        return 0
    return ipyData.GetID()
 
#########################################ÈÕ³£»î¶¯###########################################
 
def AddDailyActionFinishCnt(curPlayer, dailyID, addCnt=1):
    ##Ôö¼ÓÈÕ³£»î¶¯Íê³É´ÎÊý
    ipyData = IpyGameDataPY.GetIpyGameData('DailyAction', dailyID)
    if not ipyData:
        return
#    if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_DailyQuest):
#        #GameWorld.DebugLog("ÈÕ³£ÈÎÎñ¹¦ÄÜ먦Æô£¡dailyID=%s" % dailyID)
#        return
    
    # ÓÉGameServer¾ö¶¨
    if not GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_DailyActionState % dailyID):
        GameWorld.DebugLog("ÈÕ³£»î¶¯Î´¿ªÆô£¡dailyID=%s" % dailyID)
        return
    
    dayTimesLimit = GetMaxDayTimes(ipyData)#ipyData.GetDayTimes()
    weekTimesLimit = ipyData.GetWeekTimes()
    if not dayTimesLimit and not weekTimesLimit:
        return
    #¶ÔÓ¦µÄÈÕ³£ÈÎÎñ±íID
    activityNum = GetActivityNum(RelatedType_1, dailyID)
    dailyQuestData = IpyGameDataPY.GetIpyGameDataNotLog('DailyQuest', activityNum)
    unLimitCnt = dailyQuestData and not dailyQuestData.GetTotalActiveValue()
        
    updDayTimes = 0
    if dayTimesLimit:
        key = ChConfig.Def_PDict_DailyActionDayTimes%dailyID
        curDayTimes = curPlayer.NomalDictGetProperty(key)
        if not unLimitCnt and curDayTimes >= dayTimesLimit:
            return
        updDayTimes =  curDayTimes+addCnt if unLimitCnt else min(dayTimesLimit, curDayTimes+addCnt)
        PlayerControl.NomalDictSetProperty(curPlayer, key, updDayTimes)
        GameWorld.DebugLog('Ôö¼ÓÈÕ³£»î¶¯Íê³É´ÎÊý dailyID=%s, curDayTimes=%s, updDayTimes=%s'%(dailyID, curDayTimes, updDayTimes))
    
    if weekTimesLimit:
        key = ChConfig.Def_PDict_DailyActionWeekTimes%dailyID
        curWeekTimes = curPlayer.NomalDictGetProperty(key)
        if not unLimitCnt and curWeekTimes >= weekTimesLimit:
            return
        updWeekTimes =  curWeekTimes+addCnt if unLimitCnt else min(weekTimesLimit, curWeekTimes+addCnt)
        PlayerControl.NomalDictSetProperty(curPlayer, key, updWeekTimes)
        GameWorld.DebugLog('Ôö¼ÓÈÕ³£»î¶¯Íê³É´ÎÊý dailyID=%s, curWeekTimes=%s, updWeekTimes=%s'%(dailyID, curWeekTimes, updWeekTimes))
 
    SyncDailyActionInfo(curPlayer, [dailyID])
    
    #¶ÔÓ¦µÄÈÕ³£ÈÎÎñ±íID
    updTimes = updDayTimes or updWeekTimes
    if updTimes and dailyQuestData:
        AddActivityFinishCnt(curPlayer, activityNum, updTimes, addCnt)
    return True
 
def GetDailyActionFinishCnt(curPlayer, dailyID):
    key = ChConfig.Def_PDict_DailyActionDayTimes%dailyID
    curDayTimes = __GetPDictValue(curPlayer, key)
    ipyData = IpyGameDataPY.GetIpyGameData('DailyAction', dailyID)
    if not ipyData:
        return 0, 0
    dayTimesLimit = GetMaxDayTimes(ipyData)#ipyData.GetDayTimes()
    return curDayTimes, dayTimesLimit
 
def GetMaxDayTimes(ipyData):
    dayTimesLimit = ipyData.GetDayTimes()
    if ipyData.GetDailyID() == ShareDefine.DailyActionID_TowerSD:
        dayTimesLimit += IpyGameDataPY.GetFuncCfg('RuneTowerSweepBuy')
    return dayTimesLimit
 
## Í¬²½»îÔ¾¶ÈÐÅÏ¢
#  @param curPlayer
#  @param syncNum Ä¬ÈÏ-1ʱȫ²¿Í¬²½
#  @return None
def SyncDailyActionInfo(curPlayer, syncNumList= []):
    sendPack = ChPyNetSendPack.tagMCDailyActionCnt()
    sendPack.Clear()
    sendPack.ActionInfo = []
    syncNumList = syncNumList if syncNumList else ShareDefine.DailyActionIDList
 
    for activityNum in syncNumList:
        activityInfo = ChPyNetSendPack.tagMCDailyActionInfo()
        activityInfo.Clear()
        activityInfo.ActionID = activityNum
        activityInfo.DayFinishCnt = __GetPDictValue(curPlayer, ChConfig.Def_PDict_DailyActionDayTimes % activityNum)
        activityInfo.WeekFinishCnt = __GetPDictValue(curPlayer, ChConfig.Def_PDict_DailyActionWeekTimes % activityNum)
        sendPack.ActionInfo.append(activityInfo)
    
    sendPack.Count = len(sendPack.ActionInfo)
    NetPackCommon.SendFakePack(curPlayer, sendPack)
    return
 
##################################¸±±¾ÀàÔö¼Ó»îÔ¾##########################################
## ²Î¼Ó¸±±¾»ñµÃ»îÔ¾¶È
#  @param curPlayer Íæ¼ÒʵÀý
#  @param tick 
#  @return
def OnEnterFBActivity(curPlayer, mapID, curDayTimes, addCount):
    activityNum = GetActivityNum(RelatedType_2, mapID)
    if activityNum: 
        AddActivityFinishCnt(curPlayer, activityNum, curDayTimes, addCount)
    return