| | |
| | | import PlayerFamilyRedPacket
|
| | | import ChPyNetSendPack
|
| | | import NetPackCommon
|
| | | import ShareDefine
|
| | |
|
| | |
|
| | | ## GM命令执行入口
|
| | |
| | | def OnExec(curPlayer, paramList):
|
| | | GameWorld.DebugLog("执行GameServer->SetRedPacket: %s" % paramList)
|
| | | if not paramList:
|
| | | # GameWorld.DebugAnswer(curPlayer, "清除所有类型红包:SetRedPacket 0")
|
| | | # GameWorld.DebugAnswer(curPlayer, "清除指定类型红包:SetRedPacket 0 类型A 类型B ...")
|
| | | # GameWorld.DebugAnswer(curPlayer, "发送全服系统红包:SetRedPacket 36 红包编号 个数")
|
| | | # GameWorld.DebugAnswer(curPlayer, "全服系统红包编号:126~130")
|
| | | # GameWorld.DebugAnswer(curPlayer, "红包类型:36-全服红包;33-节日成就")
|
| | | # GameWorld.DebugAnswer(curPlayer, "---------------------------")
|
| | | # GameWorld.DebugAnswer(curPlayer, "清所有红包:SetRedPacket 0")
|
| | | # GameWorld.DebugAnswer(curPlayer, "清指定红包:SetRedPacket 0 类型A 类型B ...")
|
| | | # GameWorld.DebugAnswer(curPlayer, "发指定红包:SetRedPacket 1 红包编号 个数")
|
| | | # GameWorld.DebugAnswer(curPlayer, "设置抢红包:SetRedPacket 2 红包功能 可抢数 已抢额度")
|
| | | # GameWorld.DebugAnswer(curPlayer, "红包功能:1-开服红包;2-节日红包")
|
| | | return
|
| | |
|
| | | paramA = paramList[0]
|
| | |
| | | continue
|
| | | NetPackCommon.SendFakePack(curPlayer, sendPack)
|
| | |
|
| | | elif paramA == 36:
|
| | | elif paramA == 1:
|
| | | redPackID = paramList[1] if len(paramList) > 1 else 0
|
| | | sendCount = paramList[2] if len(paramList) > 2 else 0
|
| | | sendCount = min(100, sendCount)
|
| | | canSendRedPacketIDList = range(126, 130 + 1) + []
|
| | | if redPackID not in canSendRedPacketIDList or not sendCount:
|
| | | GameWorld.DebugAnswer(curPlayer, "发送全服系统红包参数错误!")
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('FamilyRedPack', redPackID)
|
| | | if not ipyData:
|
| | | return
|
| | | getType = ipyData.GetGetType()
|
| | | wayType = PlayerFamilyRedPacket.GetRedPackGetWayType(getType)
|
| | | if wayType == ShareDefine.RedPackWayType_Family:
|
| | | return
|
| | | openTime = ipyData.GetPacketOpenTime() # 如果有指定发放时间的
|
| | | if openTime:
|
| | | sendCount = 1
|
| | | for _ in xrange(sendCount):
|
| | | PlayerFamilyRedPacket.CreateSystemRedPacket(redPackID)
|
| | | GameWorld.DebugAnswer(curPlayer, "成功发送红包编号:%s 共:%s个" % (redPackID, sendCount))
|
| | |
|
| | | else:
|
| | | GameWorld.DebugAnswer(curPlayer, "红包命令参数错误!")
|
| | | |
| | | return
|
| | |
|
| | | def __ResetSendState(delTypeList):
|