home
·
contact
·
privacy
projects
/
plomrogue
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b4e6d1d
)
Server/py: Add value check to command_turn().
author
Christian Heller
<c.heller@plomlompom.de>
Tue, 24 Feb 2015 01:46:55 +0000
(
02:46
+0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Tue, 24 Feb 2015 01:46:55 +0000
(
02:46
+0100)
plomrogue-server.py
patch
|
blob
|
history
diff --git
a/plomrogue-server.py
b/plomrogue-server.py
index 9e4f008a5198d58d3dc937456532eaf1480a482f..8d09550e7f97e419cece12ea9cf74f0a0bbb9325 100755
(executable)
--- a/
plomrogue-server.py
+++ b/
plomrogue-server.py
@@
-252,7
+252,13
@@
def command_quit():
def command_turn(turn_string):
"""Set turn to what's described in turn_string."""
- world_db["TURN"] = int(turn_string)
+ try:
+ turn = int(turn_string)
+ if turn < 0 or turn > 65535:
+ raise ValueError
+ world_db["TURN"] = turn
+ except ValueError:
+ print("Ignoring: Argument must be integer >= 0 and <= 65535.")
"""Commands database.