localconfig = ''
if args.base_channel: localconfig += 'air-base-channel %s\n' % args.base_channel
if args.max_channels: localconfig += 'air-channel-allocation %s\n' % args.max_channels
if args.stateserver: localconfig += 'air-stateserver %s\n' % args.stateserver
if args.district_name: localconfig += 'district-name %s\n' % args.district_name
if args.astron_ip: localconfig += 'air-connect %s\n' % args.astron_ip
if args.eventlogger_ip: localconfig += 'eventlog-host %s\n' % args.eventlogger_ip
loadPrcFileData('Command-line', localconfig)


from otp.ai.AIBaseGlobal import *

from toontown.ai.ToontownAIRepository import ToontownAIRepository
simbase.air = ToontownAIRepository(config.GetInt('air-base-channel', 401000000),
                                   config.GetInt('air-stateserver', 4002),
                                   config.GetString('district-name', 'Devhaven'))
host = config.GetString('air-connect', '127.0.0.1')
port = 7100
if ':' in host:
    host, port = host.split(':', 1)
    port = int(port)
simbase.air.connect(host, port)

try:
    run()
except SystemExit:
    raise
except Exception:
    info = PythonUtil.describeException()
    simbase.air.writeServerEvent('ai-exception', avId=simbase.air.getAvatarIdFromSender(), accId=simbase.air.getAccountIdFromSender(), exception=info)
Esempio n. 2
0
class game:
    name = 'toontown'
    process = 'server'


__builtin__.game = game
from otp.ai.AIBaseGlobal import *
from toontown.ai.ToontownAIRepository import ToontownAIRepository
simbase.air = ToontownAIRepository(
    config.GetInt('air-base-channel', 401000000),
    config.GetInt('air-stateserver', 10000),
    config.GetFloat('exp-multiplier', 1.0),
    config.GetFloat('merit-multiplier', 1.0),
    config.GetFloat('doodle-multiplier', 1.0),
    config.GetBool('default-max-toon', False),
    config.GetString('default-zone', 'TTC'),
    config.GetString('district-name', 'Toon Valley'),
    config.GetInt('district-limit', 16),
    config.GetString('district-description',
                     'A Toontown Offline Mini-Server.'),
    config.GetString('district-id', ''), config.GetString('event-id', ''),
    config.GetString('default-access-level', 'USER'))
host = config.GetString('air-connect', '127.0.0.1')
port = 7199
if ':' in host:
    host, port = host.split(':', 1)
    port = int(port)
simbase.air.connect(host, port)
try:
    run()
except SystemExit: