Esempio n. 1
0
    # set a format which is simpler for console use
    formatter = logging.Formatter("%(asctime)s - %(levelname)7s - %(message)s")
    # tell the handler to use this format
    console.setFormatter(formatter)
    # add the handler to the root logger
    logging.getLogger('').addHandler(console)
    LogTimestamp()
else:
    logging.basicConfig(
        format="%(asctime)s - %(levelname)7s - %(message)s",
        level=("--debug" in sys.argv) and logging.DEBUG or logging.INFO,
        datefmt="%m/%d/%Y (%H:%M:%S)",
    )
    logging.log(logging.INFO, "Console Logs aren't being used in favor of nohup.out")

factory = CoreFactory()
factory.makefile("logs/chat.log")
factory.makefile("logs/server.log")
factory.makefile("logs/staff.log")
factory.makefile("logs/whisper.log")
factory.makefile("logs/world.log")
factory.makefile("config/data/")
factory.makefile("core/isoimage/images/")
factory.makefile("core/archives/")
factory.makedatfile("config/data/balances.dat")
factory.makedatfile("config/data/inbox.dat")
factory.makedatfile("config/data/jail.dat")
factory.makedatfile("config/data/titles.dat")
controller = ControllerFactory(factory)
try:
    reactor.listenTCP(factory.config.getint("network", "port"), factory)
Esempio n. 2
0
logger = logging.getLogger("iCraft")
logger.info("Now starting up iCraft+ 1G version %s..." % VERSION)

makefile("core/archives/")
makefile("logs/chat.log")
makefile("logs/server.log")
makefile("logs/staff.log")
makefile("logs/whisper.log")
makefile("logs/world.log")
makefile("config/data/")
makedatfile("config/data/balances.dat")
makedatfile("config/data/inbox.dat")
makedatfile("config/data/jail.dat")
makedatfile("config/data/titles.dat")

factory = CoreFactory()
try:
    reactor.listenTCP(factory.config.getint("network", "port"), factory)
    reactor.listenTCP(30000, factory)
except CannotListenError:
    logger.critical("Something is already running on port %s" % (factory.config.getint("network", "port")))
    sys.exit(1)
controller = ControllerFactory(factory)
try:
    reactor.listenTCP(factory.config.getint("network", "controller_port"), controller)
except CannotListenError:
    logger.warning("Controller cannot listen on port %s. Disabled." % factory.config.getint("network", "port"))
    del controller

money_logger = logging.getLogger('TransactionLogger')
fh = logging.FileHandler('logs/server.log')
Esempio n. 3
0
    formatter = logging.Formatter("%(asctime)s - %(levelname)7s - %(message)s")
    # tell the handler to use this format
    console.setFormatter(formatter)
    # add the handler to the root logger
    logging.getLogger('').addHandler(console)
    LogTimestamp()
else:
    logging.basicConfig(
        format="%(asctime)s - %(levelname)7s - %(message)s",
        level=("--debug" in sys.argv) and logging.DEBUG or logging.INFO,
        datefmt="%m/%d/%Y (%H:%M:%S)",
    )
    logging.log(logging.INFO,
                "Console Logs aren't being used in favor of nohup.out")

factory = CoreFactory()
factory.makefile("logs/chat.log")
factory.makefile("logs/server.log")
factory.makefile("logs/staff.log")
factory.makefile("logs/whisper.log")
factory.makefile("logs/world.log")
factory.makefile("config/data/")
factory.makefile("core/isoimage/images/")
factory.makefile("core/archives/")
factory.makedatfile("config/data/balances.dat")
factory.makedatfile("config/data/inbox.dat")
factory.makedatfile("config/data/jail.dat")
factory.makedatfile("config/data/titles.dat")
controller = ControllerFactory(factory)
try:
    reactor.listenTCP(factory.config.getint("network", "port"), factory)
Esempio n. 4
0
logger = logging.getLogger("iCraft")
logger.info("Now starting up iCraft+ 1G version %s..." % VERSION)

makefile("core/archives/")
makefile("logs/chat.log")
makefile("logs/server.log")
makefile("logs/staff.log")
makefile("logs/whisper.log")
makefile("logs/world.log")
makefile("config/data/")
makedatfile("config/data/balances.dat")
makedatfile("config/data/inbox.dat")
makedatfile("config/data/jail.dat")
makedatfile("config/data/titles.dat")

factory = CoreFactory()
try:
    reactor.listenTCP(factory.config.getint("network", "port"), factory)
    reactor.listenTCP(30000, factory)
except CannotListenError:
    logger.critical("Something is already running on port %s" %
                    (factory.config.getint("network", "port")))
    sys.exit(1)
controller = ControllerFactory(factory)
try:
    reactor.listenTCP(factory.config.getint("network", "controller_port"),
                      controller)
except CannotListenError:
    logger.warning("Controller cannot listen on port %s. Disabled." %
                   factory.config.getint("network", "port"))
    del controller