hxp
2019-08-28 274da001f56cd650d57f35ae2f65aa58f969a8e7
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerTalk.py
@@ -496,13 +496,18 @@
    return
def NotifyTalkCache(curPlayer):
    ##上线通知聊天缓存
    sendPack = ChPyNetSendPack.tagGCTalkCache()
    sendPack.Clear()
    sendPack.InfoList = []
    ##上线通知非脱机离线后的聊天缓存
    if PlayerControl.GetIsTJG(curPlayer):
        return
    playerID = curPlayer.GetPlayerID()
    unTJLogoffTime = PyGameData.g_unTJLogoffTime.get(playerID, 0)
    familyCacheList, worldCacheList = [], []
    familyID = curPlayer.GetFamilyID()
    if familyID and familyID in PyGameData.g_familyTalkCache:
        for curTime, name, playerID, content, extras in PyGameData.g_familyTalkCache[familyID]:
            if curTime < unTJLogoffTime:
                continue
            contentInfo = ChPyNetSendPack.tagGCTalkCacheInfo()
            contentInfo.Clear()
            contentInfo.ChannelType = 2
@@ -513,20 +518,34 @@
            contentInfo.Content = content
            contentInfo.Len = len(content)
            contentInfo.Extras = extras
            sendPack.InfoList.append(contentInfo)
    elif PyGameData.g_worldTalkCache:
        for curTime, name, playerID, content, extras in PyGameData.g_worldTalkCache:
            contentInfo = ChPyNetSendPack.tagGCTalkCacheInfo()
            contentInfo.Clear()
            contentInfo.ChannelType = 1
            contentInfo.Name = name
            contentInfo.NameLen = len(name)
            contentInfo.PlayerID = playerID
            contentInfo.Time = curTime
            contentInfo.Content = content
            contentInfo.Len = len(content)
            contentInfo.Extras = extras
            sendPack.InfoList.append(contentInfo)
    sendPack.Count = len(sendPack.InfoList)
    NetPackCommon.SendFakePack(curPlayer, sendPack)
            familyCacheList.append(contentInfo)
    for curTime, name, playerID, content, extras in PyGameData.g_worldTalkCache:
        if curTime < unTJLogoffTime:
            continue
        contentInfo = ChPyNetSendPack.tagGCTalkCacheInfo()
        contentInfo.Clear()
        contentInfo.ChannelType = 1
        contentInfo.Name = name
        contentInfo.NameLen = len(name)
        contentInfo.PlayerID = playerID
        contentInfo.Time = curTime
        contentInfo.Content = content
        contentInfo.Len = len(content)
        contentInfo.Extras = extras
        worldCacheList.append(contentInfo)
    if familyCacheList:
        sendPack = ChPyNetSendPack.tagGCTalkCache()
        sendPack.Clear()
        sendPack.InfoList = familyCacheList
        sendPack.Count = len(sendPack.InfoList)
        NetPackCommon.SendFakePack(curPlayer, sendPack)
    if worldCacheList:
        sendPack = ChPyNetSendPack.tagGCTalkCache()
        sendPack.Clear()
        sendPack.InfoList = worldCacheList
        sendPack.Count = len(sendPack.InfoList)
        NetPackCommon.SendFakePack(curPlayer, sendPack)
    return