hxp
2026-03-06 e4a73fcd808bcf5e22099b73f2bc98e8b6ee84c6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package PyMongoDB.GMToolLogicProcess.Commands.GMT_FamilyDismiss
#
# @todo:GM¹¤¾ßÃüÁî - ½âÉ¢¹«»á
# @author hxp
# @date 2026-02-13
# @version 1.0
#
# ÏêϸÃèÊö: GM¹¤¾ßÃüÁî - ½âÉ¢¹«»á
#
#-------------------------------------------------------------------------------
#"""Version = 2026-02-13 16:30"""
#-------------------------------------------------------------------------------
 
import GMCommon
import GameWorld
import DBDataMgr
 
## ÊÕµ½gmÃüÁîÖ´ÐÐ
# @param gmCmdDict:gmÃüÁî×Öµä
# @return None 
def OnExec(gmCmdDict):
    
    queryType = gmCmdDict.get(GMCommon.Def_GMKey_QueryType, '')      
    familyName = gmCmdDict.get(GMCommon.Def_GMKey_FamilyName, '')
    
    if familyName == '':
        return GMCommon.Def_ParamErr
    
    if GameWorld.IsMainServer():
        crossServerID = DBDataMgr.GetFamilyMgr().GetCurCrossServerID()
        if crossServerID:
            return GMCommon.Def_ParamErr, "¹«»áÒѾ­¿ç·þÁË£¬¿ç·þID=%s" % crossServerID
        
    familyMgr = DBDataMgr.GetFamilyMgr()
    if queryType == "FamilyID":
        familyID = GameWorld.ToIntDef(familyName)
        if not familyID:
            return GMCommon.Def_ParamErr
        curFamily = familyMgr.FindFamily(familyID)
    else:
        curFamily = None
        for zoneID in familyMgr.GetZoneIDListThisServer():
            zoneMgr = familyMgr.GetZoneFamilyMgr(zoneID)
            curFamily = zoneMgr.FindFamilyByName(familyName)
            if curFamily:
                break
            
    if not curFamily:
        GameWorld.DebugLogEx("Ä¿±ê¹¤»á²»´æÔÚ")
        return GMCommon.Def_NoTag, "no tag family"
    
    familyID = curFamily.GetID()
    zoneMgr = familyMgr.GetZoneFamilyMgrByFamilyID(familyID)
    familyMgr.DelFamily(familyID)
    zoneMgr.Sort()
    
    return GMCommon.Def_Success