| | |
| | | import GMCommon
|
| | | import uuid
|
| | | import ChConfig
|
| | | import ShareDefine
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | |
|
| | |
| | | # @return None
|
| | | # @remarks 函数详细说明.
|
| | | def OnExec(orderId, gmCmdDict):
|
| | | strMsg = ""
|
| | | gmCmdDict = ClearEmptyFromDict(gmCmdDict)
|
| | | PlayerIDList = eval(gmCmdDict.get('PlayerIDList', '[]'))
|
| | | GameWorld.DebugLog("GMT_AddPersonalCompensation gmCmdDict:%s" % gmCmdDict)
|
| | | queryType = gmCmdDict.get(GMCommon.Def_GMKey_QueryType, '')
|
| | | if queryType == GMCommon.Def_GMKey_FamilyID:
|
| | | sendFamilyIDList = []
|
| | | PlayerIDList = []
|
| | | familyIDList = gmCmdDict.get("playerList", "").split(",")
|
| | | GameWorld.Log("发送仙盟邮件: familyIDList=%s" % familyIDList)
|
| | | for familyID in familyIDList:
|
| | | familyID = GameWorld.ToIntDef(familyID)
|
| | | familyInfo = {"familyID":familyID}
|
| | | memberIDList = []
|
| | | family = GameWorld.GetFamilyManager().FindFamily(familyID)
|
| | | if not family:
|
| | | GameWorld.DebugLog(" not family %s" % familyID)
|
| | | continue
|
| | | for index in range(family.GetCount()):
|
| | | curMember = family.GetAt(index)
|
| | | curMemberID = curMember.GetPlayerID()
|
| | | if curMemberID:
|
| | | memberIDList.append(curMemberID)
|
| | | PlayerIDList += memberIDList
|
| | | familyInfo["PlayerIDList"] = memberIDList
|
| | | sendFamilyIDList.append(familyInfo)
|
| | | GameWorld.Log(" send FamilyIDList=%s" % sendFamilyIDList)
|
| | | GameWorld.Log(" send PlayerIDList=%s" % PlayerIDList)
|
| | | strMsg = str(sendFamilyIDList)
|
| | | else:
|
| | | PlayerIDList = eval(gmCmdDict.get('PlayerIDList', '[]'))
|
| | | if PlayerIDList == []:
|
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_ParamErr) |
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_ParamErr)
|
| | | return
|
| | |
|
| | | |
| | | LimitTime = gmCmdDict.get('EndTime', '2050-12-13 00:00:00')
|
| | |
|
| | | curServerTime = GameWorld.GetCurrentDataTimeStr()
|
| | |
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_InvalidTime)
|
| | | return
|
| | |
|
| | | MailType = int(gmCmdDict.get('MailType', '0'))
|
| | | Title = gmCmdDict.get('Title', '')
|
| | | Text = gmCmdDict.get('Text', '')
|
| | | GUID = str(uuid.uuid1())
|
| | |
| | | goldPaper = int(gmCmdDict.get('GoldPaper', '0'))
|
| | | silver = int(gmCmdDict.get('Silver', '0'))
|
| | | sender = gmCmdDict.get('Sender', ChConfig.Def_Mail_SenderSys)
|
| | | detail = gmCmdDict.get('Detail', "")
|
| | |
|
| | | #工具发过来的物品下标依据 'index,index,...' 不一定是从0开始并按顺序连续 =_=#
|
| | | intemIndexStrList = []
|
| | |
| | | # GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_ParamErr)
|
| | | # return
|
| | | PlayerCompensation.AddPersonalItem(GUID, addItemDictList, PlayerIDList,
|
| | | LimitTime, "%s<$_$>%s<$_$>%s"%(sender, Title, Text),
|
| | | gold, goldPaper, silver)
|
| | | LimitTime, PlayerCompensation.GetMailText(Title, Text, MailType, sender),
|
| | | gold, goldPaper, silver, detail=detail)
|
| | |
|
| | | #执行成功
|
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_Success) |
| | | GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_Success, strMsg)
|
| | | # 流向
|
| | | DataRecordPack.DR_ToolGMOperate(0, '', '', 'GMT_AddPersonalCompensation', str(gmCmdDict))
|
| | | return
|
| | |
| | | addItemDict['Count'] = GameWorld.ToIntDef(gmCmdDict.get('ItemCnt%s'%itemIndexStr, '0'))
|
| | | if addItemDict['Count'] == 0:
|
| | | return {}
|
| | | addItemDict['IsBind'] = GameWorld.ToIntDef(gmCmdDict.get('IsBind%s'%itemIndexStr, '0'))
|
| | | addItemDict['IsAuctionItem'] = GameWorld.ToIntDef(gmCmdDict.get('IsBind%s'%itemIndexStr, '0'))
|
| | | appointID = GameWorld.ToIntDef(gmCmdDict.get('AppointID%s'%itemIndexStr, '0'))
|
| | | #添加UserData信息
|
| | | addItemDict['UserData'] = ''
|
| | | UserDataDict = {}
|
| | |
| | | continue
|
| | | itemUserData[key] = value
|
| | |
|
| | | if appointID:
|
| | | itemUserData[ShareDefine.Def_CItemKey_AppointID] = appointID
|
| | | |
| | | if itemUserData:
|
| | | addItemDict['UserData'] = '%s'%itemUserData
|
| | |
|