hxp
2019-06-22 d0f5f9922f17f5bff4288173f18a9ed827d95db8
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamily.py
@@ -162,6 +162,28 @@
        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
#输入家族名称
#class   IPY_CInputFamilyName
#{
@@ -245,11 +267,13 @@
    
    #-设置家族成员属性
    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:
@@ -259,7 +283,9 @@
        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)
  
@@ -285,12 +311,13 @@
    
    #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
@@ -387,7 +414,6 @@
    GameWorld.DebugLog('    玩家战盟名变更处理, newFamilyName=%s' % familyName, playerID)
    #不处理排行榜
    needChangeFamilyBillboardList = [
                                     #ShareDefine.Def_BT_RechargeTeHui,  # 充值特惠活动排行榜-当前期记录
                                     ]
    billboardMgr = GameWorld.GetBillboard()
    for billboardIndex in needChangeFamilyBillboardList:
@@ -1423,7 +1449,12 @@
    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()  # 被踢玩家职位
@@ -1501,6 +1532,12 @@
    
    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())
@@ -1864,6 +1901,7 @@
#  @remarks 函数详细说明.
def PlayerLoginRefreshFamily(curPlayer, tick):
    SyncFakeFamilyInfo(curPlayer)
    SyncCreatFamilyTimes(curPlayer)
    familyID = curPlayer.GetFamilyID()
    curFamily = None