void AOClient::loginAttempt(QString message)
{
    switch (ConfigManager::authType()) {
    case DataTypes::AuthType::SIMPLE:
        if (message == ConfigManager::modpass()) {
            sendPacket("AUTH", {"1"}); // Client: "You were granted the Disable Modcalls button."
            sendServerMessage("Logged in as a moderator."); // pre-2.9.1 clients are hardcoded to display the mod UI when this string is sent in OOC
            authenticated = true;
        }
        else {
            sendPacket("AUTH", {"0"}); // Client: "Login unsuccessful."
            sendServerMessage("Incorrect password.");
        }
        server->areas.value(current_area)->logLogin(current_char, ipid, authenticated, "moderator");
        break;
    case DataTypes::AuthType::ADVANCED:
        QStringList login = message.split(" ");
        if (login.size() < 2) {
            sendServerMessage("You must specify a username and a password");
            sendServerMessage("Exiting login prompt.");
            is_logging_in = false;
            return;
        }
        QString username = login[0];
        QString password = login[1];
        if (server->db_manager->authenticate(username, password)) {
            moderator_name = username;
            authenticated = true;
            sendPacket("AUTH", {"1"}); // Client: "You were granted the Disable Modcalls button."
            if (version.release <= 2 && version.major <= 9 && version.minor <= 0)
                sendServerMessage("Logged in as a moderator."); // pre-2.9.1 clients are hardcoded to display the mod UI when this string is sent in OOC
            sendServerMessage("Welcome, " + username);
        }
        else {
            sendPacket("AUTH", {"0"}); // Client: "Login unsuccessful."
            sendServerMessage("Incorrect password.");
        }
        server->areas.value(current_area)->logLogin(current_char, ipid, authenticated, username);
        break;
    }
    sendServerMessage("Exiting login prompt.");
    is_logging_in = false;
    return;
}
void AOClient::loginAttempt(QString message)
{
    switch (ConfigManager::authType()) {
    case DataTypes::AuthType::SIMPLE:
        if (message == ConfigManager::modpass()) {
            sendPacket("AUTH", {"1"});  
            sendServerMessage("Logged in as a moderator.");  
            authenticated = true;
        }
        else {
            sendPacket("AUTH", {"0"});  
            sendServerMessage("Incorrect password.");
        }
        server->areas.value(current_area)->logLogin(current_char, ipid, authenticated, "moderator");
        break;
    case DataTypes::AuthType::ADVANCED:
        QStringList login = message.split(" ");
        if (login.size() < 2) {
            sendServerMessage("You must specify a username and a password");
            sendServerMessage("Exiting login prompt.");
            is_logging_in = false;
            return;
        }
        QString username = login[0];
        QString password = login[1];
        if (server->db_manager->authenticate(username, password)) {
            moderator_name = username;
            authenticated = true;
            sendPacket("AUTH", {"1"});  
            if (version.release <= 2 && version.major <= 9 && version.minor <= 0)
                sendServerMessage("Logged in as a moderator.");  
            sendServerMessage("Welcome, " + username);
        }
        else {
            sendPacket("AUTH", {"0"});  
            sendServerMessage("Incorrect password.");
        }
        server->areas.value(current_area)->logLogin(current_char, ipid, authenticated, username);
        break;
    }
    sendServerMessage("Exiting login prompt.");
    is_logging_in = false;
    return;
}