create empty Clients, Peers, Users arrays in json

pull/1/head
Tom Early 3 years ago
parent b286079b73
commit 217db1c376

@ -79,10 +79,10 @@ cp ../config/* .
This will create seven files:
1. The `urfd.blacklist` file defines callsigns that are blocked from linking or transmitting.
2. The `urfd.whitelist` file defines callsigns that are allowed to link and transmit. Both of these files support the astrisk as a wild-card. The supplied blacklist and whitelist file are empty, which will allow any callsign to link and transmit, blocking no one.
2. The `urfd.whitelist` file defines callsigns that are allowed to link and transmit. Both of these files support the astrisk as a wild-card. The supplied blacklist and whitelist file are empty, which will allow any callsign to link and transmit, blocking no one. Both files support a limited wildcard feature.
3. The `urfd.interlink` file defines possible Brandmeister and URF linking.
4. The `urfd.terminal` file defines operations for Icom's Terminal and Access Point mode, sometimes called *G3*. This protocol requires significantly higher connection resources than any other mode, so it is possible to build a URF reflector without G3 support.
5. The `urfd.service` file is a systemd file that will start and stop *urfd*. Importantly, it contains the only reference to where the *urfd* initialization file is located.
5. The `urfd.service` file is a systemd file that will start and stop *urfd*. Importantly, it contains the only reference to where the *urfd* initialization file is located. Be sure to set a fully qualified path to your urfd.ini file on the `ExecStart` line.
6. The `urfd.mk` file contains compile-time options for *urfd*. If you change the `BINDIR`, you'll need to update how `urfd.service` starts *urfd*.
7. The `urfd.ini` file contains the run-time options for *urfd* and will be discussed below.

@ -5,7 +5,7 @@ After=systemd-user-session.service network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/urfd
ExecStart=/usr/local/bin/urfd /PATH_TO_INI_FILE
Restart=always
[Install]

@ -330,7 +330,7 @@ void CReflector::XmlReportThread()
jsonFile.open(jsnpath, std::ios::out | std::ios::trunc);
if (jsonFile.is_open())
{
jsonFile << jreport.dump(4);
jsonFile << jreport.dump();
jsonFile.close();
}
}
@ -432,16 +432,19 @@ void CReflector::JsonReport(nlohmann::json &report)
report["Configure"][item.key()] = item.value();
}
report["Peers"] = nlohmann::json::array();
auto peers = GetPeers();
for (auto pit=peers->cbegin(); pit!=peers->cend(); pit++)
(*pit)->JsonReport(report);
ReleasePeers();
report["Clients"] = nlohmann::json::array();
auto clients = GetClients();
for (auto cit=clients->cbegin(); cit!=clients->cend(); cit++)
(*cit)->JsonReport(report);
ReleaseClients();
report["Users"] = nlohmann::json::array();
auto users = GetUsers();
for (auto uid=users->begin(); uid!=users->end(); uid++)
(*uid).JsonReport(report);

Loading…
Cancel
Save

Powered by TurnKey Linux.