X-Git-Url: https://plomlompom.com/repos/berlin_corona.txt?a=blobdiff_plain;ds=sidebyside;f=roguelike-server;h=187835d1ce11bc04d47071fd298d5b4256635d12;hb=701258936cd27bc93649c4074532d4b1d40542df;hp=87a4e24267bad8afaca75e91d21cc73712b154ba;hpb=4c4b54efa5b631f46389940b2665ac62665e540b;p=plomrogue diff --git a/roguelike-server b/roguelike-server index 87a4e24..187835d 100755 --- a/roguelike-server +++ b/roguelike-server @@ -110,7 +110,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"]: @@ -124,6 +125,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() @@ -1367,7 +1370,7 @@ def command_worldactive(worldactive_string): if 0 == Thing: player_exists = True break - if wait_exists and player_exists and world_db["MAP"]: + if wait_exists and player_exists and "MAP" in world_db: for id in world_db["Things"]: if world_db["Things"][id]["T_LIFEPOINTS"]: build_fov_map(world_db["Things"][id])