From 3679a510e5db5d2d70135f664dc76ae02a85332b Mon Sep 17 00:00:00 2001 From: SoundScopes Date: Mon, 8 Jun 2015 19:20:35 +0100 Subject: [PATCH 1/5] PM name fix --- code/modules/admin/verbs/adminpm.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index 44f0b861..8fb8c70f 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -111,13 +111,13 @@ var/options = "" if(C.holder && C.holder.rights & (R_ADMIN|R_MOD|R_FUN|R_DEV)) - options = "[get_options_bar(src, 1, 1, 1)]" + options = "[get_options_bar(src, 1, 1, 1)]" //Gib the information om nom nom else - options = "[get_options_bar(src, 0, 0, 1)]" + options = "[get_options_bar(src, 0, 0, 1)]" //Hide it, just gib name recieve_message = "[recieve_pm_type] PM from-[options]: [msg]" C << recieve_message - src << "[send_pm_type]PM to-[options]: [msg]" + src << "[send_pm_type]PM to-[get_options_bar(C, 0, 0, 1)]: [msg]" //play the recieving admin the adminhelp sound (if they have them enabled) //non-admins shouldn't be able to disable this From d11456a5861d9be94b0b917dcbf61d78b4c54cec Mon Sep 17 00:00:00 2001 From: skull132 Date: Mon, 8 Jun 2015 21:35:26 +0300 Subject: [PATCH 2/5] Fixes for notes * Fixes the dumb with the caller name saving * Disables the transfer proc --- code/modules/admin/player_notes_sql.dm | 12 ++++++------ code/modules/admin/topic.dm | 6 +++--- code/modules/admin/verbs/warning.dm | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/code/modules/admin/player_notes_sql.dm b/code/modules/admin/player_notes_sql.dm index 9e59318e..6e7ea6ae 100644 --- a/code/modules/admin/player_notes_sql.dm +++ b/code/modules/admin/player_notes_sql.dm @@ -1,7 +1,7 @@ //System will now support SQL pulls for fetching player notes. //Yay! -/proc/notes_add_sql(var/key, var/note, var/usr, var/IP, var/CID) +/proc/notes_add_sql(var/key, var/note, var/mob/usr, var/IP, var/CID) if(!key || !note) return @@ -10,7 +10,7 @@ var/a_ckey if(usr) - a_ckey = sanitizeSQL(usr) + a_ckey = sanitizeSQL(usr.key) else a_ckey = "Adminbot" @@ -161,7 +161,7 @@ if(adminckey && ckey(a_ckey) != ckey(adminckey)) continue else - dat += "[p_ckey][a_ckey][date]
[content]
" + dat += "[p_ckey][a_ckey][date][content]" if(edited) var/lasteditor = query.item[7] var/editdate = query.item[8] @@ -183,7 +183,7 @@ var/content = adminquery.item[4] var/edited = text2num(adminquery.item[5]) - dat += "[p_ckey][adminckey][date]
[content]
" + dat += "[p_ckey][adminckey][date][content]" if(edited) var/lasteditor = adminquery.item[6] var/editdate = adminquery.item[7] @@ -194,7 +194,7 @@ dat += "" usr << browse(dat,"window=lookupnotes;size=900x500") -/proc/notes_transfer() +/*/proc/notes_transfer() msg_scopes("Locating master list.") var/savefile/note_list = new("data/player_notes.sav") var/list/note_keys @@ -270,4 +270,4 @@ if(insertquery.ErrorMsg()) msg_scopes(insertquery.ErrorMsg()) else - msg_scopes("Transfer successful.") \ No newline at end of file + msg_scopes("Transfer successful.")*/ diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index fe68382b..144b463f 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -909,7 +909,7 @@ message_admins("\blue[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.") if(!config.ban_legacy_system) - notes_add_sql(M.ckey, "Banned for: [reason]. Duration: [mins] minutes.", usr.client.ckey, M.lastKnownIP, M.computer_id) + notes_add_sql(M.ckey, "Banned for: [reason]. Duration: [mins] minutes.", usr, M.lastKnownIP, M.computer_id) del(M.client) //del(M) // See no reason why to delete mob. Important stuff can be lost. And ban can be lifted before round ends. @@ -937,7 +937,7 @@ DB_ban_record(BANTYPE_PERMA, M, -1, reason) if(!config.ban_legacy_system) - notes_add_sql(M.ckey, "Banned for: [reason]. The ban is permanent.", usr.client.ckey, M.lastKnownIP, M.computer_id) + notes_add_sql(M.ckey, "Banned for: [reason]. The ban is permanent.", usr, M.lastKnownIP, M.computer_id) del(M.client) //del(M) @@ -2778,7 +2778,7 @@ if(C) IP = C.address CID = C.computer_id - notes_add_sql(key, add, src.owner:ckey, IP, CID) + notes_add_sql(key, add, usr, IP, CID) show_player_info(key) diff --git a/code/modules/admin/verbs/warning.dm b/code/modules/admin/verbs/warning.dm index 9334bc25..322b1a50 100644 --- a/code/modules/admin/verbs/warning.dm +++ b/code/modules/admin/verbs/warning.dm @@ -114,7 +114,7 @@ if(config.ban_legacy_system) notes_add(warned_ckey, "Warning added by [a_ckey], for: [reason]. || Notes regarding the warning: [notes].") else - notes_add_sql(warned_ckey, "Warning added by [a_ckey], for: [reason]. || Notes regarding the warning: [notes].", a_ckey, ip, computerid) + notes_add_sql(warned_ckey, "Warning added by [a_ckey], for: [reason]. || Notes regarding the warning: [notes].", src, ip, computerid) feedback_add_details("admin_verb","WARN-DB") if(C) From 2045a76dc0b198367cadb70f0a094901529e3509 Mon Sep 17 00:00:00 2001 From: SoundScopes Date: Mon, 8 Jun 2015 19:41:27 +0100 Subject: [PATCH 3/5] Stealth Looc --- code/game/verbs/ooc.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/game/verbs/ooc.dm b/code/game/verbs/ooc.dm index 9dfd9000..af695044 100644 --- a/code/game/verbs/ooc.dm +++ b/code/game/verbs/ooc.dm @@ -201,7 +201,8 @@ var/global/normal_ooc_colour = "#002eb8" if(C.prefs.toggles & CHAT_LOOC) var/stealth = "" if(C.holder && C.holder.rights & (R_ADMIN|R_MOD)) - stealth = "(stealth)" + if(C.holder.fakekey) + stealth = "(stealth)" var/prefix = "(R)LOOC" if (C.mob in heard) prefix = "LOOC" From 4e1f30df5f9c67a6ee5e6f2632a509d8f1ae33ee Mon Sep 17 00:00:00 2001 From: skull132 Date: Mon, 8 Jun 2015 23:37:23 +0300 Subject: [PATCH 4/5] Autobanner fix Never code late at night. Fixed the datum creation. --- code/modules/admin/IsBanned.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 From 8a0e383458a4cb234e0910bf49efee3fee19e2da Mon Sep 17 00:00:00 2001 From: skull132 Date: Mon, 8 Jun 2015 23:40:21 +0300 Subject: [PATCH 5/5] SQL notes fix Now fetches actual data, so that it doesn't return null-strings. And also checks if a client is still present or not. --- code/modules/admin/player_notes_sql.dm | 6 ++++-- code/modules/admin/topic.dm | 10 ++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) 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)