ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTalk.py
@@ -20,12 +20,12 @@
import ShareDefine
import IPY_GameWorld
import ChPyNetSendPack
import CrossRealmPlayer
import PlayerViewCache
import NetPackCommon
import IpyGameDataPY
import PlayerControl
import PlayerFamily
import CrossPlayer
import DBDataMgr
import math
@@ -33,15 +33,17 @@
#需要记录聊天缓存的频道对应限制最大条数
ChannelCacheMax = {IPY_GameWorld.tcFamily:30,
                   IPY_GameWorld.tcWorld:100,
                   IPY_GameWorld.tcCountry:200,
                   }
    
def OnPlayerLogin(curPlayer):
    NotifyTalkCache(curPlayer)
    crossPlayer = CrossPlayer.GetCrossPlayerMgr().FindCrossPlayer(curPlayer.GetPlayerID())
    NotifyTalkCache(crossPlayer, [IPY_GameWorld.tcWorld])
    return
#// B3 20 聊天 #tagCMTalk
#// B3 20 聊天 #tagCSTalk
#
#struct    tagCMPyTalk
#struct    tagCSTalk
#{
#    tagHead        Head;
#    BYTE        ChannelType;    // 频道
@@ -64,9 +66,6 @@
    elif channelType == IPY_GameWorld.tcCountry:
        if GameWorld.IsCrossServer():
            return
        if not CrossRealmPlayer.IsCrossServerOpen():
            PlayerControl.NotifyCode(curPlayer, "CrossMatching18")
            return
        
    if not __CheckTalk(curPlayer, channelType, content, tick):
        return
@@ -74,11 +73,7 @@
    curPlayer.SetLastChatTick(tick)
    curPlayer.SetDict(ChConfig.Def_ChannelTalkTick % channelType, tick)
    
    if channelType == IPY_GameWorld.tcCountry:
        #发送到跨服,待扩展
        return
    bubbleBox = PlayerControl.GetChatBubbleBox(curPlayer) # 气泡框
    bubbleBox = PlayerControl.GetChatBox(curPlayer) # 气泡框
    
    clientPack = ChPyNetSendPack.tagMCTalk()
    clientPack.ChannelType = channelType
@@ -93,14 +88,17 @@
    clientPack.RealmLV = curPlayer.GetOfficialRank()
    clientPack.Face = curPlayer.GetFace()
    clientPack.FacePic = curPlayer.GetFacePic()
    clientPack.TitleID = PlayerControl.GetTitleID(curPlayer)
    clientPack.ServerID = GameWorld.GetPlayerServerID(curPlayer)
    
    if channelType == IPY_GameWorld.tcWorld:
        NetPackCommon.SendFackPackOnline(clientPack)
        DoTalkCache(channelType, playerID, content, bubbleBox, familyID)
    elif channelType == IPY_GameWorld.tcFamily:
        PlayerFamily.Broadcast_FamilyPack(familyID, clientPack)
        PlayerFamily.OnFamilyTalk(curPlayer, familyID, clientPack, tick)
    elif channelType == IPY_GameWorld.tcCountry:
        PlayerFamily.OnCrossFamilyTalk(curPlayer, clientPack, tick)
        
    DoTalkCache(channelType, playerID, content, bubbleBox, familyID)
    return
def __CheckTalk(curPlayer, channelType, content, tick, checkGMForbidenTalk=True):
@@ -167,13 +165,17 @@
        
    return
def NotifyTalkCache(curPlayer):
def NotifyTalkCache(crossPlayer, channelTypeList):
    ##上线通知聊天缓存
    # @param channelTypeList: 指定需要通知聊天缓存频道列表,不同频道的缓存可能存储在不同的服务器,如公会在公会数据所在服等
    if not crossPlayer:
        return
    for channelType in ChannelCacheMax.keys():
        if channelType not in channelTypeList:
            continue
        cacheList = []
        if channelType == IPY_GameWorld.tcFamily:
            familyID = curPlayer.GetFamilyID()
            familyID = crossPlayer.GetFamilyID()
            if not familyID:
                continue
            familyActonMgr = DBDataMgr.GetFamilyActionMgr().GetFamilyAction(familyID, ShareDefine.Def_ActionType_TalkCache)
@@ -218,6 +220,7 @@
            talkCache.RealmLV = viewCache.GetRealmLV()
            talkCache.Face = viewCache.GetFace()
            talkCache.FacePic = viewCache.GetFacePic()
            talkCache.TitleID = viewCache.GetTitleID()
            talkCache.ServerID = viewCache.GetServerID()
            talkCache.TalkTime = talkTime
            packCacheList.append(talkCache)
@@ -229,6 +232,6 @@
        clientPack.ChannelType = channelType
        clientPack.InfoList = packCacheList
        clientPack.Count = len(clientPack.InfoList)
        NetPackCommon.SendFakePack(curPlayer, clientPack)
        CrossPlayer.SendFakePack(crossPlayer, clientPack)
        
    return