Ejemplo n.º 1
0
    def __init__(self):
        self._conf = config.SimpleConfig()

        self._mtx_hosts = threading.Lock()
        self._game_hosts = []

        self._gamelist = []
Ejemplo n.º 2
0
    def terminateGame(self, game, current=None):
        r = {'succ': 'true'}
        try:
            #file = "%s/RobotSetting.xml"%game
            #xmldoc = minidom.parse(file)
            #root = xmldoc.documentElement
            #node = root.getElementsByTagName('GameProcess')
            #n =root.getElementsByTagName('RobotPath')
            #path = root.getElementsByTagName('RobotPath').nodeName #nodeName,nodeType

            conf = config.SimpleConfig()
            if not conf.open("%s/RobotSetting.conf" % game):
                r['succ'] = 'false'
                r['errmsg'] = 'game config lost!'
                return r
            s = conf.getPropertyValue('GameProcess')
            processes = s.split(',')
            for p in processes:
                pid = self.getProcessIdByName(p)
                if pid != -1:
                    print "Kill Process:(%s)%s" % (pid, p)
                    self.killProcess(pid)
        except:
            print traceback.print_exc()
            r['succ'] = 'false'
        return r
Ejemplo n.º 3
0
 def launchGame(self, game, current=None):
     r = {'succ': 'true'}
     #self.terminateGame(game)	#停止游戏运行
     try:
         #file = "%s/RobotSetting.xml"%game
         #xmldoc = minidom.parse(file)
         #root = xmldoc.documentElement
         #path = "%s/%s"%(game,root.getElementsByTagName('RobotPath').nodeName.strip()) # nodeName,nodeType
         conf = config.SimpleConfig()
         if not conf.open("%s/RobotSetting.conf" % game):
             r['succ'] = 'false'
             r['errmsg'] = 'game config lost!'
             return r
         s = conf.getPropertyValue('RobotPath')
         path = "%s/%s" % (game, s)
         print 'Execute file:', path
         win32process.CreateProcess(path, '', None, None, 0,
                                    win32process.CREATE_NO_WINDOW, None,
                                    None, win32process.STARTUPINFO())
     except:
         #print traceback.print_exc()
         r['succ'] = 'false'
         #r['errmsg'] = traceback.print_exc()
     return r
Ejemplo n.º 4
0
 def __init__(self):
     self._conf = config.SimpleConfig()
Ejemplo n.º 5
0
			 
			 
CREATE TABLE htmlGrep
(
   id integer, 
   item_name character(60) NOT NULL, 
   price_s character(40),
	 rank integer,
   appear_time integer NOT NULL, 
   disappear_time integer NOT NULL
) WITH (OIDS=TRUE)
;

'''

g_conf = config.SimpleConfig()
g_conf.open('grep.conf')
g_dbconn = None
g_logger = log.Logger('hgrep.log')
g_flog = None

g_cookie = ''

#def getDBConn():
#	global g_dbconn
#	try:
#		if g_dbconn == None:
#			dbhost=g_conf.getPropertyValue('dbhost','localhost')
#			dbname='gamegrep'
#			dbuser=g_conf.getPropertyValue('dbuser','postgres')
#			dbpasswd=g_conf.getPropertyValue('dbpasswd','111111')
Ejemplo n.º 6
0
 def __init__(self):
     self._conf = config.SimpleConfig()
     self.rdrlist = []  # {'host','port'}
Ejemplo n.º 7
0
 def __init__(self):
     self._conf = config.SimpleConfig()
     self.service = SyncServiceEndpoint(self)
Ejemplo n.º 8
0
 def __init__(self):
     self._conf = config.SimpleConfig()
     self.server = IRdDispatcherImpl(self)
     self.dbconn = None
     self.udpserver = udpserver.UdpServer(self)