xdh
2019-06-10 4dcb18d0e7848effd25e0d5970e9c84808da957c
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamily.py
@@ -162,6 +162,28 @@
        NetPackCommon.SendFakePack(curPlayer, fakeFamilyPack)
    return
def SyncCreatFamilyTimes(curPlayer=None):
    # 通知建盟次数
    packData = ChPyNetSendPack.tagGCFakeFamilyInfo()
    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
@@ -1874,6 +1901,7 @@
#  @remarks 函数详细说明.
def PlayerLoginRefreshFamily(curPlayer, tick):
    SyncFakeFamilyInfo(curPlayer)
    SyncCreatFamilyTimes(curPlayer)
    familyID = curPlayer.GetFamilyID()
    curFamily = None