Minor ban message tweaks

This commit is contained in:
Jackzie 2022-01-27 11:02:55 -06:00
parent ff10667846
commit 77d37ef0ad
No known key found for this signature in database
GPG key ID: 76DF30177DC69DB4
2 changed files with 8 additions and 9 deletions

Binary file not shown.

View file

@ -154,7 +154,7 @@ public void DB_OnConnectCheck(Database db, DBResultSet results, const char[] err
KickClient(client, "Could not authenticate at this time."); KickClient(client, "Could not authenticate at this time.");
LogMessage("Could not connect to database to authorize user '%N' (#%d)", client, user); LogMessage("Could not connect to database to authorize user '%N' (#%d)", client, user);
} }
}else{ } else {
//No failure, check the data. //No failure, check the data.
if(results.RowCount > 0 && client) { if(results.RowCount > 0 && client) {
results.FetchRow(); results.FetchRow();
@ -164,23 +164,22 @@ public void DB_OnConnectCheck(Database db, DBResultSet results, const char[] err
bool expired = results.FetchInt(2) == 1; bool expired = results.FetchInt(2) == 1;
if(results.IsFieldNull(2)) { if(results.IsFieldNull(2)) {
DeleteBan(steamid); DeleteBan(steamid);
}else{ } else {
results.FetchString(0, reason, sizeof(reason), reasonResult); results.FetchString(0, reason, sizeof(reason), reasonResult);
if(!expired) { if(!expired) {
if(hKickType.IntValue > 0) { if(hKickType.IntValue > 0) {
if(reasonResult == DBVal_Data) if(reasonResult == DBVal_Data)
KickClient(client, "You have been banned: %s", reason); KickClient(client, "You have been banned:\n%s", reason);
else else
KickClient(client, "You have been banned from this server."); KickClient(client, "You have been banned from this server.");
static char query[128];
g_db.Format(query, sizeof(query), "UPDATE bans SET times_tried=times_tried+1 WHERE steamid = '%s'", steamid);
g_db.Query(DB_OnBanQuery, query);
} else { } else {
PrintChatToAdmins("%N was banned from this server for: \"%s\"", client, reason); PrintChatToAdmins("%N was banned from this server for: \"%s\"", client, reason);
return;
} }
static char query[128]; } else {
g_db.Format(query, sizeof(query), "UPDATE bans SET times_tried=times_tried+1 WHERE steamid = '%s'", steamid); PrintChatToAdmins("%N was previously banned for \"%s\"", client, reason);
g_db.Query(DB_OnBanQuery, query);
}else{
PrintChatToAdmins("%N has a previously expired ban of reason \"%s\"", client, reason);
} }
} }
} }