diff --git a/bin/config_sample/areas.ini b/bin/config_sample/areas.ini index 14f79ca..98bd00d 100644 --- a/bin/config_sample/areas.ini +++ b/bin/config_sample/areas.ini @@ -1,5 +1,9 @@ [Basement] background=gs4 +protected_area=true +iniswap_allowed=false [Courtroom 1] background=gs4 +protected_area=false +iniswap_allowed=true \ No newline at end of file diff --git a/src/area_data.cpp b/src/area_data.cpp index 0036af3..fa867a6 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(); bg_locked = areas_ini.value("bg_locked", "false").toBool(); areas_ini.endGroup(); player_count = 0; diff --git a/src/packets.cpp b/src/packets.cpp index d36a96e..ad68d78 100644 --- a/src/packets.cpp +++ b/src/packets.cpp @@ -363,10 +363,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());