xdh
2018-12-04 9ba17f30e36a856861f1774567f6bd2a5114b9f0
4860 【后端】【1.3.100】新增退出仙盟,需要12小时才能再退出仙盟
3个文件已修改
26 ■■■■ 已修改文件
ServerPython/CoreServerGroup/GameServer/Script/DataRecordPack.py 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerControl.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamily.py 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/DataRecordPack.py
@@ -318,13 +318,13 @@
#  @param tagFamilyLV: 被踢者职位
#  @return:  
def DR_PlayerLeaveFamily(curPlayer, familyID, familyName, familyCnt, familyLV, 
                         tagPlayerID, tagPlayerName, tagFamilyLV):
                         tagPlayerID, tagPlayerName, tagFamilyLV, leaveFamilyTime=0):
    dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'AccID':curPlayer.GetAccID(), 
                "PlayerName":curPlayer.GetName(), 
                "FamilyID":familyID, "FamilyName":familyName, "Count":familyCnt, "FamilyJob":familyLV, 
                "tagPlayerID":tagPlayerID, "tagPlayerName":tagPlayerName, "tagFamilyJob":tagFamilyLV}
    if leaveFamilyTime:
        dataDict['leaveFamilyTime'] = leaveFamilyTime
    #发送封包
    SendEventPack("PlayerLeaveFamily", dataDict, curPlayer)
    return
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerControl.py
@@ -219,6 +219,10 @@
def GetTodayXianyuanCoin(curPlayer): return curPlayer.GetExAttr11()
def SetTodayXianyuanCoin(curPlayer, value): return curPlayer.SetExAttr11(value)
##玩家主动退出仙盟时间(<100代表退出次数)
def SetLeaveFamilyTime(curPlayer, value): return curPlayer.SetExAttr12(value)
def GetLeaveFamilyTime(curPlayer):return curPlayer.GetExAttr12()
## 是否脱机挂机状态
def GetIsTJG(curPlayer):
    if curPlayer.GetDictByKey(ChConfig.Def_OnlineType):
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamily.py
@@ -1492,6 +1492,20 @@
    if GameWorld.GetGameWorld().GetDictByKey(ShareDefine.Def_Notify_WorldKey_DailyActionState % ShareDefine.DailyActionID_FamilyRobBoss):        
        PlayerControl.NotifyCode(curPlayer, "FairyGrabBossExitError")
        return
    #判断退出时间间隔
    curTime = int(time.time())
    lastLeaveFamilyTime = PlayerControl.GetLeaveFamilyTime(curPlayer)
    if lastLeaveFamilyTime > 100:
        remainTime = IpyGameDataPY.GetFuncCfg('ExitFairyTime', 2) - (curTime - lastLeaveFamilyTime)
        if remainTime > 0:
            PlayerControl.NotifyCode(curPlayer, "ExitFairyTime", [remainTime*1000])
            return
        updTime = 1 if IpyGameDataPY.GetFuncCfg('ExitFairyTime') > 1 else curTime
    elif lastLeaveFamilyTime >= IpyGameDataPY.GetFuncCfg('ExitFairyTime')-1:
        updTime = curTime
    else:
        updTime = lastLeaveFamilyTime+1
    PlayerControl.SetLeaveFamilyTime(curPlayer, updTime)
    
    #XW_JZ_LeaveFamily   <n color="0,190,255">{%S1%}</n><n color="255,255,0">退出了家族!</n>  25  -   -
    NotifyAllFamilyMemberMsg(curFamily, curPlayer, "XW_JZ_LeaveFamily", [curPlayer.GetName()])
@@ -1507,7 +1521,7 @@
    __DoPlayerLeaveFamilyByID(curFamily, curPlayerID)
    DataRecordPack.DR_PlayerLeaveFamily(curPlayer, curFamily.GetID(), curFamily.GetName(), curFamily.GetCount(),
                                        familyLV, curPlayer.GetPlayerID(), curPlayer.GetName(), familyLV)
                                        familyLV, curPlayer.GetPlayerID(), curPlayer.GetName(), familyLV, updTime)
    
    if curFamily.GetCount() == 0:
        #玩家离开后, 家族没有人了 , 删除这个家族