This commit is contained in:
SpudGunMan
2024-10-03 23:00:34 -07:00
parent 1334763e3d
commit afd1bcae17
3 changed files with 19 additions and 4 deletions

View File

@@ -73,12 +73,12 @@ def parse_log_file(file_path):
log_data['command_counts'][cmd] += 1
log_data['command_timestamps'].append((timestamp.isoformat(), cmd))
if 'Sending DM:' in line or 'Sending Multi-Chunk DM:' in line:
if 'Sending DM:' in line or 'Sending Multi-Chunk DM:' in line or 'SendingChannel:' in line or 'Sending Multi-Chunk Message:' in line:
log_data['message_types']['Outgoing DM'] += 1
log_data['total_messages'] += 1
log_data['message_timestamps'].append((timestamp.isoformat(), 'Outgoing DM'))
if 'Received DM:' in line:
if 'Received DM:' in line or 'Ignoring DM:' in line or 'Ignoring Message:' in line or 'ReceivedChannel:' in line:
log_data['message_types']['Incoming DM'] += 1
log_data['total_messages'] += 1
log_data['message_timestamps'].append((timestamp.isoformat(), 'Incoming DM'))
@@ -232,6 +232,7 @@ def get_system_info():
def get_wall_of_shame():
# Get the wall of shame
return {
'shame': "N/A",
}
@@ -265,11 +266,21 @@ def get_database_info():
golfsim_score = pickle.load(f)
f.close()
with open('../bbsdb.pkl', 'rb') as f:
bbsdb = pickle.load(f)
f.close()
with open('../bbsdm.pkl', 'rb') as f:
bbsdm = pickle.load(f)
f.close()
except Exception as e:
pass
return {
'database': "N/A",
"bbsdb": bbsdb,
"bbsdm": bbsdm,
'lemon_score': lemon_score,
'dopewar_score': dopewar_score,
'blackjack_score': blackjack_score,
@@ -739,6 +750,10 @@ def generate_database_html(database_info):
<body>
<h1>Database Information</h1>
<p>${database}</p>
<h1>BBS Message Database</h1>
<p>BBSdb: ${bbsdb}</p>
<p>BBSdm: ${bbsdm}</p>
<h1>High Scores</h1>
<table>
<tr><th>Game</th><th>High Score</th></tr>
<tr><td>Lemonade Stand</td><td>${lemon_score}</td></tr>

View File

@@ -1058,7 +1058,7 @@ def onReceive(packet, interface):
logger.debug(f"System: ignoreDefaultChannel CMD:{message_string} From: {get_name_from_number(message_from_id, 'short', rxNode)}")
else:
# message is for bot to respond to
logger.info(f"Device:{rxNode} Channel:{channel_number} " + CustomFormatter.green + "Received: " + CustomFormatter.white + f"{message_string} " + CustomFormatter.purple +\
logger.info(f"Device:{rxNode} Channel:{channel_number} " + CustomFormatter.green + "ReceivedChannel: " + CustomFormatter.white + f"{message_string} " + CustomFormatter.purple +\
"From: " + CustomFormatter.white + f"{get_name_from_number(message_from_id, 'long', rxNode)}")
if useDMForResponse:
# respond to channel message via direct message

View File

@@ -560,7 +560,7 @@ def send_message(message, ch, nodeid=0, nodeInt=1):
else: # message is less than MESSAGE_CHUNK_SIZE characters
if nodeid == 0:
# Send to channel
logger.info(f"Device:{nodeInt} Channel:{ch} " + CustomFormatter.red + "Sending: " + CustomFormatter.white + message.replace('\n', ' '))
logger.info(f"Device:{nodeInt} Channel:{ch} " + CustomFormatter.red + "SendingChannel: " + CustomFormatter.white + message.replace('\n', ' '))
if nodeInt == 1:
interface1.sendText(text=message, channelIndex=ch)
if nodeInt == 2: