Merge pull request #148 from AttorneyOnline/fixes

Fix evidence and config issues
This commit is contained in:
scatterflower 2021-07-12 15:29:54 -05:00 committed by GitHub
commit 16d6c8a983
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 15 deletions

View File

@ -109,12 +109,13 @@ class AreaData : public QObject {
/**
* @brief The level of "authorisation" needed to be able to modify, add, and remove evidence in the area.
*/
enum EvidenceMod{
enum class EvidenceMod{
FFA,
MOD,
CM,
HIDDEN_CM
};
Q_ENUM(EvidenceMod)
/**
* @var EvidenceMod FFA

View File

@ -258,8 +258,9 @@ void AOClient::sendPacket(AOPacket packet)
#endif
packet.contents.replaceInStrings("#", "<num>")
.replaceInStrings("%", "<percent>")
.replaceInStrings("$", "<dollar>")
.replaceInStrings("&", "<and>");
.replaceInStrings("$", "<dollar>");
if (packet.header != "LE")
packet.contents.replaceInStrings("&", "<and>");
socket->write(packet.toUtf8());
socket->flush();
}

View File

@ -42,7 +42,7 @@ AreaData::AreaData(QString p_name, int p_index) :
m_isProtected = areas_ini.value("protected_area", "false").toBool();
m_iniswapAllowed = areas_ini.value("iniswap_allowed", "true").toBool();
m_bgLocked = areas_ini.value("bg_locked", "false").toBool();
QString configured_evi_mod = areas_ini.value("evidence_mod", "FFA").toString().toLower();
m_eviMod = QVariant(areas_ini.value("evidence_mod", "FFA").toString().toUpper()).value<EvidenceMod>();
m_blankpostingAllowed = areas_ini.value("blankposting_allowed","true").toBool();
m_forceImmediate = areas_ini.value("force_immediate", "false").toBool();
m_toggleMusic = areas_ini.value("toggle_music", "true").toBool();
@ -62,15 +62,6 @@ AreaData::AreaData(QString p_name, int p_index) :
m_timers.append(timer3);
QTimer* timer4 = new QTimer();
m_timers.append(timer4);
if (configured_evi_mod == "cm")
m_eviMod = EvidenceMod::CM;
else if (configured_evi_mod == "mod")
m_eviMod = EvidenceMod::MOD;
else if (configured_evi_mod == "hiddencm")
m_eviMod = EvidenceMod::HIDDEN_CM;
else
m_eviMod = EvidenceMod::FFA;
}
const QMap<QString, AreaData::Status> AreaData::map_statuses = {

View File

@ -162,7 +162,7 @@ int ConfigManager::webaoPort()
DataTypes::AuthType ConfigManager::authType()
{
QString l_auth = m_settings->value("Options/auth", "simple").toString();
QString l_auth = m_settings->value("Options/auth", "simple").toString().toUpper();
return toDataType<DataTypes::AuthType>(l_auth);
}
@ -184,7 +184,7 @@ int ConfigManager::logBuffer()
DataTypes::LogType ConfigManager::loggingType()
{
QString l_log = m_settings->value("Options/logging", "modcall").toString();
QString l_log = m_settings->value("Options/logging", "modcall").toString().toUpper();
return toDataType<DataTypes::LogType>(l_log);
}