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
62
63
64
65
66
67
68
69
70
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package GM.Commands.GMT_FamilyTransfer
#
# @todo:°ïÖ÷תÈÃ
# @author hxp
# @date 2016-09-07
# @version 1.0
#
# ÏêϸÃèÊö: °ïÖ÷תÈÃ
#
#-------------------------------------------------------------------------------
#"""Version = 2016-09-07 03:00"""
#-------------------------------------------------------------------------------
 
import GMCommon
import GameWorld
import PlayerFamily
import IPY_GameServer
 
## Ö´ÐÐÂß¼­
#  @param curPlayer µ±Ç°Íæ¼Ò
#  @param gmList [cmdIndex gmAccID forbidAcc]
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def OnExec(orderId, gmCmdDict):
    queryType = gmCmdDict.get(GMCommon.Def_GMKey_QueryType, '')      
    familyName = gmCmdDict.get(GMCommon.Def_GMKey_FamilyName, '')
    
    if familyName == '':
        GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_ParamErr)
        return
    
    if queryType == "FamilyID":
        familyID = GameWorld.ToIntDef(familyName)
        if not familyID:
            GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_ParamErr)
            return
        
        curFamily = GameWorld.GetFamilyManager().FindFamily(familyID)
    else:
        curFamily = GameWorld.GetFamilyManager().FindFamilyByName(familyName)
        
    if not curFamily:
        GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_NoTag)
        return
    
    tagPlayer = None
    queryTagType = gmCmdDict.get("queryTagType", '')  
    queryTag = gmCmdDict.get("queryTag", '')
    if queryTagType == "PlayerName":
        tagPlayer = GameWorld.GetPlayerManager().FindPlayerByName(queryTag)
    else:
        tagPlayer = GameWorld.GetPlayerManager().FindPlayerByID(GameWorld.ToIntDef(queryTag))
        
    if not tagPlayer:
        GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_NoTag)
        return
    
    isOK = PlayerFamily.DoChangeFamilyMemberLV(curFamily, tagPlayer, tagPlayer.GetPlayerID(), IPY_GameServer.fmlLeader, True)
    if not isOK:
        GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_Unknow)
        return
    
    #Ö´Ðгɹ¦
    GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_Success, int(isOK))        
    return