hxp
2021-02-20 71a5b8c236d7538053a3a893adccaa0d59798521
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
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
#-------------------------------------------------------------------------------
#
##@package Player.PlayerWishingWell
#
# @todo:ÐíÔ¸³Ø
# @author xdh
# @date 2018-10-18 19:50
# @version 1.0
#
#
# ÏêϸÃèÊö: ÐíÔ¸³Ø
#
#---------------------------------------------------------------------
"""Version = 2018-10-18 19:50"""
#---------------------------------------------------------------------
 
import IPY_GameWorld
import GameWorld
import ChConfig
import IpyGameDataPY
import PlayerControl
import ChPyNetSendPack
import NetPackCommon
import ShareDefine
import PyGameData
import ItemControler
import ItemCommon
 
import datetime
import time
 
g_randomWellDict = {}
 
 
(
WellType_Select,  #¿ÉÑ¡¿â
WellType_Result,  #½á¹û¿â
WellType_Get,  #¿ÉÁìÈ¡¿â
) = range(3)
 
 
def __GetItemInfoByData(curPlayer, wellType, i):
    itemData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WishingWellItem % (wellType, i))
    itemCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WishingWellItemCnt % (wellType, i))
    itemID, isBind, isSpecial = itemData / 100, itemData % 100 / 10, itemData % 10
    return itemID, itemCnt, isBind, isSpecial
 
 
def __SetItemData(curPlayer, wellType, i, itemID, itemCnt, isBind, isSpecial):
    itemID = __GetJobItemID(curPlayer, itemID)
    itemData = itemID * 100 + isBind * 10 + isSpecial
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WishingWellItem % (wellType, i), itemData)
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WishingWellItemCnt % (wellType, i), itemCnt)
    return
 
 
def __GetJobItemID(curPlayer, itemID):
    if type(itemID) == int:
        return itemID
    if type(itemID) != dict:
        return 0
    return itemID.get(curPlayer.GetJob(), 0)
 
 
def OnLogin(curPlayer):
    isReset = __CheckPlayerWishingWellAction(curPlayer)
    if not isReset:
        actCostRebateInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WishingWell, {})
        # »î¶¯ÖÐͬ²½»î¶¯ÐÅÏ¢
        if actCostRebateInfo.get(ShareDefine.ActKey_State):
            SyncWishingWellInfo(curPlayer)
            SyncWishingWellPlayerInfo(curPlayer)
        elif __GetItemInfoByData(curPlayer, WellType_Get, 0)[0]:
            SyncWishingWellPlayerInfo(curPlayer)
    return
 
def OnDay(curPlayer):
    actCostRebateInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WishingWell, {})
    if not actCostRebateInfo.get(ShareDefine.ActKey_State):
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WishingWellFreeTime, 0)
        __SendWishingWellMail(curPlayer, int(time.time()))
    return
 
def RefreshWishingWellAction():
    __InitWishRateList()
    playerManager = GameWorld.GetPlayerManager()
    for i in xrange(playerManager.GetPlayerCount()):
        curPlayer = playerManager.GetPlayerByIndex(i)
        if curPlayer == None or not curPlayer.GetInitOK():
            continue
        __CheckPlayerWishingWellAction(curPlayer)
    return
 
 
def __CheckPlayerWishingWellAction(curPlayer):
    ## ¼ì²éÍæ¼ÒÐíÔ¸³Ø»î¶¯Êý¾ÝÐÅÏ¢
    global g_randomWellDict
 
    playerID = curPlayer.GetPlayerID()
    
    actWishingWellInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WishingWell, {})
    WishingWellID = actWishingWellInfo.get(ShareDefine.ActKey_ID, 0)
    state = actWishingWellInfo.get(ShareDefine.ActKey_State, 0)
    cfgID = actWishingWellInfo.get(ShareDefine.ActKey_CfgID, 0)
    worldLV = actWishingWellInfo.get(ShareDefine.ActKey_WorldLV, 0)
    playerWishingWellID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WishingWellID)  # Íæ¼ÒÉíÉϵĻID
    
    # »î¶¯ID ÏàͬµÄ»°²»´¦Àí
    if WishingWellID == playerWishingWellID:
        #GameWorld.DebugLog("ÐíÔ¸³Ø»î¶¯ID²»±ä£¬²»´¦Àí£¡", curPlayer.GetPlayerID())
        return
    
    GameWorld.DebugLog("ÐíÔ¸³ØÖØÖÃ! WishingWellID=%s,playerWishingWellID=%s,state=%s,worldLv=%s" 
                       % (WishingWellID, playerWishingWellID, state, worldLV), playerID)
    
    # Î´ÁìÈ¡µÄ½±ÀøÓʼþ·¢·Å
    curDataTime = GameWorld.GetCurrentTime()
    curDayTime = datetime.datetime(curDataTime.year, curDataTime.month, curDataTime.day, 0, 0, 0)
    curDayTimeNum = GameWorld.ChangeTimeStrToNum(str(curDayTime))
    __SendWishingWellMail(curPlayer, WishingWellID or curDayTimeNum, state)
        
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WishingWellID, WishingWellID)
    #ÿÌì¿ªÊ¼Ëæ»úÒ»´ÎÃâ·ÑÅÌ
    if state:
        #g_randomWellDict = {}
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WishingWellRefreshCnt, 0)
        __DoActWishingRefresh(curPlayer, 1, True)
 
        SyncWishingWellInfo(curPlayer)
    SyncWishingWellPlayerInfo(curPlayer)
    return True
 
 
def __SendWishingWellMail(curPlayer, curTime, state=-1):
    lastAwardTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WishingWellAwardTime)
    
    if not lastAwardTime:
        if state != -1:
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WishingWellAwardTime, curTime)
            GameWorld.DebugLog('__SendWishingWellMail curTime =%s'%curTime)
        return
    GameWorld.DebugLog('ÐíÔ¸³ØÎ´ÁìÈ¡µÄ½±ÀøÓʼþ·¢·Å¼ì²é lastAwardTime=%s,state=%s,pass=%s'%(lastAwardTime, state, curTime - lastAwardTime))
    passDay = (curTime - lastAwardTime)/86000
    if passDay <= 0:
        return
    isOver = True
    count = IpyGameDataPY.GetFuncCfg('WishingWellCfg', 4)
    mailItemList = []
    saveItemList = []
    for i in xrange(count):
        itemID, itemCnt, isBind, isSpecial = __GetItemInfoByData(curPlayer, WellType_Get, i)
        if itemID:
            mailItemList.append([itemID, itemCnt, isBind])
            __SetItemData(curPlayer, WellType_Get, i, 0, 0, 0, 0)
    j = 0
    for i in xrange(count):
        itemID, itemCnt, isBind, isSpecial = __GetItemInfoByData(curPlayer, WellType_Result, i)
        if not itemID:
            continue
        
        if passDay == 1: #Ïà²îÒ»Ì죬´æ´¢½±Àø 
            __SetItemData(curPlayer, WellType_Get, j, itemID, itemCnt, isBind, isSpecial)
            saveItemList.append([itemID, itemCnt, isBind])
            isOver = False
        elif passDay > 1: #´óÓÚ1Ì죬ֱ½ÓÓʼþ·¢½±Àø
            mailItemList.append([itemID, itemCnt, isBind])
        __SetItemData(curPlayer, WellType_Result, i, 0, 0, 0, 0)
        j +=1
    if state > 0:
        isOver = False
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WishingWellAwardTime, 0 if isOver else curTime)
    if mailItemList:
        PlayerControl.SendMailByKey('WishPool', [curPlayer.GetID()], mailItemList)
        if state == -1:
            SyncWishingWellPlayerInfo(curPlayer)
    GameWorld.DebugLog('ÐíÔ¸³Ø¾àÀëʱ¼ä passDay=%s,mailItemList=%s,saveItemList=%s,isOver=%s,curTime=%s'%(passDay, mailItemList, saveItemList, isOver, curTime), curPlayer.GetID())
    return
 
 
def __InitWishRateList():
    ## ³õʼÐíÔ¸³ØËæ»ú¿â
    global g_randomWellDict
    actWishingWellInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WishingWell, {})
    state = actWishingWellInfo.get(ShareDefine.ActKey_State, 0)
    cfgID = actWishingWellInfo.get(ShareDefine.ActKey_CfgID, 0)
    worldLV = actWishingWellInfo.get(ShareDefine.ActKey_WorldLV, 0)
    if not cfgID or not state:
        return
    actIpyData = IpyGameDataPY.GetIpyGameData("ActWishingWell", cfgID)
    if not actIpyData:
        return
    templateID = actIpyData.GetTemplateID()
    ipyDataList = IpyGameDataPY.GetIpyGameDataList('WishingWell', templateID)
    if not ipyDataList:
        return
    g_randomWellDict = {}  # {ÊÇ·ñÃâ·Ñ:[[È¨ÖØ,[ÎïÆ·ID,ÊýÁ¿,ÊÇ·ñ°ó¶¨,±êʶ]]]}
    weightDict = {}
    for ipyData in ipyDataList:
        worldLVLimit = ipyData.GetWorldLVLimit()
        if worldLV < worldLVLimit[0] or worldLV > worldLVLimit[1]:
            continue
        isFree = ipyData.GetIsFree()
        itemID = ipyData.GetItemID()
        itemCnt = ipyData.GetItemCnt()
        isBind = ipyData.GetIsBind()
        weight = ipyData.GetWeight()
        mark = ipyData.GetMark()
        rare = ipyData.GetRare()
        weightDict[isFree] = weightDict.get(isFree, 0) + weight
        if isFree not in g_randomWellDict:
            g_randomWellDict[isFree] = []
        g_randomWellDict[isFree].append([weightDict[isFree], [itemID, itemCnt, isBind, mark, rare]])
        
        
    GameWorld.DebugLog('    ³õʼÐíÔ¸³ØËæ»ú¿â g_randomWellDict=%s' % (g_randomWellDict))
    return
 
 
def __GetRandomRateList(isFree):
    ## »ñÈ¡Ôö³¤Áбí
    if not g_randomWellDict:
        __InitWishRateList()
    return g_randomWellDict.get(isFree, [])
 
 
#// AA 07 ÐíÔ¸³Ø»î¶¯Ë¢Ð½±³Ø #tagCMActWishingRefresh
#struct     tagCMActWishingRefresh
#{
#    tagHead        Head;
#    BYTE        IsFree;         // ÊÇ·ñÃâ·ÑË¢ÐÂ
#};
def OnActWishingRefresh(index, clientData, tick):
    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
    actBossRebornInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WishingWell, {})
    state = actBossRebornInfo.get(ShareDefine.ActKey_State, 0)
    cfgID = actBossRebornInfo.get(ShareDefine.ActKey_CfgID, 0)
    if not state or not cfgID:
        return
    
    isFree = clientData.IsFree
    __DoActWishingRefresh(curPlayer, isFree)
    #֪ͨ
    SyncWishingWellPlayerInfo(curPlayer)
    return
 
def __DoActWishingRefresh(curPlayer, isFree, isSystem=False):
    randomRateList = __GetRandomRateList(isFree)
    if not randomRateList:
        GameWorld.DebugLog('    ÐíÔ¸³Ø»î¶¯Ë¢Ð½±³Ø Ëæ»ú¿â»ñÈ¡´íÎ󠣡')
        return
    playerID = curPlayer.GetID()
    GameWorld.DebugLog(' isFree=%s, randomRateList=%s' % (isFree, randomRateList))
    
    if isFree:
        if not isSystem:
            freeStartTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WishingWellFreeTime)
            curTime = int(time.time())
            freeCountCD = IpyGameDataPY.GetFuncCfg('WishingWellCfg')
            if curTime - freeStartTime < freeCountCD:
                GameWorld.DebugLog('ÐíÔ¸³Ø»î¶¯Ãâ·Ñˢн±³Ø£¬ Ãâ·ÑCDδµ½£¡ freeCountCD=%s, passTime=%s' % (freeCountCD, curTime - freeStartTime), playerID)
                return
    else:
        refreshCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WishingWellRefreshCnt)
        infoDict = {'refreshCnt':refreshCnt}
        costMoney = eval(IpyGameDataPY.GetFuncCompileCfg('WishingWellCfg', 2))
        if not PlayerControl.HaveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, costMoney):
            return
        
    randomCnt = IpyGameDataPY.GetFuncCfg('WishingWellCfg', 3)
    randomResultList = GameWorld.GetResultByRandomListEx(randomRateList, randomCnt, [])
    if len(randomResultList) != randomCnt:
        GameWorld.DebugLog('    ÐíÔ¸³Ø»î¶¯Ë¢Ð½±³Ø Ëæ»ú¿â½á¹û »ñÈ¡´íÎ󠣡randomCnt=%s, randomResultList=%s' % (randomCnt, randomResultList))
        return
    
    if not isFree:
        PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, costMoney, ChConfig.Def_Cost_WishingWell, infoDict)
        #Ôö¼Ó´ÎÊý
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WishingWellRefreshCnt, refreshCnt+1)
    elif not isSystem:
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WishingWellFreeTime, int(time.time()))
        
    for i, info in enumerate(randomResultList):
        itemID, itemCnt, isBind, mark, rare = info
        isSpecial = rare
        __SetItemData(curPlayer, WellType_Select, i, itemID, itemCnt, isBind, isSpecial)
    GameWorld.DebugLog(' ÐíÔ¸³Ø»î¶¯Ë¢Ð isFree=%s, randomResultList=%s' % (isFree, randomResultList), playerID)
    return
 
#// AA 06 ÐíÔ¸³Ø»î¶¯ÐíÔ¸ #tagCMActWishing
#struct     tagCMActWishing
#{
#    tagHead        Head;
#    BYTE        SrcWellType;         // À´Ô´¿â 0-¿ÉÑ¡¿â 1-½á¹û¿â
#    BYTE        SrcIndex;         // À´Ô´Ë÷Òý
#    BYTE        DesWellType;         // Ä¿±ê¿â 0-¿ÉÑ¡¿â 1-½á¹û¿â
#    BYTE        DesIndex;         // Ä¿±êË÷Òý
#};
def OnActWishingDrag(index, clientData, tick):
    srcWellType = clientData.SrcWellType
    srcIndex = clientData.SrcIndex
    desWellType = clientData.DesWellType
    desIndex = clientData.DesIndex
    if srcWellType not in [WellType_Select, WellType_Result] or desWellType not in [WellType_Select, WellType_Result]:
        return
    if srcWellType == desWellType:
        return
    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
    playerID = curPlayer.GetID()
    srcitemID, srcitemCnt, srcisBind, srcisSpecial = __GetItemInfoByData(curPlayer, srcWellType, srcIndex)
    if not srcitemID:
        GameWorld.DebugLog('ÐíÔ¸³Ø»î¶¯ÍÏ×§ÎïÆ· À´Ô´Î»ÖÃûÓÐÎïÆ· srcWellType=%s, srcIndex=%s' % (srcWellType, srcIndex), playerID)
        return
    desitemID, desitemCnt, desisBind, desisSpecial = __GetItemInfoByData(curPlayer, desWellType, desIndex)
    __SetItemData(curPlayer, desWellType, desIndex, srcitemID, srcitemCnt, srcisBind, srcisSpecial)
    if desitemID:
        __SetItemData(curPlayer, srcWellType, srcIndex, desitemID, desitemCnt, desisBind, desisSpecial)
    else:
        __SetItemData(curPlayer, srcWellType, srcIndex, 0, 0, 0, 0)
    GameWorld.DebugLog('ÐíÔ¸³Ø»î¶¯ÍÏ×§ÎïÆ· desWellType=%s,desIndex=%s,srcitemID=%s'%(desWellType, desIndex,srcitemID))
    #֪ͨ
    SyncWellItemChange(curPlayer, [[srcWellType, srcIndex],[desWellType, desIndex]])
    return
 
def SyncWellItemChange(curPlayer, changeList):
    packData = ChPyNetSendPack.tagMCActWishingDragResult()
    packData.InfoList = []
    for wellType, index in changeList:
        itemID, itemCnt, isBind, isSpecial = __GetItemInfoByData(curPlayer, wellType, index)
        changeInfo = ChPyNetSendPack.tagMCPlayerWishingDragInfo()
        changeInfo.WellType = wellType
        changeInfo.Index = index
        changeInfo.ItemID = itemID
        changeInfo.ItemCnt = itemCnt
        changeInfo.IsBind = isBind
        changeInfo.IsSpecial = isSpecial
        packData.InfoList.append(changeInfo)
    packData.Cnt = len(packData.InfoList)
    NetPackCommon.SendFakePack(curPlayer, packData)
    return
 
def DoGetWishingAward(curPlayer):
    ## ÁìÈ¡ÐíÔ¸³Ø½±Àø
    count = IpyGameDataPY.GetFuncCfg('WishingWellCfg', 4)
    giveItemList = []
    for i in xrange(count):
        itemID, itemCnt, isBind, isSpecial = __GetItemInfoByData(curPlayer, WellType_Get, i)
        if itemID:
            giveItemList.append([itemID, itemCnt, isBind])
    if not giveItemList:
        GameWorld.Log('ÁìÈ¡ÐíÔ¸³Ø½±Àø Ã»Óн±Àø¿ÉÁìÈ¡£¡', curPlayer.GetID())
        return
    
    needSpace = len(giveItemList)
    packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, needSpace)
    if needSpace > packSpace:
        PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_998371")
        return
    for itemID, itemCnt, isBind in giveItemList:
        ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, 0, [IPY_GameWorld.rptItem])
    for i in xrange(count):
        __SetItemData(curPlayer, WellType_Get, i, 0, 0, 0, 0)
    SyncWishingWellPlayerInfo(curPlayer)
    return
 
 
def SyncWishingWellInfo(curPlayer):
    ##ͬ²½ÐíÔ¸³Ø»î¶¯ÐÅÏ¢
    actBossRebornInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WishingWell, {})
    state = actBossRebornInfo.get(ShareDefine.ActKey_State, 0)
    cfgID = actBossRebornInfo.get(ShareDefine.ActKey_CfgID, 0)
    if not state or not cfgID:
        return
    actIpyData = IpyGameDataPY.GetIpyGameData("ActWishingWell", cfgID)
    if not actIpyData:
        return
    openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
    actInfo = ChPyNetSendPack.tagMCActWishingWellInfo()
    actInfo.Clear()
    actInfo.StartDate = GameWorld.GetOperationActionDateStr(actIpyData.GetStartDate(), openServerDay)
    actInfo.EndtDate = GameWorld.GetOperationActionDateStr(actIpyData.GetEndDate(), openServerDay)
    actInfo.IsDayReset = actIpyData.GetIsDayReset()
    actInfo.ResetType = actIpyData.GetResetType()
    actInfo.LimitLV = actIpyData.GetLVLimit()
    actInfo.WellItemInfo = []
    randomItemList = __GetRandomRateList(0)
    for itemInfo in randomItemList:
        itemID, itemCnt, isBind, mark, rare = itemInfo[1]
        wellItemInfo = ChPyNetSendPack.tagMCWishingWellItem()
        wellItemInfo.ItemID = itemID
        wellItemInfo.ItemCnt = itemCnt
        wellItemInfo.IsBind = isBind
        wellItemInfo.Mark = mark
        wellItemInfo.Rare = rare
        actInfo.WellItemInfo.append(wellItemInfo)
    actInfo.Count = len(actInfo.WellItemInfo)
    NetPackCommon.SendFakePack(curPlayer, actInfo)
    return
 
 
def SyncWishingWellPlayerInfo(curPlayer):
    ##ͬ²½ÐíÔ¸³ØÍæ¼ÒÐÅÏ¢
    packData = ChPyNetSendPack.tagMCActWishingWellPlayerInfo()
    freeStartTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WishingWellFreeTime)
    if not freeStartTime:#ûÓÐÔòĬÈϻ¿ªÊ¼Ê±¼ä
        actBossRebornInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WishingWell, {})
        cfgID = actBossRebornInfo.get(ShareDefine.ActKey_CfgID, 0)
        actIpyData = IpyGameDataPY.GetIpyGameData("ActWishingWell", cfgID)
        if actIpyData:
            openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
            startDate = GameWorld.GetOperationActionDateStr(actIpyData.GetStartDate(), openServerDay)
            
            resetType = actIpyData.GetResetType() # ÖØÖÃÀàÐÍ£¬0-0µãÖØÖã»1-5µãÖØÖÃ
            if resetType == 1:
                startDayDate = "%s 05:00:00" % (startDate)
            else:
                startDayDate = "%s 00:00:00" % (startDate)
            freeStartTime = GameWorld.ChangeTimeStrToNum(startDayDate, timeFormat=ChConfig.TYPE_Time_Format)
            GameWorld.DebugLog('ÐíÔ¸³Ø»î¶¯¿ªÊ¼Ê±¼ä startDayDate=%s'%startDayDate)
                
        
    packData.FreeStartTime = freeStartTime
    packData.WishCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WishingWellRefreshCnt)
    packData.WellItemInfo = []
    __AddWishingWellItemPackInfo(curPlayer, packData.WellItemInfo, WellType_Select)
    packData.WellItemCnt = len(packData.WellItemInfo)
    packData.CurAwardItemInfo = []
    __AddWishingWellItemPackInfo(curPlayer, packData.CurAwardItemInfo, WellType_Result)
    packData.CurAwardCnt = len(packData.CurAwardItemInfo)
    packData.LastAwardItemInfo = []
    __AddWishingWellItemPackInfo(curPlayer, packData.LastAwardItemInfo, WellType_Get)
    packData.LastAwardCnt = len(packData.LastAwardItemInfo)
    NetPackCommon.SendFakePack(curPlayer, packData)
    return
 
 
def __AddWishingWellItemPackInfo(curPlayer, itemList, wellType):
    if wellType == WellType_Select:
        count = IpyGameDataPY.GetFuncCfg('WishingWellCfg', 3)
    else:
        count = IpyGameDataPY.GetFuncCfg('WishingWellCfg', 4)
    for i in xrange(count):
        itemID, itemCnt, isBind, isSpecial = __GetItemInfoByData(curPlayer, wellType, i)
        packData = ChPyNetSendPack.tagMCPlayerWishingWellItem()
        packData.ItemID = itemID
        packData.ItemCnt = itemCnt
        packData.IsBind = isBind
        packData.IsSpecial = isSpecial
        itemList.append(packData)
    return