diff --git a/code/modules/admin/IsBanned.dm b/code/modules/admin/IsBanned.dm index 4122ddf8..7eb93631 100644 --- a/code/modules/admin/IsBanned.dm +++ b/code/modules/admin/IsBanned.dm @@ -6,7 +6,7 @@ world/IsBanned(key,address,computer_id) return ..() //Making the adminbot for automated bans. - var/datum/admins/Adminbot = new /datum/admins(initial_rank = "Friendly Robot", initial_rights = 8196, "Adminbot") + var/datum/admins/Adminbot = new /datum/admins("Friendly Robot", 8196, "Adminbot") //Guest Checking if(!guests_allowed && IsGuestKey(key)) @@ -53,7 +53,7 @@ world/IsBanned(key,address,computer_id) message_mods("\blue Failed Login: [key] - Blacklisted IP. User banned.") var/reason = "This IP has been blacklisted from the server." - Adminbot.DB_ban_record(BANTYPE_PERMA, null, null, reason, null, null, ckey(key), 1, address, computer_id) + Adminbot.DB_ban_record(1, null, null, reason, null, null, ckey(key), 1, address, computer_id) notes_add_sql(key, reason, null, address, computer_id) del Adminbot @@ -128,7 +128,7 @@ world/IsBanned(key,address,computer_id) if(multikey) desc = "\nReason: You, or another user of this computer or connection ([pckey]) is banned from playing here. The ban reason is:\nThis is an automatic ban for attempted bandodging. The original ban reason is this: [reason]\nThis ban was applied by [ackey] on [bantime], [expires]" var/newreason = "This is an automatic ban for attempted bandodging. The original ban reason: [reason]." - Adminbot.DB_ban_record(BANTYPE_PERMA, null, null, reason, null, null, ckey(key), 1, address, computer_id) + Adminbot.DB_ban_record(1, null, null, reason, null, null, ckey(key), 1, address, computer_id) notes_add_sql(key, newreason, null, address, computer_id) del Adminbot diff --git a/code/modules/admin/player_notes_sql.dm b/code/modules/admin/player_notes_sql.dm index 6e7ea6ae..f46fe12b 100644 --- a/code/modules/admin/player_notes_sql.dm +++ b/code/modules/admin/player_notes_sql.dm @@ -21,8 +21,10 @@ if(!IP || !CID) var/DBQuery/initquery = dbcon.NewQuery("SELECT ip, computerid FROM erro_player WHERE ckey = '[ckey]'") - IP = initquery.item[1] - CID = initquery.item[2] + initquery.Execute() + if(initquery.NextRow()) + IP = initquery.item[1] + CID = initquery.item[2] var/querycontents if(IP && CID) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 144b463f..d3f0b078 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -2774,10 +2774,12 @@ else var/IP var/CID - var/client/C = directory[key] - if(C) - IP = C.address - CID = C.computer_id + if(directory[key]) + var/client/C = directory[key] + if(C) + IP = C.address + CID = C.computer_id + notes_add_sql(key, add, usr, IP, CID) show_player_info(key)