#!/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)
|