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 (from parent 1:
6777a44
)
New client: Add drop command.
author
Christian Heller
<c.heller@plomlompom.de>
Wed, 16 Dec 2015 00:14:19 +0000
(
01:14
+0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Wed, 16 Dec 2015 00:14:19 +0000
(
01:14
+0100)
client_prototype.py
patch
|
blob
|
history
diff --git
a/client_prototype.py
b/client_prototype.py
index 01bb74b4d78b712d8ae994eb77c2513ec7303ced..ea7af0e714b3eb1608975c7921cab8991497d890 100644
(file)
--- a/
client_prototype.py
+++ b/
client_prototype.py
@@
-447,9
+447,12
@@
def command_toggle_look_mode():
query_mapcell()
query_mapcell()
-def command_sender(string):
+def command_sender(string
, int_field=None
):
def command_send():
def command_send():
- io["file_out"].write(string + "\n")
+ int_string = ""
+ if int_field:
+ int_string = " " + str(world_data[int_field])
+ io["file_out"].write(string + int_string + "\n")
io["file_out"].flush()
return command_send
io["file_out"].flush()
return command_send
@@
-513,6
+516,7
@@
io = {
"path_worldstate": "server/worldstate"
}
commands = {
"path_worldstate": "server/worldstate"
}
commands = {
+ "D": (command_sender("drop", "inventory_selection"),),
"P": (command_sender("pick_up"),),
"Q": (command_quit,),
"W": (command_sender("wait"),),
"P": (command_sender("pick_up"),),
"Q": (command_quit,),
"W": (command_sender("wait"),),