def get_evennia_pids():
 server_pidfile = os.path.join(settings.GAME_DIR, 'server.pid')
 portal_pidfile = os.path.join(settings.GAME_DIR, 'portal.pid')
 (server_pid, portal_pid) = (None, None)
 if os.path.exists(server_pidfile):
  f = open(server_pidfile, 'r')
  server_pid = f.read()
  f.close()
 if os.path.exists(portal_pidfile):
  f = open(portal_pidfile, 'r')
  portal_pid = f.read()
  f.close()
 if (server_pid and portal_pid):
  return (int(server_pid), int(portal_pid))
 return (None, None)

def get_evennia_pids ( ) : server_pidfile = os . path . join ( settings . GAME_DIR , 'server.pid' ) portal_pidfile = os . path . join ( settings . GAME_DIR , 'portal.pid' ) ( server_pid , portal_pid ) = ( None , None ) if os . path . exists ( server_pidfile ) : f = open ( server_pidfile , 'r' ) server_pid = f . read ( ) f . close ( ) if os . path . exists ( portal_pidfile ) : f = open ( portal_pidfile , 'r' ) portal_pid = f . read ( ) f . close ( ) if ( server_pid and portal_pid ) : return ( int ( server_pid ) , int ( portal_pid ) ) return ( None , None )
get the currently valid pids of the portal and server by trying to access a pid file .