5314 【BT3_1.102.1】【BT4】【BT5_1.101.1】【BT5】【主干】社交表数据重复(增加判断是否本服玩家ID逻辑;增加送礼物及提亲对象非本服玩家时提示)
| | |
| | | def InitGameWorld(tick):
|
| | | #标记GameWorld初始化完成
|
| | | GameWorld.GetGameWorld().SetDict(ChConfig.Def_WorldKey_IsGameWorldInit, int(time.time()))
|
| | | PlayerControl.LoadDBPlayer()
|
| | | #初始化游戏时钟
|
| | | GameWorld.GetGameWorld().SetTickTypeCount(ChConfig.TYPE_Tick_Count)
|
| | | #初始话开服时间、星期几
|
| | |
| | | if GameWorld.IsCrossServer():
|
| | | return
|
| | |
|
| | | PyGameData.g_dbPlayerIDMap[curPlayer.GetPlayerID()] = curPlayer.GetAccID()
|
| | | |
| | | if not PlayerControl.GetIsTJG(curPlayer):
|
| | | #家族副本boss状态通知
|
| | | PlayerFamilyBoss.OnLogin(curPlayer)
|
| | |
| | | import IpyGameDataPY
|
| | | import CrossRealmMsg
|
| | | import ShareDefine
|
| | | import PyGameData
|
| | | import ChConfig
|
| | | import types
|
| | | #---------------------------------------------------------------------
|
| | |
| | |
|
| | | 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一致
|
| | | #------------------------------------------------------------------------------
|
| | |
| | | tagPlayerID = dataMsg[0]
|
| | | playerID = curPlayer.GetPlayerID()
|
| | |
|
| | | if not PlayerControl.GetDBPlayerAccIDByID(tagPlayerID):
|
| | | PlayerControl.NotifyCode(curPlayer, "NoInDBPlayer")
|
| | | return
|
| | | |
| | | # 黑名单检查
|
| | | if PyDataManager.GetBlacklistManager().CheckBlacklistBoth(playerID, tagPlayerID, curPlayer):
|
| | | return
|
| | |
| | |
|
| | | playerID = curPlayer.GetPlayerID()
|
| | |
|
| | | if not PlayerControl.GetDBPlayerAccIDByID(tagPlayerID):
|
| | | PlayerControl.NotifyCode(curPlayer, "NoInDBPlayer")
|
| | | return
|
| | | |
| | | # 黑名单检查
|
| | | if PyDataManager.GetBlacklistManager().CheckBlacklistBoth(playerID, tagPlayerID, curPlayer):
|
| | | return
|
| | |
| | |
|
| | | # 添加社交对象
|
| | | 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 重复")
|
| | |
| | |
|
| | | # 获取亲密组
|
| | | 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]
|
| | |
| | | #
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | g_dbPlayerIDMap = {} # DBPlayer玩家表ID映射关系 {playerID:accID, ...}
|
| | |
|
| | | g_allMapServerInitOK = False
|
| | |
|
| | | g_pyGameDataManager = None
|