| | |
| | | cnt += 1
|
| | | savaData += mailObj.getBuffer()
|
| | |
|
| | | GameWorld.Log("Save DBCrossPersonalCompensation cnt :%s" % cnt)
|
| | | GameWorld.Log("Save DBCrossPersonalCompensation count :%s, len=%s" % (cnt, len(savaData)))
|
| | | return CommFunc.WriteDWORD(cntData, cnt) + savaData
|
| | |
|
| | | # 从数据库载入数据
|
| | | def LoadPyGameData(self, datas, pos, dataslen):
|
| | | cnt, pos = CommFunc.ReadDWORD(datas, pos)
|
| | | GameWorld.Log("Load DBCrossPersonalCompensation cnt :%s" % cnt)
|
| | | GameWorld.Log("Load DBCrossPersonalCompensation count :%s" % cnt)
|
| | |
|
| | | for _ in xrange(cnt):
|
| | | mailObj = PyGameDataStruct.tagDBCrossPersonalCompensation()
|
| | |
| | | perMailItemCnt = IpyGameDataPY.GetFuncCfg("MailMaxItemCnt")
|
| | | mailCnt = max(1, int(math.ceil(len(addItemDictList)/float(perMailItemCnt)))) # 一封邮件最多5个物品
|
| | | for i in xrange(mailCnt):
|
| | | if i != 0:
|
| | | gold, goldPaper, silver = 0, 0, 0 # 拆分后非第一封的邮件货币归零,防止重复给货币奖励
|
| | | startIndex = i*perMailItemCnt
|
| | | GUID = str(uuid.uuid1())
|
| | | AddPersonalItem(GUID, addItemDictList[startIndex:startIndex + perMailItemCnt], playerIDList,
|