I would like to post my observation when using amxbans on LAN server.
This select is not good on LAN server, because everybody have steamid equal to STEAM_ID_LAN, so it keeps saying PLAYER_BANNED_BEFORE all the time:
Code:
format(query_bancount,4096,"SELECT * FROM `%s` WHERE ((player_id='%s') and ((ban_type='S') or (ban_type='SI'))) or ((player_ip='%s') and (ban_type='SI'))",tbl_banhist,player_steamid,player_ip)
I think, IF clause would do the right job.
I also don't understand why in select few lines lower is not checked every line in amxx_bans table for IP and also for STEAM_ID:
Code:
format(query,4096,"SELECT bid,ban_created,ban_length,ban_reason,admin_nick,admin_id,player_nick,server_name,server_ip,ban_type FROM `%s` WHERE ((player_id='%s') and ((ban_type='S') or (ban_type='SI'))) or ((player_ip='%s') and (ban_type='SI'))",tbl_bans,player_steamid,player_ip)
New select can look like this:
Code:
format(query,4096,"SELECT bid,ban_created,ban_length,ban_reason,admin_nick,admin_id,player_nick,server_name,server_ip,ban_type FROM `%s` WHERE player_id='%s' or player_ip='%s'",tbl_bans,player_steamid,player_ip)
But the worst think I discovered is SQL update which updates all IP address based on users steamid. Once again, all players on LAN has variable player_steamid = "", so anytime this update do the job, I get all IP address in amxx_bans table overwritten:
Code:
Retval = dbi_query(sql,"UPDATE `%s` SET player_ip='%s' WHERE player_id='%s'", tbl_bans, player_ip, player_steamid)
I also fix this with IF clause.
Code:
if (equal(ban_type, "S"))
{
Retval = dbi_query(sql,"UPDATE `%s` SET player_ip='%s' WHERE player_id='%s'", tbl_bans, player_ip, player_steamid)
}
else
{
Retval = dbi_query(sql,"UPDATE `%s` SET player_id='%s' WHERE player_ip='%s'", tbl_bans, player_steamid, player_ip)
}
Any comments would be appreciated
__________________