| | |
| | | GameWorld.DebugLog(" 生成新仙盟红包 红包额度不能低于红包个数!outputNum=%s,redCnt=%s" % (outputNum, packetCnt))
|
| | | return
|
| | | job = curPlayer.GetJob()
|
| | | jobRank = PlayerControl.GetJobRank(curPlayer)
|
| | | jobRank = 0
|
| | | playerName = curPlayer.GetName()
|
| | | __SaveNewRedRecord(family, playerID, playerName, job, jobRank, getType, moneyType, outputNum, packetCnt, state, wishStr, data=data)
|
| | | return
|
| | |
| | | def __SaveNewRedRecord(family, ownerid, playerName, job, jobRank, getType, moneyType, outputNum, packetCnt,state=State_NoSend, wishStr='', sysCreateTime=None, data=0):
|
| | | global g_allRecordDict
|
| | | global g_redPackCountDict
|
| | | job = job + jobRank * 10 #个位是job 十位百位是jobrank
|
| | | recordType = ShareDefine.Def_UniversalGameRecType_FamilyRedPacketAllRecord
|
| | | universalRecMgr = GameWorld.GetUniversalRecMgr()
|
| | | recordList = universalRecMgr.GetTypeList(recordType)
|
| | |
| | |
|
| | | playerID= curPlayer.GetPlayerID()
|
| | | job = curPlayer.GetJob()
|
| | | jobRank = PlayerControl.GetJobRank(curPlayer)
|
| | | job = jobRank * 10 + job
|
| | | playerName = curPlayer.GetName()
|
| | |
|
| | |
|
| | |
| | |
|
| | | #找该红包的抢信息
|
| | | grabRecordDict = __GetGrabRecord(redPacketID)
|
| | | if playerID in grabRecordDict or len(grabRecordDict) >= packetCnt:
|
| | | GameWorld.DebugLog(" 该玩家已抢过此红包!",playerID)
|
| | | if playerID in grabRecordDict:
|
| | | GameWorld.DebugLog(" 该玩家已抢过此红包!", playerID)
|
| | | __NotifyGrabRedPacketInfo(curPlayer, redPacketID, grabRecordDict)
|
| | | return
|
| | | |
| | | if len(grabRecordDict) >= packetCnt:
|
| | | GameWorld.DebugLog(" 红包已被抢完!", playerID)
|
| | | if state != State_HasAllGot:
|
| | | redPacketRecData.SetValue4(State_HasAllGot)
|
| | | #GameWorld.DebugLog(" 纠正红包已抢完状态! state=%s,updState=%s" % (state, State_HasAllGot))
|
| | | __NotifyFamilyRedPacketInfo(curFamily, redPacketRecData, grabRecordDict.keys())
|
| | | __NotifyGrabRedPacketInfo(curPlayer, redPacketID, grabRecordDict)
|
| | | return
|
| | |
|
| | |
| | | #{playerid:[抢到的钱,名字,job]}
|
| | | g_grabDataDict[redPacketID] = grabRecordDict
|
| | |
|
| | | if len(grabRecordDict) == packetCnt:
|
| | | if len(grabRecordDict) >= packetCnt:
|
| | | redPacketRecData.SetValue4(State_HasAllGot)
|
| | |
|
| | | #通知该玩家红包抢结果
|
| | |
| | | strValue1 = universalRecData.GetStrValue1()
|
| | | strValue1List = strValue1.split('|')
|
| | | playerID = strValue1List[0]
|
| | | if playerID:
|
| | | getWay = int(strValue1List[3])
|
| | | if playerID and getWay is ShareDefine.RedPackType_GoldPacket:
|
| | | playerID = int(playerID)
|
| | | grabRecordDict = __GetGrabRecord(redPacketID)
|
| | | outNum = sum([a[0] for a in grabRecordDict.values()]) #已被抢的钱
|
| | |
| | |
|
| | | if curPlayer.GetPlayerID() in grabHeroIDList:
|
| | | state = State_HasGot
|
| | | if sendPack.IsAll and state in [State_HasGot, State_HasAllGot]:
|
| | | #GameWorld.DebugLog("已抢或抢完的不发: RedPacketID=%s,state=%s" % (packetInfo.RedPacketID, state))
|
| | | continue
|
| | | packetInfo.State = state
|
| | | packetInfo.PacketCnt = int(packetData.GetStrValue2())
|
| | |
|
| | | packetInfo.Wish = packetData.GetStrValue3()
|
| | | sendPack.RedPacketInfo.append(packetInfo)
|
| | | if len(sendPack.RedPacketInfo) > 250:
|
| | | #GameWorld.DebugLog("红包太多了!")
|
| | | break
|
| | |
|
| | | sendPack.Count = len(sendPack.RedPacketInfo)
|
| | | NetPackCommon.SendFakePack(curPlayer, sendPack)
|