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:
958b6c8
)
Server/py: Fix out file writing bug.
author
Christian Heller
<c.heller@plomlompom.de>
Tue, 3 Mar 2015 00:37:57 +0000
(
01:37
+0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Tue, 3 Mar 2015 00:37:57 +0000
(
01:37
+0100)
plomrogue-server.py
patch
|
blob
|
history
diff --git
a/plomrogue-server.py
b/plomrogue-server.py
index b921f4baa0ee9c6e8c3a122270f65ab718dfe73d..d6c1930da2613a88c98e844b830b861c9fd2c482 100755
(executable)
--- a/
plomrogue-server.py
+++ b/
plomrogue-server.py
@@
-270,7
+270,9
@@
def try_worldstate_update():
string = string + line + "\n"
# TODO: no proper user-subjective map
atomic_write(io_db["path_worldstate"], string)
string = string + line + "\n"
# TODO: no proper user-subjective map
atomic_write(io_db["path_worldstate"], string)
- atomic_write(io_db["path_out"], "WORLD_UPDATED\n", do_append=True)
+ io_db["file_out"].write("WORLD_UPDATED\n")
+ io_db["file_out"].flush()
+ os.fsync(io_db["file_out"])
io_db["worldstate_updateable"] = False
io_db["worldstate_updateable"] = False
@@
-416,6
+418,7
@@
def command_ping():
"""Send PONG line to server output file."""
io_db["file_out"].write("PONG\n")
io_db["file_out"].flush()
"""Send PONG line to server output file."""
io_db["file_out"].write("PONG\n")
io_db["file_out"].flush()
+ os.fsync(io_db["file_out"].fileno())
def command_quit():
def command_quit():