#!/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