hch
2024-10-08 6e3624c6941feeb17ddf65355867df95070ec3a5
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
#!/usr/bin/python
# -*- coding: GBK -*-
#---------------------------------------------------------------------
#
#---------------------------------------------------------------------
##@package GY_Query_PlayerMirror
 
import GameWorld
import PlayerEventCounter
import ChPlayer
import GameServerRefresh
#---------------------------------------------------------------------
 
#  @param query_Type ÇëÇóÀàÐÍ
#  @param query_ID ÇëÇóµÄÍæ¼ÒID
#  @param packCMDList ·¢°üÃüÁî
#  @param tick µ±Ç°Ê±¼ä
#  @return "True" or "False" or ""
def DoLogic(query_Type, query_ID, packCMDList, tick):
    curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(query_ID)
    
    if not curPlayer or curPlayer.IsEmpty():
        return ''
    playerData = packCMDList['playerData']
    # playerDataΪbase64ºóµÄÊý¾Ý
    mirrorPlayer = GameWorld.GetGameWorld().CreateMirrorPlayer(playerData, curPlayer.GetPosX(), curPlayer.GetPosY())
    
 
    #CreateMirrorPlayer Öлáµ÷Óõ½ ChPlayer.PlayerLogin
    #ÊÇ·ñ¾µÏñÍæ¼Ò ÅжϠmirrorPlayer.GetRealPlayerID()ÊÇ·ñΪ0
    #python×Ô¼º´¦Àí£¬ÒÔÏÂÂß¼­£¬¿ÉÒÔÔÚDoPlayerLoginº¯Êý×îºó ÅжÏÊǾµÏñÍæ¼Òºóͳһ´¦Àí
 
    index = mirrorPlayer.GetIndex()
    tick = GameWorld.GetGameWorld().GetTick()
    PlayerEventCounter.GameServer_InitOK(index, tick)
    ChPlayer.LoadMapOK(index, tick)
    GameServerRefresh.GameSever_PlayerInitOK(index, tick)
    return ''