Skip to content

Commit

Permalink
store default server values in settings on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
dannagle committed Oct 27, 2024
1 parent fb76395 commit 864d973
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/packetnetwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,21 @@ void PacketNetwork::init()
tcpPortList = Settings::portsToIntList(settings.value("tcpPort", "0").toString());
sslPortList = Settings::portsToIntList(settings.value("sslPort", "0").toString());

if(settings.value("dtlsServerEnable", "").toString().isEmpty()) {
settings.setValue("dtlsServerEnable", false);
settings.sync();
}
if(settings.value("udpServerEnable", "").toString().isEmpty()) {
settings.setValue("udpServerEnable", true);
}
if(settings.value("tcpServerEnable", "").toString().isEmpty()) {
settings.setValue("tcpServerEnable", false);
}
if(settings.value("sslServerEnable", "").toString().isEmpty()) {
settings.setValue("sslServerEnable", false);
settings.sync();
}

activateDTLS = settings.value("dtlsServerEnable", false).toBool();
activateUDP = settings.value("udpServerEnable", true).toBool();
activateTCP = settings.value("tcpServerEnable", false).toBool();
Expand Down

0 comments on commit 864d973

Please sign in to comment.