Fixed an error in Windows version that put pid files in the wrong location (how come a Windows user didn't notice this one before?)
This commit is contained in:
parent
94b8532f59
commit
1c298951d6
2 changed files with 6 additions and 8 deletions
|
|
@ -131,10 +131,9 @@ class Portal(object):
|
||||||
"""
|
"""
|
||||||
if mode is None:
|
if mode is None:
|
||||||
return
|
return
|
||||||
f = open(PORTAL_RESTART, 'w')
|
with open(PORTAL_RESTART, 'w') as f:
|
||||||
print "writing mode=%(mode)s to %(portal_restart)s" % {'mode': mode, 'portal_restart': PORTAL_RESTART}
|
print "writing mode=%(mode)s to %(portal_restart)s" % {'mode': mode, 'portal_restart': PORTAL_RESTART}
|
||||||
f.write(str(mode))
|
f.write(str(mode))
|
||||||
f.close()
|
|
||||||
|
|
||||||
def shutdown(self, restart=None, _reactor_stopping=False):
|
def shutdown(self, restart=None, _reactor_stopping=False):
|
||||||
"""
|
"""
|
||||||
|
|
@ -330,6 +329,5 @@ print '-' * 50 # end of terminal output
|
||||||
|
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
# Windows only: Set PID file manually
|
# Windows only: Set PID file manually
|
||||||
f = open(os.path.join(settings.GAME_DIR, 'portal.pid'), 'w')
|
with open(PORTAL_PIDFILE, 'w') as f:
|
||||||
f.write(str(os.getpid()))
|
f.write(str(os.getpid()))
|
||||||
f.close()
|
|
||||||
|
|
|
||||||
|
|
@ -535,6 +535,6 @@ ServerConfig.objects.conf("server_starting_mode", delete=True)
|
||||||
|
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
# Windows only: Set PID file manually
|
# Windows only: Set PID file manually
|
||||||
with open(os.path.join(settings.GAME_DIR, 'server.pid'), 'w') as f:
|
with open(SERVER_PIDFILE, 'w') as f:
|
||||||
f.write(str(os.getpid()))
|
f.write(str(os.getpid()))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue