Skip to content

Commit 6ab4435

Browse files
committed
command_debug now uses command_start
command_debug previously was a copy/paste of command_start. As command start was updated in recent commits, it mistakenly reported wrong values. _debug now regex matches _start.
1 parent b0229d6 commit 6ab4435

File tree

1 file changed

+5
-27
lines changed

1 file changed

+5
-27
lines changed

mineos.py

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -999,33 +999,11 @@ def command_start(self):
999999
@sanitize
10001000
def command_debug(self):
10011001
"""Returns the command used to test starting up a minecraft server."""
1002-
required_arguments = {
1003-
'java': self.BINARY_PATHS['java'],
1004-
'java_xmx': self.server_config['java':'java_xmx'],
1005-
'java_xms': self.server_config['java':'java_xmx'],
1006-
'java_tweaks': self.server_config['java':'java_tweaks':''],
1007-
'jar_args': '-nogui'
1008-
}
1009-
1010-
try:
1011-
jar_file = self.valid_filename(self.profile_config[self.profile:'run_as'])
1012-
required_arguments['jar_file'] = os.path.join(self.env['cwd'], jar_file)
1013-
required_arguments['jar_args'] = self.profile_config[self.profile:'jar_args':'']
1014-
except (TypeError,ValueError):
1015-
required_arguments['jar_file'] = None
1016-
required_arguments['jar_args'] = None
1017-
1018-
try:
1019-
java_xms = self.server_config['java':'java_xms']
1020-
except KeyError:
1021-
pass
1022-
else:
1023-
if java_xms.strip():
1024-
self.server_config['java':'java_xms'] = java_xms.strip()
1025-
1026-
self._previous_arguments = required_arguments
1027-
return '%(java)s -server %(java_tweaks)s -Xmx%(java_xmx)sM -Xms%(java_xms)sM ' \
1028-
'-jar %(jar_file)s %(jar_args)s' % required_arguments
1002+
import re
1003+
1004+
command = self.command_start
1005+
match = re.match(r'^.+ mc-.+? (.+)', command)
1006+
return match.group(1)
10291007

10301008
@property
10311009
@sanitize

0 commit comments

Comments
 (0)