From: Christian Heller Date: Mon, 31 Aug 2015 23:45:17 +0000 (+0200) Subject: Ignore lowercase-starting (= player) commands when world is inactive. X-Git-Tag: tce~307 X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/copy_free?a=commitdiff_plain;h=acde4737558aac582a158ebc8d20c23ef50d44a9;p=plomrogue Ignore lowercase-starting (= player) commands when world is inactive. --- 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()