hch
2018-12-27 304b381ffa86f534e5335b48a156176a06e2f20e
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
95
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package Player.RemoteQuery.GY_Query_CrossRealmReg
#
# @todo:¿ç·þ»î¶¯Íæ¼Ò×¢²á
# @author hxp
# @date 2018-12-21
# @version 1.0
#
# ÏêϸÃèÊö: ¿ç·þ»î¶¯Íæ¼Ò×¢²á
#
#-------------------------------------------------------------------------------
#"""Version = 2018-12-21 18:00"""
#-------------------------------------------------------------------------------
 
import GameWorld
import PlayerControl
import CrossRealmPlayer
import IPY_GameWorld
import ChPlayer
 
 
#------------------------------------------------------------------------------ 
## ¿ç·þÈü±¨Ãûµ÷ÓýӿÚ
#  @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): 
    return
 
 
#------------------------------------------------------------------------------ 
## Ö´Ðнá¹û
#  @param curPlayer ·¢³öÇëÇóµÄÍæ¼Ò
#  @param callFunName ¹¦ÄÜÃû³Æ
#  @param funResult ²éѯµÄ½á¹û
#  @param tick µ±Ç°Ê±¼ä
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def DoResult(curPlayer, callFunName, funResult, tick):
    resultInfo = eval(funResult)
    actionType = resultInfo[0]
    mapPosInfo = resultInfo[1:]
    if not curPlayer:
        return
    
    playerID = curPlayer.GetPlayerID()
    GameWorld.Log("GY_Query_CrossRealmReg DoResult %s" % funResult, playerID)
 
    if GameWorld.IsCrossServer():
        GameWorld.Log("    ¿ç·þ·þÎñÆ÷²»ÔÊÐíÉÏ´«±¨ÃûÊý¾Ý!", playerID)
        return
    
    if not mapPosInfo:
        return
    
    #¿ç·þǰ¸üÐÂ×Ô¼ºËùÊô·þÎñÆ÷×éID
    PlayerControl.UpdPlayerServerGroupID(curPlayer)
    
    mapID, dataMapID, copyMapID, posX, posY = mapPosInfo
    #curPlayer.SendMergeRegisterPlayer(mapID, dataMapID, copyMapID, posX, posY)
    curPlayer.SendMergeRegisterPlayerAfterChange(CrossRealmPlayer.GetCrossPlayerName(curPlayer), mapID, dataMapID, copyMapID, posX, posY)
    GameWorld.Log("    ·¢ËÍ¿ç·þÍæ¼ÒÊý¾Ý×¢²á: actionType=%s,mapID=%s,dataMapID=%s,copyMapID=%s,posX=%s,posY=%s,GetVsRoomId=%s" 
                  % (actionType, mapID, dataMapID, copyMapID, posX, posY, curPlayer.GetVsRoomId()), playerID)
    return
 
## ¿ç·þÈü±¨Ãû½á¹û£¨ÉÏ´«Êý¾Ý£©
#  @param index Íæ¼ÒË÷Òý
#  @param tick µ±Ç°Ê±¼ä
#  @return None
def GameServer_MergeRegisterResult(index, tick):
    registerResult = IPY_GameWorld.IPY_GMMergeRegisterPlayerResult()
    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
    playerID = curPlayer.GetPlayerID()
    result = registerResult.GetResult()
    if not result:
        errorMsg = registerResult.GetErrorMsg()
        GameWorld.Log("CrossRealmReg result Error:%s" % errorMsg, playerID)
        return
    
    #newAccount = registerResult.GetAccount()
    #newName = registerResult.GetPwd()
    
    msgList = str([]) 
    GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(curPlayer.GetID(), 0, 0, "CrossRealmReg", msgList, len(msgList))    
    GameWorld.Log("GameServer_MergeRegisterResult msgList=%s" % msgList, playerID)
    return