diff --git a/src/area_data.cpp b/src/area_data.cpp index a2d9373..0036af3 100644 --- a/src/area_data.cpp +++ b/src/area_data.cpp @@ -28,13 +28,13 @@ AreaData::AreaData(QStringList characters, QString p_name, int p_index) areas_ini.beginGroup(p_name); background = areas_ini.value("background", "gs4").toString(); is_protected = areas_ini.value("protected_area").toBool(); + bg_locked = areas_ini.value("bg_locked", "false").toBool(); areas_ini.endGroup(); player_count = 0; locked = FREE; status = "FREE"; def_hp = 10; pro_hp = 10; - bg_locked = false; document = "No document."; QSettings config_ini("config/config.ini", QSettings::IniFormat); config_ini.beginGroup("Options"); diff --git a/src/commands.cpp b/src/commands.cpp index 6abee2f..dcbacf0 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -37,12 +37,15 @@ void AOClient::cmdLogin(int argc, QStringList argv) return; } - // TODO: tell the user if no modpass is set if (auth_type == "simple") { - if(argv[0] == modpass) { + if (modpass == "") { + sendServerMessage("No modpass is set! Please set a modpass before authenticating."); + } + else if(argv[0] == modpass) { sendServerMessage("Logged in as a moderator."); // This string has to be exactly this, because it is hardcoded in the client authenticated = true; - } else { + } + else { sendServerMessage("Incorrect password."); } server->areas.value(current_area)->logger->logLogin(this, authenticated, "moderator"); @@ -181,8 +184,6 @@ void AOClient::cmdSetRootPass(int argc, QStringList argv) void AOClient::cmdSetBackground(int argc, QStringList argv) { - // TODO: area locks in areas.ini - // TODO: sendServerMessage but area broadcast AreaData* area = server->areas[current_area]; if (authenticated || !area->bg_locked) { if (server->backgrounds.contains(argv[0])) { diff --git a/src/packets.cpp b/src/packets.cpp index 619849d..9c7ce83 100644 --- a/src/packets.cpp +++ b/src/packets.cpp @@ -32,7 +32,7 @@ void AOClient::pktHardwareId(AreaData* area, int argc, QStringList argv, AOPacke socket->close(); return; } - sendPacket("ID", {"271828", "akashi", QCoreApplication::applicationVersion()}); + sendPacket("ID", {QString::number(id), "akashi", QCoreApplication::applicationVersion()}); } void AOClient::pktSoftwareId(AreaData* area, int argc, QStringList argv, AOPacket packet)