Commit 7e63cf65 authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Go back to singular "node" topic

parent aa7a9640
......@@ -573,7 +573,7 @@ bool sbbs_t::update_nodeterm(void)
if(cfg.mqtt.enabled) {
char str[256];
char topic[128];
SAFEPRINTF(topic, "nodes/%u/terminal", cfg.node_num);
SAFEPRINTF(topic, "node/%u/terminal", cfg.node_num);
snprintf(str, sizeof(str), "%lu\t%lu\t%s\t%s\t%s\t%lx\t%lx\t%lx"
,cols
,rows
......
......@@ -2292,7 +2292,7 @@ void output_thread(void* arg)
if(sbbs->cfg.node_num) {
SAFEPRINTF(node,"Node %d",sbbs->cfg.node_num);
SAFEPRINTF(spy_topic, "nodes/%d/output", sbbs->cfg.node_num);
SAFEPRINTF(spy_topic, "node/%d/output", sbbs->cfg.node_num);
} else
SAFECOPY(node,sbbs->client_name);
#ifdef _DEBUG
......@@ -4413,7 +4413,7 @@ void node_thread(void* arg)
long tused = (long)(now - sbbs->logontime);
if(tused < 0)
tused = 0;
SAFEPRINTF(topic, "nodes/%u/laston", sbbs->cfg.node_num);
SAFEPRINTF(topic, "node/%u/laston", sbbs->cfg.node_num);
snprintf(str, sizeof(str), "%u\t%s\t%s", sbbs->useron.number, sbbs->useron.alias, sectostr(tused, tmp));
mqtt_pub_strval(&mqtt, TOPIC_BBS, topic, str);
}
......@@ -4993,7 +4993,8 @@ void bbs_thread(void* arg)
startup->last_node=scfg.sys_nodes;
}
mqtt_pub_uintval(&mqtt, TOPIC_BBS, "nodes", scfg.sys_nodes);
SAFEPRINTF(str, "%u total", scfg.sys_nodes);
mqtt_pub_strval(&mqtt, TOPIC_BBS, "node", str);
/* Create missing directories */
lprintf(LOG_INFO,"Verifying/creating data directories");
......
......@@ -102,10 +102,10 @@ int sbbs_t::putnodedat(uint number, node_t* node)
,node->extaux
,node->errors
);
SAFEPRINTF(topic, "nodes/%u/status", number + 1);
SAFEPRINTF(topic, "node/%u/status", number + 1);
int result = mqtt_pub_strval(mqtt, TOPIC_BBS, topic, str);
if(result == MQTT_SUCCESS && cfg.mqtt.verbose) {
SAFEPRINTF(topic, "nodes/%u", number + 1);
SAFEPRINTF(topic, "node/%u", number + 1);
result = mqtt_pub_strval(mqtt, TOPIC_BBS, topic
,nodestatus(&cfg, node, str, sizeof(str), number + 1));
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment