mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 09:31:30 +00:00
CheckBannedIPs converted to StringFormat
This commit is contained in:
parent
98ebbd50a1
commit
b23fb0e635
@ -181,20 +181,16 @@ uint32 Database::CheckLogin(const char* name, const char* password, int16* oStat
|
|||||||
//Get Banned IP Address List - Only return false if the incoming connection's IP address is not present in the banned_ips table.
|
//Get Banned IP Address List - Only return false if the incoming connection's IP address is not present in the banned_ips table.
|
||||||
bool Database::CheckBannedIPs(const char* loginIP)
|
bool Database::CheckBannedIPs(const char* loginIP)
|
||||||
{
|
{
|
||||||
char *query = nullptr;
|
std::string query = StringFormat("SELECT ip_address FROM Banned_IPs WHERE ip_address='%s'", loginIP);
|
||||||
|
|
||||||
auto results = QueryDatabase(query, MakeAnyLenString(&query, "SELECT ip_address FROM Banned_IPs WHERE ip_address='%s'", loginIP));
|
|
||||||
|
|
||||||
|
auto results = QueryDatabase(query);
|
||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
{
|
{
|
||||||
std::cerr << "Error in CheckBannedIPs query '" << query << "' " << results.ErrorMessage() << std::endl;
|
std::cerr << "Error in CheckBannedIPs query '" << query << "' " << results.ErrorMessage() << std::endl;
|
||||||
safe_delete_array(query);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
safe_delete_array(query);
|
|
||||||
|
|
||||||
if (results.RowCount() != 0)
|
if (results.RowCount() != 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user