4882 【BT】充值仙玉返利邮件多发(地图玩家的GetGameServerInitOK为True时才能发送邮件到GameServer);
5个文件已修改
73 ■■■■■ 已修改文件
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerCompensation.py 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/GameServerRefresh.py 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyGameData.py 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerCompensation.py
@@ -109,6 +109,8 @@
    limitTime = limitTime.split(".")[0]
    
    for i, playerIDList in enumerate(batchPlayerIDList):
        if not playerIDList:
            continue
        addItemList = batchAddItemList[i] if lenItem == lenPlayerID else []
        paramList = batchParamList[i] if lenParam == lenPlayerID else []
        gold = batchGold[i] if lenGold == lenPlayerID else 0
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -172,6 +172,7 @@
#===============================================================================
    #初始化物品
    #ChItem.InitPlayerLoginItem(curPlayer, tick)
    PlayerControl.ClearUnLoginOKPlayerMailCache(curPlayer.GetPlayerID())
    return
#---------------------------------------------------------------------
##C++封包GameServer_InitOK 处理
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/GameServerRefresh.py
@@ -442,7 +442,8 @@
    
    #查询是否还在申请家族列表中
    ChPlayer.QueryIsResFamily(curPlayer)
    #邮件
    PlayerControl.SendUnLoginOKPlayerMailCache(curPlayer)
    #刷新排行榜称号
    #PlayerDienstgrad.RefreshBillBoardDienstgrad(curPlayer)
    
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -333,6 +333,22 @@
    @param batchDetail: [记录邮件流向用, ...]
    @param moneySource: 货币来源
    '''
    copyMapPlayerManager = GameWorld.GetMapCopyPlayerManager()
    for i, playerIDList in enumerate(batchPlayerIDList):
        for playerID in playerIDList[::-1]:
            curPlayer = copyMapPlayerManager.FindPlayerByID(playerID)
            if curPlayer and not curPlayer.GetGameServerInitOK():
                bAddItemList = [batchAddItemList[i]] if len(batchAddItemList) > i else []
                bParamList = [batchParamList[i]] if len(batchParamList) > i else []
                bGold = [batchGold[i]] if len(batchGold) > i else []
                bGoldPaper = [batchGoldPaper[i]] if len(batchGoldPaper) > i else []
                bSilver = [batchSilver[i]] if len(batchSilver) > i else []
                bDetail = [batchDetail[i]] if len(batchDetail) > i else []
                AddUnLoginOKPlayerMailCache(playerID, "ByMailTemplate", [mailTypeKey, bAddItemList, bParamList, bGold, bGoldPaper, bSilver, bDetail, moneySource])
                playerIDList.pop(playerIDList.index(playerID))
                continue
    msgInfo = str([mailTypeKey, batchPlayerIDList, batchAddItemList, batchParamList, batchGold, batchGoldPaper, batchSilver, batchDetail, moneySource])
    GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "SendMailBatch", msgInfo, len(msgInfo))
    GameWorld.Log("SendMailBatch %s, batchPlayerIDList=%s, batchAddItemList=%s, batchParamList=%s, batchGold=%s, batchGoldPaper=%s, batchSilver=%s" 
@@ -404,10 +420,57 @@
    if GameWorld.IsCrossServer():
        return
    
    sendPlayerIDList = []
    copyMapPlayerManager = GameWorld.GetMapCopyPlayerManager()
    for playerID in playerIDList:
        curPlayer = copyMapPlayerManager.FindPlayerByID(playerID)
        if curPlayer and not curPlayer.GetGameServerInitOK():
            AddUnLoginOKPlayerMailCache(playerID, "ByMailContent", [title, content, getDays, addItemList, gold, goldPaper, silver, detail, moneySource])
            continue
        sendPlayerIDList.append(playerID)
    combineItemList = CombineMailItem(addItemList)
    cmdList = [title, content, getDays, playerIDList, combineItemList, gold, goldPaper, silver, detail, moneySource]
    cmdList = [title, content, getDays, sendPlayerIDList, combineItemList, gold, goldPaper, silver, detail, moneySource]
    GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "SendMail", '%s' % (cmdList), len(str(cmdList)))
    return True
def AddUnLoginOKPlayerMailCache(playerID, cacheType, mailInfo):
    ''' 添加未登录成功的玩家个人邮件发送缓存
    '''
    if playerID not in PyGameData.g_unLoginOKPlayerMailInfo:
        PyGameData.g_unLoginOKPlayerMailInfo[playerID] = []
    mailList = PyGameData.g_unLoginOKPlayerMailInfo[playerID]
    mailList.append([cacheType, mailInfo])
    # curPlayer.GetGameServerInitOK()
    GameWorld.Log("添加GetGameServerInitOK未登录成功的玩家个人邮件发送缓存! mailCount=%s, %s" % (len(mailList), str(PyGameData.g_unLoginOKPlayerMailInfo)), playerID)
    return
def ClearUnLoginOKPlayerMailCache(playerID):
    ## 清除未登录成功的玩家个人邮件发送缓存
    if playerID not in PyGameData.g_unLoginOKPlayerMailInfo:
        return
    PyGameData.g_unLoginOKPlayerMailInfo.pop(playerID)
    GameWorld.Log("清除未登录成功的玩家个人邮件发送缓存!", playerID)
    return
def SendUnLoginOKPlayerMailCache(curPlayer):
    ## 未登录成功的玩家个人邮件发送缓存  - 登录成功后处理
    if not curPlayer.GetGameServerInitOK():
        return
    playerID = curPlayer.GetPlayerID()
    if playerID not in PyGameData.g_unLoginOKPlayerMailInfo:
        return
    mailList = PyGameData.g_unLoginOKPlayerMailInfo.pop(playerID)
    for cacheType, mailInfo in mailList:
        playerIDList = [playerID]
        GameWorld.Log("发送未登录成功时缓存的待发送邮件! cacheType=%s, mailInfo=%s" % (cacheType, str(mailInfo)), playerID)
        if cacheType == "ByMailContent":
            title, content, getDays, addItemList, gold, goldPaper, silver, detail, moneySource = mailInfo
            SendMail(title, content, getDays, playerIDList, addItemList, gold, goldPaper, silver, detail, moneySource)
        elif cacheType == "ByMailTemplate":
            mailTypeKey, bAddItemList, bParamList, bGold, bGoldPaper, bSilver, bDetail, moneySource = mailInfo
            SendMailBatch(mailTypeKey, [playerIDList], bAddItemList, bParamList, bGold, bGoldPaper, bSilver, bDetail, moneySource)
    return
def CombineMailItem(addItemList):
    ## 合并邮件物品
@@ -1263,6 +1326,7 @@
    PyGameData.g_playerEquipPartAttrDict.pop(playerID, None)
    PyGameData.g_equipChangeClassLVInfo.pop(playerID, None)
    NPCCommon.ClearPriWoodPile(curPlayer)
    ClearUnLoginOKPlayerMailCache(playerID)
    return
##更新保存玩家在线时间
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyGameData.py
@@ -35,6 +35,7 @@
g_teamPlayerHurtValue = {} # 队伍玩家对NPC伤害输出量 {(lineID, objID, npcID):{(teamID, playerID):hurtValue, ...}, }
g_teamPlayerDict = {} # 地图队伍对应玩家ID列表,含离线玩家 {teamID:[playerID, ...], ...}
g_unLoginOKPlayerMailInfo = {} # GameServer 未登录成功前需要发送的邮件缓存,防止登录失败不存db导致重复发送邮件 {playerID:[[待发送邮件内容信息], ...], ...}
g_disconnectPlayer = {} # 在本地图离线的玩家信息 {playerID:[tick, posX, posY], ...}
g_lastExitFBType = {} # 最后一个离开副本信息 {fbIndex:[exitType, tick], ...} exitType: 1-掉线,2-主动退出