| | |
| | | import PlayerFamilySWRH
|
| | | import PlayerViewCache
|
| | | import GameWorldBoss
|
| | | import AuctionHouse
|
| | | import PlayerTalk
|
| | | import PlayerTeam
|
| | |
|
| | |
| | | def GetCurWeekMissionMoney(curFamily): return curFamily.GetExtra2()
|
| | | def SetCurWeekMissionMoney(curFamily, value): return curFamily.SetExtra2(min(value, ChConfig.Def_UpperLimit_DWord))
|
| | |
|
| | | # 仙盟上次处理的合服天
|
| | | def GetFamilyMixServerDay(curFamily): return curFamily.GetExtra1()
|
| | | def SetFamilyMixServerDay(curFamily, value): return curFamily.SetExtra1(value)
|
| | | ## ------------------ 成员 ----------------------
|
| | | def GetMemberFightPower(curMember): return curMember.GetExattr3()
|
| | | def SetMemberFightPower(curMember, fightPower): return curMember.SetExattr3(fightPower)
|
| | |
| | | if PlayerControl.GetIsTJG(curPlayer):
|
| | | return
|
| | | NetPackCommon.SendFakePack(curPlayer, fakeFamilyPack)
|
| | | return
|
| | |
|
| | | def SyncCreatFamilyTimes(curPlayer=None):
|
| | | # 通知建盟次数
|
| | | packData = ChPyNetSendPack.tagGCServerCreatFamilyTimes()
|
| | | packData.Clear()
|
| | | packData.Times = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerCreatFamilyTimes)
|
| | | if not curPlayer:
|
| | | # 全服广播在线玩家
|
| | | playerManager = GameWorld.GetPlayerManager()
|
| | | for i in range(0, playerManager.GetPlayerCount()):
|
| | | curPlayer = playerManager.GetPlayerByIndex(i)
|
| | | if curPlayer == None or not curPlayer.GetInitOK():
|
| | | continue
|
| | | |
| | | if PlayerControl.GetIsTJG(curPlayer):
|
| | | continue
|
| | | NetPackCommon.SendFakePack(curPlayer, packData)
|
| | | else:
|
| | | if PlayerControl.GetIsTJG(curPlayer):
|
| | | return
|
| | | NetPackCommon.SendFakePack(curPlayer, packData)
|
| | | return
|
| | |
|
| | | #输入家族名称
|
| | |
| | | curFamily.SetAcceptJoin(ShareDefine.FamilyAcceptJoin_Agree) #设置收人方式为直接通过申请
|
| | | PyDataManager.GetFamilyStoreItemManager().DelFamilyStoreItemAll(curFamily.GetID())
|
| | |
|
| | | #新创建的仙盟默认设置已处理过合服
|
| | | SetFamilyMixServerDay(curFamily, PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_LastMixServerDay))
|
| | | |
| | | #-设置家族成员属性
|
| | | DoPlayerJionFamily(curFamily, curPlayer, IPY_GameServer.fmlLeader)
|
| | | |
| | | creatFamilyTimes = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerCreatFamilyTimes)
|
| | | #扣道具(前N个战盟并且假编号在随机编号里不要钱)
|
| | | if fakeIndex and fakeIndex in fakeIndexList:
|
| | | PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_FakeFamilyIndex % fakeIndexList.index(fakeIndex), 0)
|
| | | GameWorld.DebugLog(' 创建前3个仙盟不扣钱! 假仙盟索引%s'%fakeIndexList.index(fakeIndex))
|
| | | GameWorld.Log(' 创建前n个假仙盟不扣钱! 假仙盟索引%s'%fakeIndexList.index(fakeIndex))
|
| | | elif creatFamilyTimes < IpyGameDataPY.GetFuncCfg('CreateFamilyNeedMoney', 3):
|
| | | GameWorld.Log(' 创建前n个仙盟不扣钱! creatFamilyTimes=%s' % creatFamilyTimes)
|
| | | else:
|
| | | for i, findex in enumerate(fakeIndexList):
|
| | | if findex:
|
| | |
| | | needMoney = IpyGameDataPY.GetFuncCfg('CreateFamilyNeedMoney')
|
| | | if needMoney:
|
| | | moneyType = IpyGameDataPY.GetFuncCfg('CreateFamilyNeedMoney', 2)
|
| | | curPlayer.MapServer_PayMoney(moneyType, needMoney)
|
| | | sendMsg = str([moneyType, needMoney])
|
| | | curPlayer.MapServer_QueryPlayerResult(0, 0, "CreateFamilyPayMoney", sendMsg, len(sendMsg))
|
| | | #curPlayer.MapServer_PayMoney(moneyType, needMoney)
|
| | | #玩家创建家族费用转化为家族初始资金
|
| | | #PlayerAddFamilyMoney(curPlayer, curFamily, needMoney)
|
| | |
|
| | |
| | |
|
| | | #XW_JZ_EstablishSud <n color="255,255,0">恭喜您,家族建立成功!</n> 25 - -
|
| | | PlayerControl.NotifyCode(curPlayer, "XW_JZ_EstablishSud")
|
| | | |
| | | PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerCreatFamilyTimes, min(creatFamilyTimes + 1, ShareDefine.Def_UpperLimit_DWord))
|
| | | SyncCreatFamilyTimes()
|
| | | #帮会创建流向
|
| | | DataRecordPack.DR_CreateFamily(curPlayer.GetAccID(), curPlayerID, curPlayer.GetName(),
|
| | | fullFamilyName, curFamily.GetID())
|
| | | fullFamilyName, curFamily.GetID(), creatFamilyTimes+1)
|
| | |
|
| | | GameWorld.Log('创建家族 : %s(%s), fakeIndex=%s' % (fullFamilyName, curFamily.GetID(), fakeIndex), curPlayerID)
|
| | | GameWorld.Log('创建家族 : %s(%s), fakeIndex=%s, creatFamilyTimes=%s' % (fullFamilyName, curFamily.GetID(), fakeIndex, creatFamilyTimes+1), curPlayerID)
|
| | | PlayerControl.WorldNotify(0, "jiazu_liubo_671654", [curPlayer.GetName(), fullFamilyName, curFamily.GetID()])
|
| | | return
|
| | |
|
| | |
| | | PlayerFamilyBoss.NotifyFamilyBossFBInfo(jionPlayer)
|
| | | #通知家族仓库
|
| | | PyDataManager.GetFamilyStoreItemManager().SyncFamilyStoreItem(jionPlayer, curFamily.GetID())
|
| | | |
| | | #仙盟拍品
|
| | | AuctionHouse.Sync_FamilyAuctionItemInfo(jionPlayer, curFamily.GetID())
|
| | | SetMemberFightPower(familyMember, jionPlayer.GetFightPower())
|
| | | AddFamilyIDToFightPowerChangeList(curFamily.GetID())
|
| | |
|
| | |
| | | GameWorld.DebugLog(' 玩家战盟名变更处理, newFamilyName=%s' % familyName, playerID)
|
| | | #不处理排行榜
|
| | | needChangeFamilyBillboardList = [
|
| | | #ShareDefine.Def_BT_MixCampaign_Recharge, # 累计充值(合服活动)
|
| | | #ShareDefine.Def_BT_RechargeTeHui, # 充值特惠活动排行榜-当前期记录
|
| | | ]
|
| | | billboardMgr = GameWorld.GetBillboard()
|
| | | for billboardIndex in needChangeFamilyBillboardList:
|
| | |
| | | if GameWorld.GetGameWorld().GetDictByKey(ShareDefine.Def_Notify_WorldKey_DailyActionState % ShareDefine.DailyActionID_FamilyRobBoss):
|
| | | PlayerControl.NotifyCode(curPlayer, "FairyGrabBossExitError")
|
| | | return
|
| | | |
| | | if PlayerFamilyBoss.IsInAllFamilyBoss():
|
| | | PlayerControl.NotifyCode(curPlayer, "LeagueBOSSExitError1")
|
| | | return
|
| | | if AuctionHouse.IsFamilyMemberBiddingAuctionItem(curFamily.GetID(), tagMemberID):
|
| | | PlayerControl.NotifyCode(curPlayer, "Paimai7")
|
| | | return
|
| | | tagPlayerName = curTagMember.GetName() # 被踢玩家名
|
| | | tagPlayerID = curTagMember.GetPlayerID() # 被踢玩家ID
|
| | | tagFamilyLV = curTagMember.GetFamilyLV() # 被踢玩家职位
|
| | |
| | |
|
| | | if GameWorld.GetGameWorld().GetDictByKey(ShareDefine.Def_Notify_WorldKey_DailyActionState % ShareDefine.DailyActionID_FamilyRobBoss):
|
| | | PlayerControl.NotifyCode(curPlayer, "FairyGrabBossExitError")
|
| | | return
|
| | | if PlayerFamilyBoss.IsInAllFamilyBoss():
|
| | | PlayerControl.NotifyCode(curPlayer, "LeagueBOSSExitError1")
|
| | | return
|
| | | if AuctionHouse.IsFamilyMemberBiddingAuctionItem(curFamily.GetID(), curMember.GetPlayerID()):
|
| | | PlayerControl.NotifyCode(curPlayer, "Paimai8")
|
| | | return
|
| | | #判断退出时间间隔
|
| | | curTime = int(time.time())
|
| | |
| | | # @remarks 函数详细说明.
|
| | | def PlayerLoginRefreshFamily(curPlayer, tick):
|
| | | SyncFakeFamilyInfo(curPlayer)
|
| | | SyncCreatFamilyTimes(curPlayer)
|
| | | familyID = curPlayer.GetFamilyID()
|
| | | curFamily = None
|
| | |
|
| | |
| | | PlayerRefresh(curPlayer, tick)
|
| | |
|
| | | GameWorldFamilyWar.OnPlayerLogin(curFamily, curPlayer)
|
| | | |
| | | # 盟主上线处理
|
| | | if curMember.GetFamilyLV() == IPY_GameServer.fmlLeader:
|
| | | OnFamilyLeaderLogin(curPlayer, curFamily)
|
| | | return
|
| | |
|
| | | def OnFamilyLeaderLogin(curPlayer, curFamily):
|
| | | ## 盟主登录处理
|
| | | __DoFamilyMixServerLogicOnLeaderLogin(curPlayer, curFamily)
|
| | | return
|
| | |
|
| | | def __DoFamilyMixServerLogicOnLeaderLogin(curPlayer, curFamily):
|
| | | ## 合服仙盟盟主登录处理
|
| | | |
| | | isMixServer = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_IsMixServer)
|
| | | if not isMixServer:
|
| | | return
|
| | | lastMixServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_LastMixServerDay)
|
| | | familyID = curFamily.GetID()
|
| | | familyMixServerDay = GetFamilyMixServerDay(curFamily)
|
| | | if familyMixServerDay == lastMixServerDay:
|
| | | GameWorld.DebugLog("已经处理过仙盟盟主合服登录逻辑! lastMixServerDay=%s" % (lastMixServerDay), familyID)
|
| | | return
|
| | | SetFamilyMixServerDay(curFamily, lastMixServerDay)
|
| | | GameWorld.Log("处理合服仙盟盟主登录! lastMixServerDay=%s" % (lastMixServerDay), familyID)
|
| | | |
| | | mailItemList = IpyGameDataPY.GetFuncEvalCfg("MixServerMail", 4)
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | detailDict = {}
|
| | | GameWorld.Log(" 发送合服盟主专属补偿邮件! familyID=%s,mailItemList=%s" % (familyID, mailItemList), playerID)
|
| | | PlayerCompensation.SendMailByKey("MixServer2", [playerID], mailItemList, detail=detailDict)
|
| | | return
|
| | | #---------------------------------------------------------------------
|
| | | ## 玩家下线家族刷新逻辑
|
| | |
| | | #上面已经验证过了,家族肯定存在的
|
| | | curFamily = curPlayer.GetFamily()
|
| | | curFamilyID = curFamily.GetID()
|
| | | curPlayerID = curPlayer.GetID()
|
| | | # curFamilyTrig = PlayerDBGSEvent.FindDBGSTrig_ByEventID(curFamilyID , PlayerDBGSEvent.Def_Key_RenameFamily)
|
| | | #
|
| | | # if not curFamilyTrig:
|
| | |
| | | curMemberID = curMember.GetPlayerID()
|
| | | __OnFamilyNameChange(curMemberID, familyName)
|
| | | memberIDList.append(curMemberID)
|
| | | curPlayer = playerManager.FindPlayerByID(curMemberID)
|
| | | player = playerManager.FindPlayerByID(curMemberID)
|
| | | #玩家不在线
|
| | | if not curPlayer:
|
| | | if not player:
|
| | | continue
|
| | |
|
| | | curPlayerMapID = GameWorld.GetQueryPlayerMapID(curPlayer)
|
| | | curPlayerMapID = GameWorld.GetQueryPlayerMapID(player)
|
| | |
|
| | | if not curPlayerMapID:
|
| | | continue
|
| | |
|
| | | msgStr = str([curPlayer.GetPlayerID(), familyName])
|
| | | msgStr = str([curPlayerID, familyName])
|
| | | playerManager.MapServer_QueryPlayer(0, 0, curMemberID, curPlayerMapID, 'FamilyNameRefresh',
|
| | | msgStr, len(msgStr),
|
| | | curPlayer.GetRouteServerIndex())
|
| | | player.GetRouteServerIndex())
|
| | |
|
| | | PlayerCompensation.SendMailByKey('FamilyNameChange', memberIDList, [], [oldName, familyName])
|
| | | PlayerControl.WorldNotify(0, 'Family_ChangeName', [oldName, familyName])
|