home
·
contact
·
privacy
projects
/
plomrogue2-experiments
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
54019ea
)
Don't abort initial save file replay on error.
author
Christian Heller
<c.heller@plomlompom.de>
Thu, 10 Jan 2019 00:56:20 +0000
(
01:56
+0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Thu, 10 Jan 2019 00:56:20 +0000
(
01:56
+0100)
server.py
patch
|
blob
|
history
diff --git
a/server.py
b/server.py
index 7e2d80dc67b2d2f8cd5f1f332b1755588a1cdf8f..f6dcd35e43d3a915560ab3b8d36fbac474876666 100755
(executable)
--- a/
server.py
+++ b/
server.py
@@
-106,8
+106,7
@@
class CommandHandler(game_common.Commander, server_.game.Commander):
self.pool = Pool()
self.pool_result = None
self.pool = Pool()
self.pool_result = None
- def handle_input(self, input_, connection_id=None, abort_on_error=False,
- store=True):
+ def handle_input(self, input_, connection_id=None, store=True):
"""Process input_ to command grammar, call command handler if found."""
from inspect import signature
try:
"""Process input_ to command grammar, call command handler if found."""
from inspect import signature
try:
@@
-124,12
+123,8
@@
class CommandHandler(game_common.Commander, server_.game.Commander):
f.write(input_ + '\n')
except parser.ArgError as e:
self.send_to(connection_id, 'ARGUMENT ERROR: ' + str(e))
f.write(input_ + '\n')
except parser.ArgError as e:
self.send_to(connection_id, 'ARGUMENT ERROR: ' + str(e))
- if abort_on_error:
- exit(1)
except server_.game.GameError as e:
self.send_to(connection_id, 'GAME ERROR: ' + str(e))
except server_.game.GameError as e:
self.send_to(connection_id, 'GAME ERROR: ' + str(e))
- if abort_on_error:
- exit(1)
def send_to(self, connection_id, msg):
"""Send msg to client of connection_id; if no later, print instead."""
def send_to(self, connection_id, msg):
"""Send msg to client of connection_id; if no later, print instead."""
@@
-264,7
+259,7
@@
if os.path.exists(game_file_name):
for i in range(len(lines)):
line = lines[i]
print("FILE INPUT LINE %s: %s" % (i, line), end='')
for i in range(len(lines)):
line = lines[i]
print("FILE INPUT LINE %s: %s" % (i, line), end='')
- commander.handle_input(line,
abort_on_error=True,
store=False)
+ commander.handle_input(line, store=False)
else:
commander.handle_input('MAP_SIZE Y:5,X:5')
commander.handle_input('TERRAIN_LINE 0 "xxxxx"')
else:
commander.handle_input('MAP_SIZE Y:5,X:5')
commander.handle_input('TERRAIN_LINE 0 "xxxxx"')