| | |
| | | #------------------------------------------------------------------------------
|
| | | import GameWorld
|
| | | import ChConfig
|
| | | #import ShareDefine
|
| | | import ShareDefine
|
| | | import IPY_GameServer
|
| | | import ChGameToMapPyPack
|
| | | import NetPackCommon
|
| | |
| | | return
|
| | |
|
| | | def SendMailByKey(mailTypeKey, playerIDList, addItemList, paramList=[], gold=0, goldPaper=0, silver=0, detail=""):
|
| | | if not mailTypeKey:
|
| | | mailTypeKey = ShareDefine.DefaultLackSpaceMailType
|
| | | GameWorld.DebugLog("SendMailByKey %s, playerIDList=%s, addItemList=%s, paramList=%s, gold=%s, goldPaper=%s, silver=%s"
|
| | | % (mailTypeKey, playerIDList, addItemList, paramList, gold, goldPaper, silver))
|
| | | title = ""
|
| | |
| | | # @param sourceType 查看 Mail_Type_Default 相关定义
|
| | | # @return None
|
| | | def SendPersonalAsTextMail(PlayerID, title, content, limitTime, sourceType = ChConfig.Mail_Type_Default):
|
| | | if GameWorld.IsMergeServer():
|
| | | if GameWorld.IsCrossServer():
|
| | | return
|
| | | GUID = str(uuid.uuid1())
|
| | | PyAddPersonalCompensation(GUID, PlayerID, GameWorld.GetCurrentDataTimeStr(), limitTime,
|
| | |
| | | # @param addItemDictList, LimitTime, mailInfo, PlayerJob, Text
|
| | | # @return None
|
| | | def AddEntireItem(GUID, addItemDictList, LimitTime, mailInfo, PlayerJob, Text,
|
| | | gold = 0, goldPaper = 0, silver = 0, detail=""):
|
| | | gold = 0, goldPaper = 0, silver = 0, detail="", serverID=0):
|
| | | '''
|
| | | @param mailInfo: GetEntireCompensationInfo 的返回值, 目前暂存字段 PlayerLV 中
|
| | | '''
|
| | | if GameWorld.IsMergeServer():
|
| | | if GameWorld.IsCrossServer():
|
| | | return
|
| | | #GameWorld.DebugLog("Compensation### AddEntireItem GUID:%s ItemDict:\n%s "%(GUID, addItemDictList))
|
| | |
|
| | |
| | | GameWorld.GetCompensationMgr().AddCompensationItem(GUID, curItemData)
|
| | |
|
| | | createTime = GameWorld.GetCurrentDataTimeStr()
|
| | | |
| | | #添加全服领取补偿条件
|
| | | GameWorld.GetCompensationMgr().AddEntireCompensationItem(GUID, createTime, LimitTime, mailInfo,
|
| | | PlayerJob, Text, gold, goldPaper, silver)
|
| | | PlayerJob, Text, gold, goldPaper, silver, serverID)
|
| | | checkState, limitLVType, limitLV = ParseEntireCompensationInfo(mailInfo)
|
| | | addDict = {"LimitTime":LimitTime, "LimitLV":limitLV, "LimitLVType":limitLVType, "CheckState":checkState, "PlayerJob":PlayerJob, "Text":Text,
|
| | | "Gold":gold, "GoldPaper":goldPaper, "Silver":silver, "ItemList":addItemDictList, "Detail":detail}
|
| | |
| | | # @return None
|
| | | def AddPersonalItem(GUID, addItemDictList, PlayerIDList, LimitTime, Text,
|
| | | gold = 0, goldPaper = 0, silver = 0, sourceType = ChConfig.Mail_Type_Default, detail=""):
|
| | | if GameWorld.IsMergeServer():
|
| | | if GameWorld.IsCrossServer():
|
| | | return
|
| | | GameWorld.DebugLog("Compensation### AddPersonalItem GUID:%s ItemDict:\n%s "%(GUID, addItemDictList))
|
| | |
|
| | |
| | | if (curEntireRequire.PlayerJob&pow(2,curJob)) == 0:
|
| | | SetPrizeState(curPlayerID, GUID, Disable_State, readState)
|
| | | return Unknow_CompensationType, None
|
| | | |
| | | |
| | | if curEntireRequire.ServerID and curEntireRequire.ServerID != GameWorld.GetPlayerServerID(curPlayer):
|
| | | # 指定服务器邮件
|
| | | SetPrizeState(curPlayerID, GUID, Disable_State, readState)
|
| | | return Unknow_CompensationType, None
|
| | | |
| | | #可以用的奖励
|
| | | SetPrizeState(curPlayerID, GUID, Enable_State, readState)
|
| | | #返回物品信息
|