| | |
| | | #"""Version = 2025-05-14 12:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import CrossMsg
|
| | | import GameWorld
|
| | | import ItemCommon
|
| | | import PlayerControl
|
| | |
| | | Sync_PlayerMailState(curPlayer, notifyGUIDState)
|
| | | return
|
| | |
|
| | | def SendMailByKey(mailTypeKey, playerID, itemList, paramList=[], limitDays=7):
|
| | | def SendMailByKey(mailTypeKey, playerID, itemList, paramList=[], limitDays=7, toServerID=0):
|
| | | ## 发送个人邮件魔板
|
| | | # @param itemList: 元素支持字典{itemID:itemCount, ...} 或列表 [itemID, itemCount, 可选是否拍品, 物品UserData]
|
| | | # @param toServerID: 向其他服玩家发送邮件时需指定玩家所在服务器
|
| | | if toServerID > 0:
|
| | | if not GameWorld.IsCrossServer():
|
| | | GameWorld.ErrLog("非跨服服务器不能向其他服务器发送个人邮件! %s,playerID=%s" % (mailTypeKey, playerID))
|
| | | return
|
| | | dataMsg = {"mailTypeKey":mailTypeKey, "itemList":itemList, "paramList":paramList, "limitDays":limitDays}
|
| | | mainServerID = GameWorld.GetMainServerID(toServerID)
|
| | | CrossMsg.SendToClientServer(ShareDefine.C2S_SendPlayerMail, dataMsg, [mainServerID], playerID)
|
| | | return
|
| | | |
| | | if not mailTypeKey:
|
| | | mailTypeKey = ShareDefine.DefaultLackSpaceMailType
|
| | | title = "<T>%s</T>" % mailTypeKey
|
| | |
| | | SendMail(playerID, title, text, itemList, limitDays)
|
| | | return
|
| | |
|
| | | def C2S_SendPlayerMail(dataMsg, playerID):
|
| | | mailTypeKey = dataMsg["mailTypeKey"]
|
| | | itemList = dataMsg["itemList"]
|
| | | paramList = dataMsg["paramList"]
|
| | | limitDays = dataMsg["limitDays"]
|
| | | if not GameWorld.GetDBPlayerAccIDByID(playerID):
|
| | | return
|
| | | SendMailByKey(mailTypeKey, playerID, itemList, paramList, limitDays)
|
| | | return
|
| | |
|
| | | def SendMail(playerID, title, text, itemList=None, limitDays=7, mailType=0):
|
| | | ## 发送个人邮件
|
| | | # @param itemList: 元素支持字典{itemID:itemCount, ...} 或列表 [itemID, itemCount, 可选是否拍品, 物品UserData]
|