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
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package Player.RemoteQuery.GY_Query_SetPlayerAttr
#
# @todo:ÉèÖÃÍæ¼ÒÊôÐÔ
# @author hxp
# @date 2018-12-21
# @version 1.0
#
# ÏêϸÃèÊö: ÉèÖÃÍæ¼ÒÊôÐÔ
#
#-------------------------------------------------------------------------------
#"""Version = 2018-12-21 18:00"""
#-------------------------------------------------------------------------------
 
import GameWorld
import PlayerControl
import CrossRealmPlayer
 
## Ö´Ðнá¹û
#  @param curPlayer ·¢³öÇëÇóµÄÍæ¼Ò
#  @param callFunName ¹¦ÄÜÃû³Æ
#  @param funResult ²éѯµÄ½á¹û
#  @param tick µ±Ç°Ê±¼ä
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def DoResult(curPlayer, callFunName, funResult, tick):
    if not funResult:
        return
    setInfo = eval(funResult)
    if not isinstance(setInfo, list) or len(setInfo) < 2:
        return
    
    attrName, value = setInfo[:2]
    if hasattr(curPlayer, attrName):
        # ÒªÔÚ¸üÐÂֵ֮ǰ´¦Àí
        if attrName == "SetExAttr5" and not GameWorld.IsCrossServer():
            if value:
                CrossRealmPlayer.DoEnterCrossRealm(curPlayer)
            elif PlayerControl.GetCrossMapID(curPlayer):
                CrossRealmPlayer.DoExitCrossRealm(curPlayer)
                
        callObj = getattr(curPlayer, attrName)
        callObj(value)
        GameWorld.Log("SetPlayerAttr curPlayer.%s, value=%s" % (attrName, value), curPlayer.GetPlayerID())
        
    elif hasattr(PlayerControl, attrName):
        callObj = getattr(PlayerControl, attrName)
        callObj(curPlayer, value)
        GameWorld.Log("SetPlayerAttr PlayerControl.%s, value=%s" % (attrName, value), curPlayer.GetPlayerID())
        
    return