From acde4737558aac582a158ebc8d20c23ef50d44a9 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Tue, 1 Sep 2015 01:45:17 +0200 Subject: [PATCH] Ignore lowercase-starting (= player) commands when world is inactive. --- roguelike-server | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/roguelike-server b/roguelike-server index e723339..d807447 100755 --- a/roguelike-server +++ b/roguelike-server @@ -109,7 +109,8 @@ def obey(command, prefix, replay=False, do_record=False): is called (and io_db["record_chunk"] written) if 15 seconds have passed since the last time it was called. The prefix string is inserted into the server's input message between its beginning 'input ' and ':'. All activity - is preceded by a server_test() call. + is preceded by a server_test() call. Commands that start with a lowercase + letter are ignored when world_db["WORLD_ACTIVE"] is False/0. """ server_test() if io_db["verbose"]: @@ -123,6 +124,8 @@ def obey(command, prefix, replay=False, do_record=False): and len(tokens) == commands_db[tokens[0]][0] + 1: if commands_db[tokens[0]][1]: commands_db[tokens[0]][2](*tokens[1:]) + elif tokens[0][0].islower() and not world_db["WORLD_ACTIVE"]: + print("Ignoring lowercase-starting commands when world inactive.") elif replay: print("Due to replay mode, reading command as 'go on in record'.") line = io_db["file_record"].readline() -- 2.30.2