5314 【BT3_1.102.1】【BT4】【BT5_1.101.1】【BT5】【主干】社交表数据重复(增加判断是否本服玩家ID逻辑;增加送礼物及提亲对象非本服玩家时提示)
6个文件已修改
35 ■■■■■ 已修改文件
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldProcess.py 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerControl.py 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerLove.py 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerSocial.py 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldProcess.py
@@ -1218,6 +1218,7 @@
def InitGameWorld(tick):
    #标记GameWorld初始化完成
    GameWorld.GetGameWorld().SetDict(ChConfig.Def_WorldKey_IsGameWorldInit, int(time.time()))
    PlayerControl.LoadDBPlayer()
    #初始化游戏时钟
    GameWorld.GetGameWorld().SetTickTypeCount(ChConfig.TYPE_Tick_Count)
    #初始话开服时间、星期几
ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py
@@ -216,6 +216,8 @@
    if GameWorld.IsCrossServer():
        return
    
    PyGameData.g_dbPlayerIDMap[curPlayer.GetPlayerID()] = curPlayer.GetAccID()
    if not PlayerControl.GetIsTJG(curPlayer):
        #家族副本boss状态通知
        PlayerFamilyBoss.OnLogin(curPlayer)
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerControl.py
@@ -32,6 +32,7 @@
import IpyGameDataPY
import CrossRealmMsg
import ShareDefine
import PyGameData
import ChConfig
import types
#---------------------------------------------------------------------
@@ -187,7 +188,22 @@
    return NotifyCodeList
#------------------------------------------------------------------------------
def LoadDBPlayer():
    if GameWorld.IsCrossServer():
        return
    PlayerDBOper.FindDBOper(PlayerDBOper.Table_DBPlayer, {}, {"PlayerID":1, "AccID":1, "_id":0}, LoadDBPlayerRet)
    return
def LoadDBPlayerRet(resultSetList, extendValueList):
    for resultDict in resultSetList:
        PyGameData.g_dbPlayerIDMap[resultDict["PlayerID"]] = resultDict["AccID"]
    GameWorld.Log("启动服务器加载DBPlayer玩家账号ID对应关系! %s, %s" % (len(PyGameData.g_dbPlayerIDMap), PyGameData.g_dbPlayerIDMap))
    return
def GetDBPlayerAccIDByID(playerID):
    ## 获取玩家表账号ID - 根据玩家ID, 可用于判断是否本服玩家
    return PyGameData.g_dbPlayerIDMap.get(playerID, "")
#waring:以下使用的扩展属性字段记录的属性类型必须和MapServer一致
#------------------------------------------------------------------------------ 
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerLove.py
@@ -778,6 +778,10 @@
    tagPlayerID = dataMsg[0]
    playerID = curPlayer.GetPlayerID()
    
    if not PlayerControl.GetDBPlayerAccIDByID(tagPlayerID):
        PlayerControl.NotifyCode(curPlayer, "NoInDBPlayer")
        return
    # 黑名单检查
    if PyDataManager.GetBlacklistManager().CheckBlacklistBoth(playerID, tagPlayerID, curPlayer):
        return
@@ -857,6 +861,10 @@
    
    playerID = curPlayer.GetPlayerID()
    
    if not PlayerControl.GetDBPlayerAccIDByID(tagPlayerID):
        PlayerControl.NotifyCode(curPlayer, "NoInDBPlayer")
        return
    # 黑名单检查
    if PyDataManager.GetBlacklistManager().CheckBlacklistBoth(playerID, tagPlayerID, curPlayer):
        return
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerSocial.py
@@ -38,6 +38,9 @@
    
    # 添加社交对象
    def Add(self, tagID, isNotify=True):
        if not PlayerControl.GetDBPlayerAccIDByID(tagID):
            GameWorld.ErrLog("试图添加非本服玩家社交对象: tagID=%s,GroupType=%s" % (tagID, self.GroupType))
            return False
        GameWorld.DebugLog("SocialPlayers----Add %s-%s-%s"%(self.GroupType, self.PlayerID, tagID))
        if tagID in self.SocialDict:
            GameWorld.DebugLog("SocialPlayers----Add 重复")
@@ -424,6 +427,9 @@
    
    # 获取亲密组
    def GetIntimacys(self, playerID):
        if not PlayerControl.GetDBPlayerAccIDByID(playerID):
            GameWorld.ErrLog("试图获取非本服玩家亲密组: playerID=%s" % playerID)
            return
        if playerID not in self.PlayerIntimacys:
            self.PlayerIntimacys[playerID] = Intimacys(playerID)
        return self.PlayerIntimacys[playerID]
ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py
@@ -12,6 +12,8 @@
#
#---------------------------------------------------------------------
g_dbPlayerIDMap = {} # DBPlayer玩家表ID映射关系 {playerID:accID, ...}
g_allMapServerInitOK = False
g_pyGameDataManager = None