Merge branch 'master' of http://192.168.0.87:10010/r/SnxxServerCode
| | |
| | | # AA 16 通知超值礼包信息 #tagMCSuperGiftInfo
|
| | |
|
| | | class tagMCSuperGiftInfo(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("GiftID", c_int), #商品ID
|
| | | ("RemainDay", c_ubyte), #剩余天数
|
| | | ]
|
| | | Head = tagHead()
|
| | | GiftID = 0 #(DWORD GiftID)//商品ID
|
| | | EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xAA
|
| | | self.SubCmd = 0x16
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x16
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.GiftID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.EndtDate,_pos = CommFunc.ReadString(_lpData, _pos,10)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xAA
|
| | | self.SubCmd = 0x16
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x16
|
| | | self.GiftID = 0
|
| | | self.RemainDay = 0
|
| | | self.EndtDate = ""
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCSuperGiftInfo)
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 4
|
| | | length += 10
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteDWORD(data, self.GiftID)
|
| | | data = CommFunc.WriteString(data, 10, self.EndtDate)
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 16 通知超值礼包信息 //tagMCSuperGiftInfo:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | GiftID:%d,
|
| | | RemainDay:%d
|
| | | EndtDate:%s
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.Head.OutputString(),
|
| | | self.GiftID,
|
| | | self.RemainDay
|
| | | self.EndtDate
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCSuperGiftInfo=tagMCSuperGiftInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCSuperGiftInfo.Cmd,m_NAtagMCSuperGiftInfo.SubCmd))] = m_NAtagMCSuperGiftInfo
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCSuperGiftInfo.Head.Cmd,m_NAtagMCSuperGiftInfo.Head.SubCmd))] = m_NAtagMCSuperGiftInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | |
| | | continue
|
| | | if family.GetLV() < joinFamilyLVLimit:
|
| | | GameWorld.Log("仙盟等级不足,无法参与联赛!familyID=%s,LV=%s,joinFamilyLVLimit=%s" % (familyID, family.GetLV(), joinFamilyLVLimit))
|
| | | continue
|
| | | groupFamilyList.append(family)
|
| | | |
| | | # 添加参赛仙盟及成员名单
|
| | | PyGameData.g_familyWarFamilyIDList.append(familyID)
|
| | | for index in xrange(family.GetCount()):
|
| | | curMember = family.GetAt(index)
|
| | | memPlayerID = curMember.GetPlayerID()
|
| | | memPlayer = curMember.GetPlayer()
|
| | | isAddOK = AddFamilyWarMem(memPlayerID, familyID, warMemRecList)
|
| | | lastJoinFamilyID = lastFamilyWarMemDict.get(memPlayerID, 0)
|
| | | # 重新通知玩家参与的仙盟
|
| | | if lastJoinFamilyID and isAddOK and lastJoinFamilyID != familyID and memPlayer:
|
| | | __NotifyPlayerJoinFamilyInfo(memPlayer, familyID)
|
| | | else:
|
| | | groupFamilyList.append(family)
|
| | | |
| | | # 添加参赛仙盟及成员名单
|
| | | PyGameData.g_familyWarFamilyIDList.append(familyID)
|
| | | for index in xrange(family.GetCount()):
|
| | | curMember = family.GetAt(index)
|
| | | memPlayerID = curMember.GetPlayerID()
|
| | | memPlayer = curMember.GetPlayer()
|
| | | isAddOK = AddFamilyWarMem(memPlayerID, familyID, warMemRecList)
|
| | | lastJoinFamilyID = lastFamilyWarMemDict.get(memPlayerID, 0)
|
| | | # 重新通知玩家参与的仙盟
|
| | | if lastJoinFamilyID and isAddOK and lastJoinFamilyID != familyID and memPlayer:
|
| | | __NotifyPlayerJoinFamilyInfo(memPlayer, familyID)
|
| | |
|
| | | # 满一组仙盟数 or 没有仙盟了
|
| | | if len(groupFamilyList) == FamilyWar_GroupFamilyCount or i == familyCount - 1:
|
| | |
| | |
|
| | | GameWorld.Log(" PyGameData.g_familyWarFamilyIDList: %s" % PyGameData.g_familyWarFamilyIDList)
|
| | | GameWorld.Log(" PyGameData.g_familyWarMemDict: %s" % PyGameData.g_familyWarMemDict)
|
| | | GameWorld.Log(" 通用记录对战家族数: %s" % warBatRecList.Count())
|
| | | GameWorld.Log(" 通用记录参与玩家数: %s" % warMemRecList.Count())
|
| | | GameWorld.Log(" 仙盟联赛首轮比赛分组确认完毕!")
|
| | | PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_FamilyWar_Round, FamilyWarRound_First) # 设置已处理过的轮次
|
| | | return
|
| | |
| | | GameWorld.Log("玩家 : %s,%s,FBID=%s 切换地图" % (curPlayer.GetName(), curPlayer.GetRealMapID(), curPlayer.GetFBID()) , curPlayer.GetPlayerID())
|
| | | PlayerTeam.OnPlayerChangeMap(curPlayer, tick)
|
| | | GameWorldBoss.OnPlayerChangeMap(curPlayer)
|
| | | PlayerFamily.OnPlayerChangeMap(curPlayer, tick)
|
| | | PlayerFamilyParty.OnPlayerChangeMap(curPlayer, tick)
|
| | | return
|
| | |
|
| | | ## 玩家切换真实地图
|
| | |
| | | NotifyFamilyPartyQuestion(curPlayer)
|
| | | return
|
| | |
|
| | | def OnPlayerChangeMap(curPlayer, tick):
|
| | | if curPlayer.GetMapID() != ChConfig.Def_FBMapID_FamilyParty:
|
| | | return
|
| | | playerID = curPlayer.GetID()
|
| | | if playerID not in PyGameData.g_partyheroAnswerDict:
|
| | | PyGameData.g_partyheroAnswerDict[playerID] = 0
|
| | | return
|
| | |
|
| | |
|
| | | def NotifyFamilyPartyQuestion(curPlayer):
|
| | | #刚登录的或刚进仙盟的补发最近的题目
|
| | | gameWorld = GameWorld.GetGameWorld()
|
| | |
| | | PlayerCompensation.SendPersonalItemMailEx('', content, day, [topHeroID], itemList)
|
| | |
|
| | | PlayerControl.WorldNotify(0, 'Party_TopPlayer', [topHeroName])
|
| | | |
| | | #给参与奖励
|
| | | joinPlayerIDList = PyGameData.g_partyheroAnswerDict.keys()
|
| | | if joinPlayerIDList:
|
| | | joinReward = IpyGameDataPY.GetFuncEvalCfg('PartyReward')
|
| | | if joinReward:
|
| | | PlayerCompensation.SendMailByKey('FamilyParty', joinPlayerIDList, joinReward)
|
| | | |
| | | return
|
| | |
|
| | | def __GetFamilyAnswerRankList():
|
| | |
| | | #2011-05-12 chenxuewei 有没主人都只要通知一次即可,避免重复通知
|
| | | if curPlayer != None:
|
| | | FBLogic.DoFB_Player_KillNPC(curPlayer, curTagNPC, tick)
|
| | | NPCCommon.OnPlayerAttackNPCDie(curTagNPC, curPlayer, skill)
|
| | | else:
|
| | | #副本
|
| | | FBLogic.DoFB_Npc_KillNPC(curSummonNPC, curTagNPC, tick)
|
| | |
| | |
|
| | | #仙盟红包
|
| | | Def_PDict_FamilyRedPacketGoldLimit = "FmlRedPacketGoldLimit" # 仙盟钻石红包已发额度
|
| | | Def_PDict_FamilyRedPacketCache = "FamilyRedPacketCache%s" # 仙盟红包待发放记录参数索引
|
| | | Def_PDict_OSRedPacketGrabMoney = "OSRedPacketGrabMoney" # 开服红包已抢数量
|
| | | Def_PDict_OSRedPacketCanGrabCnt = "OSRedPacketCanGrabCnt" # 开服红包可抢次数
|
| | | Def_PDict_OSRedPacketStartTime = "OSRedPacketStartTime" #开服红包开始倒计时时间
|
| | |
| | | # AA 16 通知超值礼包信息 #tagMCSuperGiftInfo
|
| | |
|
| | | class tagMCSuperGiftInfo(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("GiftID", c_int), #商品ID
|
| | | ("RemainDay", c_ubyte), #剩余天数
|
| | | ]
|
| | | Head = tagHead()
|
| | | GiftID = 0 #(DWORD GiftID)//商品ID
|
| | | EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xAA
|
| | | self.SubCmd = 0x16
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x16
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.GiftID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.EndtDate,_pos = CommFunc.ReadString(_lpData, _pos,10)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xAA
|
| | | self.SubCmd = 0x16
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x16
|
| | | self.GiftID = 0
|
| | | self.RemainDay = 0
|
| | | self.EndtDate = ""
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCSuperGiftInfo)
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 4
|
| | | length += 10
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteDWORD(data, self.GiftID)
|
| | | data = CommFunc.WriteString(data, 10, self.EndtDate)
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 16 通知超值礼包信息 //tagMCSuperGiftInfo:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | GiftID:%d,
|
| | | RemainDay:%d
|
| | | EndtDate:%s
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.Head.OutputString(),
|
| | | self.GiftID,
|
| | | self.RemainDay
|
| | | self.EndtDate
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCSuperGiftInfo=tagMCSuperGiftInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCSuperGiftInfo.Cmd,m_NAtagMCSuperGiftInfo.SubCmd))] = m_NAtagMCSuperGiftInfo
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCSuperGiftInfo.Head.Cmd,m_NAtagMCSuperGiftInfo.Head.SubCmd))] = m_NAtagMCSuperGiftInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | |
| | | return
|
| | | giftID, day = superGiftTimeList[giftIndex-1]
|
| | | openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay)+1
|
| | | remainDay = max(0, day - openServerDay+startDay)-1
|
| | |
|
| | | packData = ChPyNetSendPack.tagMCSuperGiftInfo()
|
| | | packData.GiftID = giftID
|
| | | packData.RemainDay = max(0, day - openServerDay+startDay)
|
| | | packData.EndtDate = str(GameWorld.GetDatetimeByDiffDays(remainDay))[:10]
|
| | | NetPackCommon.SendFakePack(curPlayer, packData)
|
| | | return
|
| | | def CheckSuperGiftBuy(curPlayer, giftID):
|
| | |
| | | groupCnt +=1
|
| | | return groupCnt >= needCnt
|
| | |
|
| | | ##法宝激活个数
|
| | | # @param None
|
| | | # @return None <Mwcnt value="cnt"/>
|
| | | def ConditionType_Mwcnt(curPlayer, curMission, curActionNode):
|
| | | totalcnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | return PlayerMagicWeapon.GetMWActiveCntTotal(curPlayer) >= totalcnt
|
| | |
|
| | | ##激活法宝,确认与成就逻辑后使用
|
| | | # @param None
|
| | |
| | | return
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_BuyFbCntDay % mapID, hasBuyCnt + 1)
|
| | | Sync_FBPlayerFBBuyCount(curPlayer, [mapID])
|
| | | |
| | | PlayerControl.NotifyCode(curPlayer, 'FBEnterTimeBuy', [mapID])
|
| | | lastRegainTime= curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FbCntRegainStartTime % mapID)
|
| | | if lastRegainTime:
|
| | | maxDayTimes = ipyData.GetDayTimes()
|
| | |
| | | FBCommon.SetFBStep(FB_Step_Fighting, tick)
|
| | | elif fbStep == FB_Step_Fighting:
|
| | | if not FBCommon.GetFBFuncOpenState(ChConfig.Def_FBMapID_FamilyParty):
|
| | | GiveJoinPrize()
|
| | | FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0)
|
| | | PyGameData.g_familyPartyInfo = []
|
| | | FBCommon.SetFBStep(FB_Step_Over, tick)
|
| | |
| | |
|
| | | def OnFamilyPartyStateChange(state, tick):
|
| | | #活动状态变更
|
| | | GameWorld.DebugLog(' 仙盟宴会活动状态变更 state=%s'%state)
|
| | | # if state == 0:
|
| | | # playerManager = GameWorld.GetPlayerManager()
|
| | | # for i in xrange(playerManager.GetPlayerCount()):
|
| | | # curPlayer = playerManager.GetPlayerByIndex(i)
|
| | | # if not curPlayer or curPlayer.IsEmpty():
|
| | | # continue
|
| | | # #答对题或者进过图的给参与奖励
|
| | | # curAnswerCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyPartyAnswerCnt)
|
| | | # if FBCommon.GetEnterFBCount(curPlayer, ChConfig.Def_FBMapID_FamilyParty) or curAnswerCnt:
|
| | | # GiveJoinPrize(curPlayer)
|
| | | |
| | | |
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | if mapID != ChConfig.Def_FBMapID_FamilyParty:
|
| | | return
|
| | | GameWorld.DebugLog(' 仙盟宴会活动状态变更 state=%s'%state)
|
| | |
|
| | | if state == 1:
|
| | | GameWorld.GetGameWorld().SetGameWorldDict(Map_FamilyPartyFB_StartTick, tick)
|
| | |
| | |
|
| | | return
|
| | |
|
| | |
|
| | | def GiveJoinPrize():
|
| | | #参与奖
|
| | | joinAward = IpyGameDataPY.GetFuncCfg('PartyReward')
|
| | | if not joinAward:
|
| | | return
|
| | | copyMapPlayerManager = GameWorld.GetMapCopyPlayerManager()
|
| | | for i in xrange(copyMapPlayerManager.GetPlayerCount()):
|
| | | |
| | | curPlayer = copyMapPlayerManager.GetPlayerByIndex(i)
|
| | | |
| | | if curPlayer == None or curPlayer.IsEmpty():
|
| | | continue
|
| | | PlayerFamily.AddPlayerFamilyActiveValue(curPlayer, joinAward, True, ShareDefine.Def_AddFAVReason_FamilyParty)
|
| | | return
|
| | | #
|
| | | #def GiveJoinPrize(curPlayer):
|
| | | # #参与奖
|
| | | # joinAward = IpyGameDataPY.GetFuncCfg('PartyReward')
|
| | | # if not joinAward:
|
| | | # return
|
| | | # |
| | | # PlayerFamily.AddPlayerFamilyActiveValue(curPlayer, joinAward, True, ShareDefine.Def_AddFAVReason_FamilyParty)
|
| | | # return
|
| | |
|
| | |
|
| | |
|
| | |
| | | expPoint = totalExp / ChConfig.Def_PerPointValue
|
| | |
|
| | | totalPoint = gameWorld.GetGameWorldDictByKey(FBPlayerDict_TotalPoint%playerID)
|
| | | totalPoint += IpyGameDataPY.GetFuncCfg('PartyReward') #加参与奖
|
| | | #totalPoint += IpyGameDataPY.GetFuncCfg('PartyReward') #加参与奖
|
| | | totalPoint += addPoint * curAnswerCnt
|
| | | hasCollect = gameWorld.GetGameWorldDictByKey(FBPlayerDict_HasCollect%playerID)
|
| | | getCnt = gameWorld.GetGameWorldDictByKey(ChConfig.Map_Player_AreaReward_GetCnt%playerID)
|
| | |
| | | SuperHitReduce = attrDict.get(ShareDefine.Def_Effect_SuperHitReduce, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSuperHitReduceC())
|
| | | SkillAtkRate = attrDict.get(ShareDefine.Def_Effect_SkillAtkRate, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillAtkRateC())
|
| | | SpeedPer = attrDict.get(ShareDefine.Def_Effect_SpeedPer, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSpeedPerC())
|
| | | SkillAtkRateReduceC = attrDict.get(ShareDefine.Def_Effect_SkillAtkRate, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillAtkRateReduceC())
|
| | | SkillAtkRateReduce = attrDict.get(ShareDefine.Def_Effect_SkillAtkRate, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillAtkRateReduceC())
|
| | |
|
| | | # 攻速不默认乘,仅作为参数提供策划使用
|
| | | AtkSpeed = attrDict.get(ShareDefine.Def_Effect_AtkSpeed, 0)
|
| | |
| | | return
|
| | |
|
| | | mapID = curPlayer.GetMapID()
|
| | | |
| | | activityLineID = 0 # 活动线, 默认1线
|
| | | activityMapLineDict = IpyGameDataPY.GetFuncEvalCfg("MapLine", 2, {})
|
| | | if mapID in activityMapLineDict:
|
| | | activityLineID = max(0, activityMapLineDict[mapID] - 1)
|
| | | |
| | | mapLineDict = IpyGameDataPY.GetFuncEvalCfg("MapLine", 1)
|
| | | if mapID in mapLineDict and changLineID >= mapLineDict[mapID]:
|
| | | if changLineID != activityLineID and mapID in mapLineDict and changLineID >= mapLineDict[mapID]:
|
| | | GameWorld.ErrLog("该地图没有开放此线路,无法手动切换!mapID=%s,changLineID=%s,maxLine=%s"
|
| | | % (mapID, changLineID, mapLineDict[mapID]), curPlayer.GetID())
|
| | | return
|
| | |
| | | import GameLogic_FamilyWar
|
| | | import ChMapToGamePyPack
|
| | | import PlayerFamilyTech
|
| | | import PlayerFamilyRedPacket
|
| | | import SkillCommon
|
| | | import BuffSkill
|
| | | import ItemCommon
|
| | |
| | | PlayerFamilyTech.Sync_PlayerFamilyTechLV(curPlayer)
|
| | | DelAddFamilyRecord(curPlayer)
|
| | | GameLogic_FamilyWar.DoCheckChampionFamilyTitle(curPlayer)
|
| | | PlayerFamilyRedPacket.CreatCacheRedPacktet(curPlayer)
|
| | | return
|
| | |
|
| | | ## 退出家族触发事件
|
| | |
| | | __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)
|
| | |
|