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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/usr/bin/python
# -*- coding: GBK -*-
 
##@package GY_Query_MoveToPlayerByID
# ´«Ë͵½Íæ¼ÒÉí±ß
#
# @author mark
# @date 2010-3-31
# @version 1.1
#
# ÐÞ¸Äʱ¼ä ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ
# @change: "2014-01-07 15:30" hxp ÏµÍ³markÐÞ¸Ä
#
# VER = "2014-01-07 15:30" zhengyang Ìí¼Ó×¢ÊÍ
#
# Ä£¿éÏêϸ˵Ã÷
#---------------------------------------------------------------------
#µ¼Èë
import GameWorld
import IPY_GameWorld
import PlayerControl
import EventShell
#---------------------------------------------------------------------
#È«¾Ö±äÁ¿
#---------------------------------------------------------------------
 
#---------------------------------------------------------------------
#Âß¼­ÊµÏÖ
## ÇëÇóÂß¼­
#  @param query_Type ÇëÇóÀàÐÍ
#  @param query_ID ÇëÇóµÄÍæ¼ÒID
#  @param packCMDList ·¢°üÃüÁî [ ]
#  @param tick µ±Ç°Ê±¼ä
#  @return [mapID,posX,posY,lineID]
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def DoLogic(query_Type , query_ID , packCMDList , tick):
    curFindPlayer = GameWorld.GetPlayerManager().FindPlayerByID(query_ID)
    
    if not curFindPlayer or curFindPlayer.IsEmpty():
        return ''
    
    mapManager = GameWorld.GetMap()
    
    if mapManager.GetMapFBType() != IPY_GameWorld.fbtNull:
        return 'InFB'
    
    return ['%d'%mapManager.GetMapID() , '%d'%curFindPlayer.GetPosX() , '%d'%curFindPlayer.GetPosY() , '%d'%GameWorld.GetGameWorld().GetLineID()]
#---------------------------------------------------------------------
#Ö´Ðнá¹û
## Ö´Ðнá¹û
#  @param curPlayer ·¢³öÇëÇóµÄÍæ¼Ò
#  @param callFunName ¹¦ÄÜÃû³Æ
#  @param funResult [mapID,posX,posY,lineID]
#  @param tick µ±Ç°Ê±¼ä
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def DoResult(curPlayer , callFunName , funResult , tick):
    if funResult == '':
        #GeRen_chenxin_112395 ¶Ô²»Æð£¬Ä¿±êÍæ¼Ò²»ÔÚÏߣ¬GMÖ¸Áî²Ù×÷ʧ°Ü
        PlayerControl.NotifyCode(curPlayer,"GeRen_chenxin_112395")
        return
    
    if funResult == 'InFB':
        #GM_Operate_Null02 ¶Ô²»Æð£¬Ä¿±êÍæ¼ÒÔÚ¸±±¾µ±ÖУ¬GMÖ¸Áî²Ù×÷ʧ°Ü
        PlayerControl.NotifyCode(curPlayer,"GM_Operate_Null02")
        return
    
    #»¹Ô­¸ñʽ '[]' -> []
    funResult = eval(funResult)
    mapID = int(funResult[0])
    posX = int(funResult[1])
    posY = int(funResult[2])
    lineID = int(funResult[3])
    
    __DoLogic_ResetWorldPos(curPlayer)
    
    PlayerControl.PlayerResetWorldPosFB( curPlayer, mapID, posX, posY, False, lineID )
    
    #GeRen_chenxin_673416 GMÖ¸ÁîÒÑÉúЧ£¬²Ù×÷³É¹¦
    PlayerControl.NotifyCode(curPlayer,"GeRen_chenxin_673416")
    return
#---------------------------------------------------------------------
## ÖØÖÃÍæ¼Ò×ø±ê£¬½â³ýʼþ״̬
#  @param curPlayer µ±Ç°Íæ¼Ò
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def __DoLogic_ResetWorldPos(curPlayer):
    playerAction = curPlayer.GetPlayerAction()
    #ʼþ״̬,½áÊøÊ¼þ
    if playerAction == IPY_GameWorld.paEvent:
        EventShell.DoExitEvent(curPlayer)
        
    return