| | |
| | | def __doPlayerOnDay(curPlayer):
|
| | | PlayerFamilyZhenbaoge.PlayerOnDay(curPlayer)
|
| | | PlayerFamilyTaofa.PlayerOnDay(curPlayer)
|
| | | Do_MapServer_PlayerOnDay(curPlayer)
|
| | | ResetDailyDonateCnt(curPlayer)
|
| | | return
|
| | |
|
| | | def OnPlayerLogin(curPlayer, tick):
|
| | | Do_MapServer_PlayerLogin(curPlayer)
|
| | | if DBFamily.IsFamilyCross():
|
| | | GameWorld.DebugLog("公会已跨服不处理,由所属跨服服务器处理成员登录逻辑 OnPlayerLogin", curPlayer.GetPlayerID())
|
| | | return
|
| | |
| | |
|
| | | def OnCrossPlayerLogin(crossPlayer):
|
| | | ## 玩家上线,游戏服跨服通用,流程上当做以前GameServer处理公会一样,处理后再通知地图(现在的游戏服)
|
| | | PlayerLoginRefreshFamily(crossPlayer)
|
| | | PlayerLoginRefreshFamily(crossPlayer) # 必须先刷新
|
| | | Sync_RequestAddFamilyInfo(crossPlayer, False)
|
| | | PlayerTalk.NotifyTalkCache(crossPlayer, [IPY_GameWorld.tcFamily]) # 公会聊天缓存
|
| | | #PlayerFamilyTaofa.OnPlayerLogin(curPlayer) 讨伐待修改
|
| | | if GameWorld.IsCrossServer():
|
| | | PlayerTalk.NotifyTalkCache(crossPlayer, [IPY_GameWorld.tcCountry]) # 跨服公会聊天缓存
|
| | | PlayerFamilyTaofa.OnCrossPlayerLogin(crossPlayer)
|
| | | return
|
| | |
|
| | | def OnPlayerLogout(curPlayer):
|
| | |
| | | C2S_FamilyMapPlayer(dataMsg, playerID)
|
| | | return
|
| | |
|
| | | def MapServer_FamilyRefresh(crossPlayer, familyID, isVoluntarily=0):
|
| | | def MapServer_FamilyRefresh(crossPlayer, familyID, isVoluntarily=0, isLogin=False):
|
| | | ''' 相当于GameServer调用 curPlayer.MapServer_FamilyRefresh()
|
| | | '''
|
| | | playerID = crossPlayer.GetPlayerID()
|
| | | FmLV = 0 # ְλ
|
| | | FamilyLV = 0 # 公会等级
|
| | | JoinTime = 0
|
| | | FamilyName = ""
|
| | | EmblemID, EmblemWord = 0, ""
|
| | | if familyID:
|
| | |
| | | member = curFamily.FindMember(playerID)
|
| | | if member:
|
| | | FmLV = member.GetFmLV()
|
| | | JoinTime = member.GetJoinTime()
|
| | | else:
|
| | | familyID = 0
|
| | |
|
| | |
| | |
|
| | | doData = {"FamilyID":familyID}
|
| | | if familyID:
|
| | | doData.update({"FmLV":FmLV, "FamilyLV":FamilyLV, "FamilyName":FamilyName, "EmblemID":EmblemID, "EmblemWord":EmblemWord})
|
| | | doData.update({"FmLV":FmLV, "JoinTime":JoinTime, "FamilyLV":FamilyLV, "FamilyName":FamilyName, "EmblemID":EmblemID, "EmblemWord":EmblemWord})
|
| | | if isVoluntarily:
|
| | | doData["isVoluntarily"] = 1
|
| | | if isLogin:
|
| | | doData["isLogin"] = 1
|
| | | SendToFamilyMapPlayer(crossPlayer, "FamilyRefresh", doData)
|
| | | return
|
| | |
|
| | |
| | | refreshFamilyID = familyMgr.GetPlayerFamilyID(playerID)
|
| | | GameWorld.DebugLog("PlayerLoginRefreshFamily playerID=%s,refreshFamilyID=%s" % (playerID, refreshFamilyID))
|
| | | crossPlayer.SetFamilyID(refreshFamilyID)
|
| | | MapServer_FamilyRefresh(crossPlayer, refreshFamilyID) # 登录
|
| | | MapServer_FamilyRefresh(crossPlayer, refreshFamilyID, isLogin=True) # 登录
|
| | | familyID = refreshFamilyID
|
| | | if not familyID:
|
| | | return
|
| | |
| | | if not member:
|
| | | return
|
| | | member.RefreshMemberByID(playerID)
|
| | | Broadcast_FamilyInfo(familyID, changeMemIDList=[playerID], excludeIDList=[playerID]) # 成员信息变更
|
| | | return
|
| | |
|
| | | def FamilyPyPackForwarding(curPlayer, clientData, tick, funcName, needResult=False, reqCD=0.5, reqDataEx=None):
|
| | |
| | | if CheckFamilyNameExists(crossPlayer, newName, fromServerID):
|
| | | return
|
| | |
|
| | | zoneMgr = familyMgr.GetZoneFamilyMgrByFamilyID(familyID)
|
| | | if not zoneMgr:
|
| | | return
|
| | | |
| | | if not zoneMgr.FamilyRemainName(family, newName):
|
| | | return
|
| | | |
| | | if cdHours:
|
| | | SetRenameTime(family, curTime)
|
| | | |
| | | moneyType, moneyValue = IpyGameDataPY.GetFuncEvalCfg("FamilyRename", 1)
|
| | | if moneyType and moneyValue:
|
| | | CrossPlayer.CostPlayerResources(crossPlayer, "FamilyRename", costMoneyDict={moneyType:moneyValue})
|
| | | |
| | | family.SetName(newName) |
| | | if cdHours:
|
| | | SetRenameTime(family, curTime)
|
| | |
|
| | | crossPlayerMgr = CrossPlayer.GetCrossPlayerMgr()
|
| | | for index in xrange(family.GetCount()):
|
| | |
| | | def OnFamilyTalk(curPlayer, familyID, talkPack, tick):
|
| | | clientData, tick = None, 0
|
| | | reqDataEx = {"talkBuffer":talkPack.GetBuffer()}
|
| | | FamilyPyPackForwarding(curPlayer, clientData, tick, "__OnFamilyTalk", reqCD=0, reqDataEx=reqDataEx)
|
| | | FamilyPyPackForwarding(curPlayer, clientData, tick, "__OnFamilyTalk", reqDataEx=reqDataEx)
|
| | | return
|
| | | def __OnFamilyTalk(crossPlayer, clientData, tick, fromServerID=0, reqDataEx=None):
|
| | | talkBuffer = reqDataEx["talkBuffer"]
|
| | |
| | | PlayerTalk.DoTalkCache(channelType, playerID, content, bubbleBox, familyID)
|
| | | return
|
| | |
|
| | | def OnCrossFamilyTalk(curPlayer, talkPack, tick):
|
| | | ## 跨服公会聊天,与跨服公会互通范围一致
|
| | | crossServerID = DBDataMgr.GetFamilyMgr().GetCurCrossServerID()
|
| | | if crossServerID <= 0:
|
| | | GameWorld.DebugLog("本服公会未互通,不允许跨服聊天")
|
| | | return
|
| | | clientData, tick = None, 0
|
| | | reqDataEx = {"talkBuffer":talkPack.GetBuffer()}
|
| | | FamilyPyPackForwarding(curPlayer, clientData, tick, "__OnCrossTalk", reqDataEx=reqDataEx)
|
| | | return
|
| | | def __OnCrossTalk(crossPlayer, clientData, tick, fromServerID=0, reqDataEx=None):
|
| | | talkBuffer = reqDataEx["talkBuffer"]
|
| | | playerID = crossPlayer.GetPlayerID()
|
| | | |
| | | if not talkBuffer:
|
| | | return
|
| | | |
| | | familyMgr = DBDataMgr.GetFamilyMgr()
|
| | | zoneID = familyMgr.GetZoneIDInThisServer(fromServerID)
|
| | | if zoneID < 0:
|
| | | GameWorld.ErrLog("找不到服务器ID在跨服中的公会分区! fromServerID=%s" % fromServerID)
|
| | | return
|
| | | zoneMgr = familyMgr.GetZoneFamilyMgr(zoneID)
|
| | | serverIDList = zoneMgr.GetZoneServerIDList()
|
| | | if not serverIDList:
|
| | | return
|
| | | |
| | | clientPack = ChPyNetSendPack.tagMCTalk()
|
| | | clientPack.ReadData(talkBuffer)
|
| | | CrossPlayer.SendFackPackToServerList(clientPack, serverIDList)
|
| | | |
| | | # 聊天缓存
|
| | | channelType = clientPack.ChannelType
|
| | | content = clientPack.Content
|
| | | bubbleBox = clientPack.BubbleBox
|
| | | PlayerTalk.DoTalkCache(channelType, playerID, content, bubbleBox)
|
| | | return
|
| | |
|
| | | ## -------------------------------------- 游戏服本服处理 --------------------------------------------
|
| | | '''
|
| | | 为方便本服、跨服互通公会逻辑统一,公会相关数据处理统一使用 CrossPlayer,视为以前的GameServer处理,这样本服跨服的公会管理通用
|
| | |
| | | Do_MapServer_FamilyRefresh(curPlayer, doData)
|
| | | return
|
| | |
|
| | | def Do_MapServer_PlayerOnDay(curPlayer):
|
| | | ResetDailyDonateCnt(curPlayer)
|
| | | return
|
| | |
|
| | | def Do_MapServer_PlayerLogin(curPlayer):
|
| | | DBFamily.Sync_FamilyCrossInfo(curPlayer)
|
| | | SyncDonateCntInfo(curPlayer)
|
| | | PlayerFamilyZhenbaoge.OnPlayerLogin(curPlayer)
|
| | | return
|
| | |
|
| | | def Do_MapServer_FamilyRefresh(curPlayer, doData):
|
| | | tick = GameWorld.GetGameWorld().GetTick()
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | refreshFamilyID = doData["FamilyID"]
|
| | | refreshFmLV = doData.get("FmLV", 0)
|
| | | refreshJoinTime = doData.get("JoinTime", 0)
|
| | | refreshFamilyLV = doData.get("FamilyLV", 0)
|
| | | refreshFamilyName = doData.get("FamilyName", "")
|
| | | refreshEmblemID = doData.get("EmblemID", 0)
|
| | | refreshEmblemWord = doData.get("EmblemWord", "")
|
| | | isLogin = doData.get("isLogin", 0) # 是否登录刷新的
|
| | |
|
| | | PlayerViewCache.UpdPlayerViewFamilyInfo(playerID, refreshFamilyID, refreshFamilyName, refreshEmblemID, refreshEmblemWord)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyJoinTime, refreshJoinTime)
|
| | |
|
| | | lastFamilyID = curPlayer.GetFamilyID()
|
| | | lastFamilyLV = curPlayer.GetFamilyLV() # 公会等级,非职位等级
|
| | |
| | |
|
| | | #---通知客户端刷新属性---
|
| | | curPlayer.View_FamilyInfoRefresh() #//04 30 玩家家族名字职位等信息刷新#tagPlayerInFamilyInfoRefresh
|
| | | |
| | | if isLogin:
|
| | | Do_MapServer_PlayerLogin(curPlayer)
|
| | | return
|
| | |
|
| | | def Do_MapServer_PlayerLogin(curPlayer):
|
| | | ## 地图公会玩家的登录逻辑由最新所属公会刷新后处理
|
| | | DBFamily.Sync_FamilyCrossInfo(curPlayer)
|
| | | SyncDonateCntInfo(curPlayer)
|
| | | PlayerFamilyZhenbaoge.OnPlayerLogin(curPlayer)
|
| | | PlayerFamilyTaofa.OnPlayerLogin(curPlayer)
|
| | | return
|
| | |
|
| | | def __OnEnterFamily(curPlayer, tick):
|