| | |
| | | __NotifyGoldLimt(curPlayer)
|
| | | return
|
| | |
|
| | | def CreatCacheRedPacktet(curPlayer):
|
| | | #加入仙盟后,发放待发的红包
|
| | | ipyMgr = IpyGameDataPY.IPY_Data()
|
| | | for i in xrange(ipyMgr.GetFamilyRedPackCount()):
|
| | | ipyData = ipyMgr.GetFamilyRedPackByIndex(i)
|
| | | redPacketID = ipyData.GetID()
|
| | | if GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_FamilyRedPacketCache, redPacketID):
|
| | | CreatRedPacketByID(curPlayer, redPacketID)
|
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_FamilyRedPacketCache, redPacketID, 0)
|
| | | return
|
| | |
|
| | |
|
| | | def CreatRedPacketByID(curPlayer, redPacketID, state=State_NoSend, data=0):
|
| | | #根据红包ID生成红包
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('FamilyRedPack', redPacketID)
|
| | | if not ipyData:
|
| | | return
|
| | | DoCreatFamilyRedPacket(curPlayer, ipyData.GetGetType(), ipyData.GetMoneyType(), ipyData.GetMoneyNum(), ipyData.GetPacketCnt(), state, '', data)
|
| | | return
|
| | |
|
| | | ## 生成红包
|
| | | def DoCreatFamilyRedPacket(curPlayer, getType, moneyType=2, awardNum=100, packetCnt=10, state=State_NoSend, wishInfo='', data=0):
|
| | | # if not curPlayer.GetFamilyID():
|
| | | # #没家族
|
| | | # return
|
| | | |
| | | getType = ipyData.GetGetType()
|
| | | if getType == IpyGameDataPY.GetFuncCfg('OpenServerRedPacketType'):
|
| | | oscDay = IpyGameDataPY.GetFuncCfg('OpenServerRedPacketCfg')
|
| | | openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay)
|
| | | if openServerDay >= oscDay:
|
| | | GameWorld.DebugLog(' 发开服红包,活动已过,不可发送!')
|
| | | return
|
| | | else:
|
| | | if not curPlayer.GetFamilyID():
|
| | | #没家族 先存起来,等进仙盟时再补发
|
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_FamilyRedPacketCache, redPacketID, 1)
|
| | | return
|
| | | |
| | | DoCreatFamilyRedPacket(curPlayer, getType, ipyData.GetMoneyType(), ipyData.GetMoneyNum(), ipyData.GetPacketCnt(), state, '', data)
|
| | | return
|
| | |
|
| | | ## 生成红包
|
| | | def DoCreatFamilyRedPacket(curPlayer, getType, moneyType=2, awardNum=100, packetCnt=10, state=State_NoSend, wishInfo='', data=0):
|
| | |
|
| | | |
| | | |
| | | playerID = curPlayer.GetPlayerID()
|
| | | packetCnt = min(packetCnt, awardNum)
|
| | |
|