Merge pull request #17 from AttorneyOnline/small-bits

Take care of some TODOs, fix UID not being sent in HWID function
This commit is contained in:
scatterflower 2021-03-09 14:03:32 -06:00 committed by GitHub
commit 6bbe257aee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 7 deletions

View File

@ -28,13 +28,13 @@ AreaData::AreaData(QStringList characters, QString p_name, int p_index)
areas_ini.beginGroup(p_name); areas_ini.beginGroup(p_name);
background = areas_ini.value("background", "gs4").toString(); background = areas_ini.value("background", "gs4").toString();
is_protected = areas_ini.value("protected_area").toBool(); is_protected = areas_ini.value("protected_area").toBool();
bg_locked = areas_ini.value("bg_locked", "false").toBool();
areas_ini.endGroup(); areas_ini.endGroup();
player_count = 0; player_count = 0;
locked = FREE; locked = FREE;
status = "FREE"; status = "FREE";
def_hp = 10; def_hp = 10;
pro_hp = 10; pro_hp = 10;
bg_locked = false;
document = "No document."; document = "No document.";
QSettings config_ini("config/config.ini", QSettings::IniFormat); QSettings config_ini("config/config.ini", QSettings::IniFormat);
config_ini.beginGroup("Options"); config_ini.beginGroup("Options");

View File

@ -37,12 +37,15 @@ void AOClient::cmdLogin(int argc, QStringList argv)
return; return;
} }
// TODO: tell the user if no modpass is set
if (auth_type == "simple") { 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 sendServerMessage("Logged in as a moderator."); // This string has to be exactly this, because it is hardcoded in the client
authenticated = true; authenticated = true;
} else { }
else {
sendServerMessage("Incorrect password."); sendServerMessage("Incorrect password.");
} }
server->areas.value(current_area)->logger->logLogin(this, authenticated, "moderator"); 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) void AOClient::cmdSetBackground(int argc, QStringList argv)
{ {
// TODO: area locks in areas.ini
// TODO: sendServerMessage but area broadcast
AreaData* area = server->areas[current_area]; AreaData* area = server->areas[current_area];
if (authenticated || !area->bg_locked) { if (authenticated || !area->bg_locked) {
if (server->backgrounds.contains(argv[0])) { if (server->backgrounds.contains(argv[0])) {

View File

@ -32,7 +32,7 @@ void AOClient::pktHardwareId(AreaData* area, int argc, QStringList argv, AOPacke
socket->close(); socket->close();
return; 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) void AOClient::pktSoftwareId(AreaData* area, int argc, QStringList argv, AOPacket packet)