diff --git a/mesh_bot.py b/mesh_bot.py index eb3c140..9534adc 100755 --- a/mesh_bot.py +++ b/mesh_bot.py @@ -180,7 +180,7 @@ def isPlayingGame(message_from_id): trackers = [tracker for tracker in trackers if tracker is not None] - for tracker, game_name in trackers: + for tracker, game_name, _ in trackers: for i in range(len(tracker)-1, -1, -1): # iterate backwards for safe removal id_key = 'userID' if game_name == "DopeWars" else 'nodeID' id_key = 'id' if game_name == "Survey" else id_key diff --git a/modules/settings.py b/modules/settings.py index f786284..75c044b 100644 --- a/modules/settings.py +++ b/modules/settings.py @@ -46,6 +46,13 @@ dwPlayerTracker = [] # DopeWars player tracker jackTracker = [] # Jack game tracker mindTracker = [] # Mastermind (mmind) game tracker +# Memory Management Constants +MAX_MSG_HISTORY = 250 +MAX_CMD_HISTORY = 250 +MAX_SEEN_NODES = 1000 +CLEANUP_INTERVAL = 86400 # 24 hours in seconds +GAMEDELAY = 3 * CLEANUP_INTERVAL # 3 days in seconds + # Read the config file, if it does not exist, create basic config file config = configparser.ConfigParser() config_file = "config.ini" diff --git a/modules/system.py b/modules/system.py index d7cdd5a..4ad1c53 100644 --- a/modules/system.py +++ b/modules/system.py @@ -23,13 +23,6 @@ games_enabled = False multiPingList = [{'message_from_id': 0, 'count': 0, 'type': '', 'deviceID': 0, 'channel_number': 0, 'startCount': 0}] interface_retry_count = 3 -# Memory Management Constants -MAX_MSG_HISTORY = 250 -MAX_CMD_HISTORY = 250 -MAX_SEEN_NODES = 1000 -CLEANUP_INTERVAL = 86400 # 24 hours in seconds -GAMEDELAY = 3 * CLEANUP_INTERVAL # 3 days in seconds - # Ping Configuration if ping_enabled: # ping, pinging, ack, testing, test, pong