From 088b34064f9dba7a81284d11e4670a2fe5525b74 Mon Sep 17 00:00:00 2001 From: in1tiate Date: Tue, 9 Mar 2021 13:23:32 -0600 Subject: [PATCH] add iniswap locking --- src/area_data.cpp | 3 ++- src/packets.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/area_data.cpp b/src/area_data.cpp index a2d9373..d49237e 100644 --- a/src/area_data.cpp +++ b/src/area_data.cpp @@ -27,7 +27,8 @@ AreaData::AreaData(QStringList characters, QString p_name, int p_index) QSettings areas_ini("config/areas.ini", QSettings::IniFormat); areas_ini.beginGroup(p_name); background = areas_ini.value("background", "gs4").toString(); - is_protected = areas_ini.value("protected_area").toBool(); + is_protected = areas_ini.value("protected_area", "false").toBool(); + iniswap_allowed = areas_ini.value("iniswap_allowed", "true").toBool(); areas_ini.endGroup(); player_count = 0; locked = FREE; diff --git a/src/packets.cpp b/src/packets.cpp index 619849d..30f965f 100644 --- a/src/packets.cpp +++ b/src/packets.cpp @@ -362,10 +362,10 @@ AOPacket AOClient::validateIcPacket(AOPacket packet) if (current_char != incoming_args[2].toString()) { // Selected char is different from supplied folder name // This means the user is INI-swapped - // TODO: ini swap locking - // if no iniswap allowed then - // if (!server->characters.contains(incoming_args[2].toString())) - // return invalid; + if (!area->iniswap_allowed) { + if (!server->characters.contains(incoming_args[2].toString())) + return invalid; + } qDebug() << "INI swap detected from " << getIpid(); } args.append(incoming_args[2].toString());