You may now specify a list of ports in settings.py to listen on instead of just a straight integer value. You'll need to copy GAMEPORTS from settings.py.dist if you have an existing game.
This commit is contained in:
parent
270f7e7128
commit
debb34aae9
2 changed files with 7 additions and 5 deletions
|
|
@ -61,7 +61,6 @@ class EvenniaService(service.Service):
|
||||||
print '-'*50
|
print '-'*50
|
||||||
# Load command aliases into memory for easy/quick access.
|
# Load command aliases into memory for easy/quick access.
|
||||||
self.load_cmd_aliases()
|
self.load_cmd_aliases()
|
||||||
self.port = settings.GAMEPORT
|
|
||||||
|
|
||||||
if gameconf.get_configvalue('game_firstrun') == '1':
|
if gameconf.get_configvalue('game_firstrun') == '1':
|
||||||
print ' Game started for the first time, setting defaults.'
|
print ' Game started for the first time, setting defaults.'
|
||||||
|
|
@ -69,7 +68,9 @@ class EvenniaService(service.Service):
|
||||||
|
|
||||||
self.start_time = time.time()
|
self.start_time = time.time()
|
||||||
|
|
||||||
print ' %s started on port %s.' % (gameconf.get_configvalue('site_name'), self.port,)
|
print ' %s started on port(s):' % (gameconf.get_configvalue('site_name'),)
|
||||||
|
for port in settings.GAMEPORTS:
|
||||||
|
print ' * %s' % (port)
|
||||||
print '-'*50
|
print '-'*50
|
||||||
scheduler.start_events()
|
scheduler.start_events()
|
||||||
|
|
||||||
|
|
@ -146,4 +147,5 @@ mud_service = EvenniaService('Evennia Server')
|
||||||
|
|
||||||
# Sheet sheet, fire ze missiles!
|
# Sheet sheet, fire ze missiles!
|
||||||
serviceCollection = service.IServiceCollection(application)
|
serviceCollection = service.IServiceCollection(application)
|
||||||
internet.TCPServer(settings.GAMEPORT, mud_service.getEvenniaServiceFactory()).setServiceParent(serviceCollection)
|
for port in settings.GAMEPORTS:
|
||||||
|
internet.TCPServer(port, mud_service.getEvenniaServiceFactory()).setServiceParent(serviceCollection)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
# A list of ports to listen on.
|
||||||
|
GAMEPORTS = [4000]
|
||||||
|
|
||||||
# The port for the game to run on.
|
|
||||||
GAMEPORT = 4000
|
|
||||||
# The name of the server log file.
|
# The name of the server log file.
|
||||||
LOGFILE = 'logs/evennia.log'
|
LOGFILE = 'logs/evennia.log'
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue