New privuser gummys (#2305)

* New user gummys based on account privilege level

This change add's new user gummy icons for vip/donator priv levels that
are now available.

YaY for Zach!
This commit is contained in:
woogerboy21 2016-12-08 19:52:25 -08:00 committed by Zach H
parent e0636db60d
commit 960ecaaeda
18 changed files with 1967 additions and 34 deletions

View file

@ -505,38 +505,38 @@ ServerInfo_User Servatrice_DatabaseInterface::evalUserQueryResult(const QSqlQuer
if (!country.isEmpty())
result.set_country(country.toStdString());
const QString privlevel = query->value(4).toString();
if (!privlevel.isEmpty())
result.set_privlevel(privlevel.toStdString());
if (complete) {
const QString genderStr = query->value(4).toString();
const QString genderStr = query->value(5).toString();
if (genderStr == "m")
result.set_gender(ServerInfo_User::Male);
else if (genderStr == "f")
result.set_gender(ServerInfo_User::Female);
const QString realName = query->value(5).toString();
const QString realName = query->value(6).toString();
if (!realName.isEmpty())
result.set_real_name(realName.toStdString());
const QByteArray avatarBmp = query->value(6).toByteArray();
const QByteArray avatarBmp = query->value(7).toByteArray();
if (avatarBmp.size())
result.set_avatar_bmp(avatarBmp.data(), avatarBmp.size());
const QDateTime regDate = query->value(7).toDateTime();
if(!regDate.toString(Qt::ISODate).isEmpty()) {
const QDateTime regDate = query->value(8).toDateTime();
if (!regDate.toString(Qt::ISODate).isEmpty()) {
qint64 accountAgeInSeconds = regDate.secsTo(QDateTime::currentDateTime());
result.set_accountage_secs(accountAgeInSeconds);
}
const QString email = query->value(8).toString();
const QString email = query->value(9).toString();
if (!email.isEmpty())
result.set_email(email.toStdString());
const QString clientid = query->value(9).toString();
const QString clientid = query->value(10).toString();
if (!clientid.isEmpty())
result.set_clientid(clientid.toStdString());
const QString privlevel = query->value(10).toString();
if (!privlevel.isEmpty())
result.set_privlevel(privlevel.toStdString());
}
return result;
}
@ -551,7 +551,7 @@ ServerInfo_User Servatrice_DatabaseInterface::getUserData(const QString &name, b
if (!checkSql())
return result;
QSqlQuery *query = prepareQuery("select id, name, admin, country, gender, realname, avatar_bmp, registrationDate, email, clientid, privlevel from {prefix}_users where name = :name and active = 1");
QSqlQuery *query = prepareQuery("select id, name, admin, country, privlevel, gender, realname, avatar_bmp, registrationDate, email, clientid from {prefix}_users where name = :name and active = 1");
query->bindValue(":name", name);
if (!execSqlQuery(query))
return result;
@ -560,7 +560,8 @@ ServerInfo_User Servatrice_DatabaseInterface::getUserData(const QString &name, b
return evalUserQueryResult(query, true, withId);
else
return result;
} else
}
else
return result;
}
@ -641,7 +642,7 @@ QMap<QString, ServerInfo_User> Servatrice_DatabaseInterface::getBuddyList(const
if (server->getAuthenticationMethod() == Servatrice::AuthenticationSql) {
checkSql();
QSqlQuery *query = prepareQuery("select a.id, a.name, a.admin, a.country from {prefix}_users a left join {prefix}_buddylist b on a.id = b.id_user2 left join {prefix}_users c on b.id_user1 = c.id where c.name = :name");
QSqlQuery *query = prepareQuery("select a.id, a.name, a.admin, a.country, a.privlevel from {prefix}_users a left join {prefix}_buddylist b on a.id = b.id_user2 left join {prefix}_users c on b.id_user1 = c.id where c.name = :name");
query->bindValue(":name", name);
if (!execSqlQuery(query))
return result;
@ -661,7 +662,7 @@ QMap<QString, ServerInfo_User> Servatrice_DatabaseInterface::getIgnoreList(const
if (server->getAuthenticationMethod() == Servatrice::AuthenticationSql) {
checkSql();
QSqlQuery *query = prepareQuery("select a.id, a.name, a.admin, a.country from {prefix}_users a left join {prefix}_ignorelist b on a.id = b.id_user2 left join {prefix}_users c on b.id_user1 = c.id where c.name = :name");
QSqlQuery *query = prepareQuery("select a.id, a.name, a.admin, a.country, a.privlevel from {prefix}_users a left join {prefix}_ignorelist b on a.id = b.id_user2 left join {prefix}_users c on b.id_user1 = c.id where c.name = :name");
query->bindValue(":name", name);
if (!execSqlQuery(query))
return result;