#!/usr/bin/python # -*- coding: GBK -*- #------------------------------------------------------------------------------- # ##@package Script.GM.GMTExec.Test # # @todo:²âÊÔÃüÁîÎļþÔËÐÐ # @author hxp # @date 2021-05-19 # @version 1.0 # # ÏêϸÃèÊö: ²âÊÔÃüÁîÎļþÔËÐÐ # #------------------------------------------------------------------------------- #"""Version = 2021-05-19 11:00""" #------------------------------------------------------------------------------- def runMyTest(exec_locals): ''' ÔËÐÐÃüÁÊý @param exec_locals: GMT_Execfile Ä£¿éÖÐµÄ DoLogic º¯Êý locals() import ÆäËûÄ£¿éÐèҪдÔڴ˺¯ÊýÀ²»È»ÎÞ·¨ÒýÓõ½ ''' import GameWorld orderId = exec_locals["orderId"] cmdInfo = exec_locals["cmdInfo"] resultDict = exec_locals["resultDict"] # ½¨Òé¶¼½øÐиüнá¹û×Öµä¼Ç¼Ïêϸ´¦ÀíÐÅÏ¢£¬GMT_Execfile Ä£¿é»áͳһдÈëÁ÷Ïò # ÒÔÏÂΪÏêϸ´¦ÀíÂß¼­ GameWorld.Log("This is GameServer GMT_Execfile run %s. orderId=%s" % (cmdInfo, orderId)) activePlayerIDList = [] playerManager = GameWorld.GetPlayerManager() activePlayerCount = playerManager.GetActivePlayerCount() for index in xrange(activePlayerCount): player = playerManager.GetActivePlayerAt(index) if player == None or not player.GetInitOK(): continue activePlayerIDList.append(player.GetPlayerID()) resultDict.update({"activePlayerIDList":activePlayerIDList}) return exec_locals = locals() if exec_locals.get("cmdInfo"): runMyTest(exec_locals)