Esempio n. 1
0
 def on_rcon_client_ready(self, **kwargs):
   #rcon_client.command('logaddress_del %s %s' % (config['rcon']['remote']['host'], config['rcon']['remote']['port']))
   rcon_client.command('logaddress_add %s %s' % (cget('rcon', 'remote', 'host'), cget('rcon', 'remote', 'port')))
   
   if not self.rcon_tracker:
     self.rcon_tracker = RconTracker()
     self.rcon_tracker.setup()
Esempio n. 2
0
 def do_restarts(index):
   if index < len(lo3_messages):
     message = lo3_messages[index]
     delay = lo3_delays[index]
     rcon_client.hsay('', message)
     rcon_client.command('sv_restart', delay)
     index += 1
     reactor.callLater(int(delay)+1, do_restarts, index)
   else:
     self.performing_lo3 = False
     rcon_client.hsay('', lo3_live_message)
Esempio n. 3
0
 def exec_(self, name):
   if not name:
     return
   
   # Grab the location of our scripts
   path = cget('plugins', 'exec', 'scripts_path', default=os.path.join(os.path.dirname(__file__), 'scripts'))
   
   # Iterate through the scripts dir and try to find any file matching name.
   list = os.listdir(path)
   for file in list:
     file_name = os.path.splitext(file)[0]
     if name == file_name:
       fp = open(os.path.join(path, file), 'r')
       for line in fp:
         rcon_client.command(line, deferred=False)
       fp.close()
       break