| #!/usr/bin/python  | 
| # -*- coding: GBK -*-  | 
| #-------------------------------------------------------------------------------  | 
| #  | 
| ##@package Player.RemoteQuery.GY_Query_EnterFBTeamAsk  | 
| #  | 
| # @todo:×é¶Ó½øÈ븱±¾ÇëÇó  | 
| # @author hxp  | 
| # @date 2017-11-09  | 
| # @version 1.0  | 
| #  | 
| # ÏêϸÃèÊö: ¶Ó³¤·¢Æð½øÈ븱±¾ºó£¬ÑéÖ¤¸÷¸ö¶ÓÔ±ÊÇ·ñ¿ÉÒÔ½øÈë¸Ã¸±±¾  | 
| #  | 
| #-------------------------------------------------------------------------------  | 
| #"""Version = 2017-11-09 22:00"""  | 
| #-------------------------------------------------------------------------------  | 
|   | 
| #µ¼Èë  | 
| import FBLogic  | 
| import PlayerControl  | 
| import GameWorld  | 
| import FBCommon  | 
| import ChConfig  | 
| #---------------------------------------------------------------------  | 
|   | 
|   | 
| #---------------------------------------------------------------------  | 
| #Â߼ʵÏÖ  | 
| ## ÇëÇóÂß¼  | 
| #  @param query_Type ÇëÇóÀàÐÍ  | 
| #  @param query_ID ÇëÇóµÄÍæ¼ÒID  | 
| #  @param packCMDList ·¢°üÃüÁî [ ]  | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return "True" or "False" or ""  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def DoLogic(query_Type, query_ID, packCMDList, tick):  | 
|     GameWorld.Log("GY_Query_EnterFBTeamAsk DoLogic() query_Type=%s,query_ID=%s,packCMDList=%s,tick=%s" %   | 
|                   (query_Type, query_ID, packCMDList, tick))  | 
|       | 
|     curFindPlayer = GameWorld.GetPlayerManager().FindPlayerByID(query_ID)  | 
|     if not curFindPlayer or curFindPlayer.IsEmpty():  | 
|         return ""  | 
|       | 
|     if not packCMDList or len(packCMDList) != 5:  | 
|         GameWorld.Log("    DoLogic() return []")  | 
|         return ""  | 
|       | 
|     #teamID, askVer, askType, askMapID, askMapEx  | 
|     askMapID = packCMDList[3]  # Ä¿±êµØÍ¼id  | 
|     askMapEx = packCMDList[4]  # Ä¿±êµØÍ¼Ïß·ÊôÐÔ,´Ó0¿ªÊ¼  | 
|       | 
|     #½øÈ븱±¾Í¨Óüì²é  | 
|     fbIpyData = FBCommon.GetFBIpyData(askMapID)  | 
|     fbLineIpyData = FBCommon.GetFBLineIpyData(askMapID, askMapEx)  | 
|     ret = PlayerControl.CheckMoveToFB(curFindPlayer, askMapID, askMapEx, fbIpyData, fbLineIpyData, tick, False, True)  | 
|     return packCMDList + [query_ID, ret, curFindPlayer.GetName()]  | 
|   | 
|   | 
| #Ö´Ðнá¹û  | 
| ## Ö´Ðнá¹û  | 
| #  @param curPlayer ·¢³öÇëÇóµÄÍæ¼Ò  | 
| #  @param callFunName ¹¦ÄÜÃû³Æ  | 
| #  @param funResult ²éѯµÄ½á¹û  | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def DoResult(curPlayer, callFunName, funResult, tick):  | 
|     resultInfo = eval(funResult)  | 
|     mapID, lineID = resultInfo[:2]  | 
|     averageLV, maxLV, playerCnt = 0, 0, 0  | 
|     if len(resultInfo) == 5:  | 
|         averageLV, maxLV, playerCnt = resultInfo[2:5]  | 
|     GameWorld.Log("GY_Query_EnterFBTeamAsk mapID=%s,lineID=%s,averageLV=%s,maxLV=%s,playerCnt=%s,funResult=%s"   | 
|                   % (mapID, lineID, averageLV, maxLV, playerCnt, str(funResult)), curPlayer.GetPlayerID())  | 
|       | 
|     if maxLV > 0:  | 
|         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_TeamFBAverageLV, averageLV)  | 
|         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_TeamFBMaxLV, maxLV)  | 
|         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_TeamFBPlayerCnt, playerCnt)  | 
|           | 
|     # ÇëÇó½øÈëFBµã  | 
|     ipyEnterPosInfo = FBCommon.GetFBLineEnterPosInfo(mapID, lineID)  | 
|     retPos = FBLogic.OnGetFBEnterPos(curPlayer, mapID, lineID, ipyEnterPosInfo, tick)  | 
|       | 
|     if not retPos:  | 
|         return  | 
|       | 
|     #===============================================================================================  | 
|     # # ÑéÖ¤´«ËÍNPCÌõ¼þÊÇ·ñ·ûºÏ  | 
|     # if not EventShell.DoLogic_EnterFbGameEvent(curPlayer, mapID, tick):  | 
|     #    return  | 
|     #===============================================================================================  | 
|       | 
|     # ´«ËÍÂß¼  | 
|     PlayerControl.PlayerResetWorldPosFB(curPlayer, mapID, retPos[0], retPos[1], False, funcLineID=lineID)  | 
|     return  | 
|   |