hch
2024-10-08 9e53b08d7312c5ad7e272cfc8135c242aac09034
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 PlayerMirror
# ´´½¨Íæ¼Ò¾µÏñ, ¿¼ÂǵØÍ¼ÈËÂúÎÊÌ⣬py¿ÉÒÔ×ö¸öÔ¤ÅУ¬¿Éµ÷ÕûµØÍ¼ÅäÖõÄÈËÊýÉÏÏÞ
 
 
import GameWorld
import PlayerEventCounter
import ChPlayer
import GameServerRefresh
import ChConfig
 
## GMÃüÁîÖ´ÐÐÈë¿Ú
#  @param curPlayer µ±Ç°Íæ¼Ò
#  @param playerList ²ÎÊýÁбí [Íæ¼ÒID]
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def OnExec(curPlayer, playerList):
    playerID = 0
    if len(playerList) != 0:
        playerID = playerList[0]
    
    if playerID != 0:
        #ÏòGameServerÇëÇóÆäËûÍæ¼ÒÊý¾Ý
        #¿ªÊ¼²éѯ
        curPlayer.GameServer_QueryPlayerByID(ChConfig.queryType_MirrorPlayer, playerID, 'PlayerMirror', '', 0)
        return
 
    playerData = curPlayer.GetPackData()
    # playerDataΪbase64ºóµÄÊý¾Ý
    mirrorPlayer = GameWorld.GetGameWorld().CreateMirrorPlayer(playerData, curPlayer.GetPosX(), curPlayer.GetPosY())
    
    #ÊÇ·ñ¾µÏñÍæ¼Ò ÅжϠmirrorPlayer.GetRealPlayerID()ÊÇ·ñΪ0
    if mirrorPlayer:
        GameWorld.Log("mirrorPlayer.GetRealPlayerID %s"%mirrorPlayer.GetRealPlayerID())
        index = mirrorPlayer.GetIndex()
        tick = GameWorld.GetGameWorld().GetTick()
        ChPlayer.PlayerLogin(index, tick)
        PlayerEventCounter.GameServer_InitOK(index, tick)
        ChPlayer.LoadMapOK(index, tick)
        GameServerRefresh.GameSever_PlayerInitOK(index, tick)