| | |
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package PyMongoDataServer.GMToolLogicProcess.Commands.GMT_CompensationQueryPersonal
|
| | | ##@package PyMongoDB.GMToolLogicProcess.Commands.GMT_CompensationQueryPersonal
|
| | | #
|
| | | # @todo:个人补偿查询管理
|
| | | # @todo:GM工具命令 - 个人邮件查询管理
|
| | | # @author hxp
|
| | | # @date 2020-12-21
|
| | | # @date 2025-06-04
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 个人补偿查询管理
|
| | | # 详细描述: GM工具命令 - 个人邮件查询管理
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2020-12-21 19:00"""
|
| | | #"""Version = 2025-06-04 15:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GMCommon
|
| | | import GameWorld
|
| | | import DataRecordPack
|
| | | import PlayerMail
|
| | | import DBDataMgr
|
| | |
|
| | | ## 收到gm命令执行
|
| | | # @param gmCmdDict:gm命令字典
|
| | | # @return None
|
| | | def OnExec(gmCmdDict):
|
| | | playerList = gmCmdDict.get("playerList", "") #玩家列表
|
| | |
|
| | | if playerList == "":
|
| | | return GMCommon.Def_ParamErr, "Please enter search player info!" |
| | |
|
| | | # 回复gm参数错误
|
| | | return GMCommon.Def_DoQueryUserDB, ''
|
| | |
|
| | | ## 查询userdb返回
|
| | | # @param userdb:userdb
|
| | | # @param data:传入的信息
|
| | | # @param gmCmdDict:gm命令字典
|
| | | # @return None |
| | | def UserDBResponse(userdb, data, gmCmdDict):
|
| | | return GMCommon.Def_SendToGameServer, ''
|
| | |
|
| | |
|
| | | errorMsg = ""
|
| | | from GMToolLogicProcess import ProjSpecialProcess
|
| | | Result, playerID = ProjSpecialProcess.GMCmdPlayerValidationID(gmCmdDict)
|
| | | if Result != GMCommon.Def_Success:
|
| | | return Result, errorMsg
|
| | | |
| | | Result = GMCommon.Def_Unknow
|
| | | |
| | | opType = gmCmdDict.get('opType', 'query')
|
| | | |
| | | # 暂仅做删除及查询
|
| | | if opType == "del":
|
| | | GUIDInfo = gmCmdDict.get('GUIDInfo', '')
|
| | | if not GUIDInfo:
|
| | | return GMCommon.Def_ParamErr
|
| | | |
| | | delGUIDList = GUIDInfo.split(",")
|
| | | if not delGUIDList:
|
| | | return GMCommon.Def_ParamErr
|
| | | |
| | | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(playerID)
|
| | | for delGUID in delGUIDList:
|
| | | PlayerMail.doMailDel(curPlayer, delGUID, True, playerID)
|
| | | |
| | | else:
|
| | | pass
|
| | | |
| | | mailList = __queryMailInfoList(playerID)
|
| | | |
| | | #流向
|
| | | if opType == "del":
|
| | | GMT_Name = gmCmdDict.get(GMCommon.Def_GMKey_Type, '') |
| | | DataRecordPack.DR_ToolGMOperate(0, '', '', GMT_Name, str(gmCmdDict))
|
| | | return GMCommon.Def_Success, {"mailList":mailList}
|
| | | |
| | | def __queryMailInfoList(playerID):
|
| | | '''个人补偿邮件查询
|
| | | '''
|
| | | |
| | | mailList = []
|
| | | mailMgr = DBDataMgr.GetMailMgr()
|
| | | guids = mailMgr.GetPersonalMailGuids(playerID)
|
| | | for guid in guids:
|
| | | mailObj = mailMgr.GetPersonalMail(playerID, guid)
|
| | | if not mailObj:
|
| | | continue
|
| | | title = mailObj.GetTitle()
|
| | | content = mailObj.GetText()
|
| | | mailType = mailObj.GetType()
|
| | | createTime = mailObj.GetCreateTime()
|
| | | limitDays = mailObj.GetLimitDays()
|
| | | mailState = mailObj.GetMailState()
|
| | | |
| | | if "<T>" in title:
|
| | | title = title[3:-4]
|
| | | |
| | | itemList = mailMgr.GetMailItemList(guid)
|
| | | infoDict = {"GUID":guid, "Title":title, "Content":content, "State":mailState, "MailType":mailType,
|
| | | "CreateTime":createTime, "LimitDays":limitDays, "ItemList":itemList}
|
| | | mailList.append(infoDict)
|
| | | |
| | | mailList.sort(key=lambda m:(m["CreateTime"]), reverse=True)
|
| | | return mailList
|