Improper forced qdel cleanup, some expanded del all verbs (#66595)

* Removes all supurfolus uses of QDEL_HINT_LETMELIVE

This define exists to allow abstract, sturucturally important things to
opt out of being qdeleted.
It does not exist to be a "Immune to everything" get out of jail free
card.
We have systems for this, and it's not appropriate here.

This change is inherently breaking, because things might be improperly
qdeling these things. Those issues will need to be resolved in future,
as they pop up

* Changes all needless uses of COMSIG_PARENT_PREQDELETED

It exists for things that want to block the qdel. If that's not you,
don't use it

* Adds force and hard del verbs, for chip and break glass cases
respectively

The harddel verb comes with two options before it's run, to let you
tailor it to your level of fucked

* Damn you nova

Adds proper parent returns instead of . = ..()

Co-authored-by: Seth Scherer <supernovaa41@gmx.com>

* Ensures immortality talismans cannot delete their human if something goes fuckey. Thanks ath/oro for pointing this out

Co-authored-by: Seth Scherer <supernovaa41@gmx.com>
This commit is contained in:
LemonInTheDark
2022-05-06 17:52:45 -07:00
committed by GitHub
parent d61fa9df81
commit 0504c0a2b4
20 changed files with 153 additions and 98 deletions
+6
View File
@@ -126,6 +126,8 @@ GLOBAL_PROTECT(admin_verbs_server)
/datum/admins/proc/toggleAI,
/client/proc/cmd_admin_delete, /*delete an instance/object/mob/etc*/
/client/proc/cmd_debug_del_all,
/client/proc/cmd_debug_force_del_all,
/client/proc/cmd_debug_hard_del_all,
/client/proc/toggle_random_events,
/client/proc/forcerandomrotate,
/client/proc/adminchangemap,
@@ -146,6 +148,8 @@ GLOBAL_PROTECT(admin_verbs_debug)
/client/proc/cmd_debug_mob_lists,
/client/proc/cmd_admin_delete,
/client/proc/cmd_debug_del_all,
/client/proc/cmd_debug_force_del_all,
/client/proc/cmd_debug_hard_del_all,
/client/proc/restart_controller,
/client/proc/enable_mapping_verbs,
/client/proc/callproc,
@@ -257,6 +261,8 @@ GLOBAL_LIST_INIT(admin_verbs_hideable, list(
/client/proc/cmd_debug_make_powernets,
/client/proc/cmd_debug_mob_lists,
/client/proc/cmd_debug_del_all,
/client/proc/cmd_debug_force_del_all,
/client/proc/cmd_debug_hard_del_all,
/client/proc/enable_mapping_verbs,
/proc/possess,
/proc/release,
+88 -16
View File
@@ -69,30 +69,102 @@
SSpai.candidates.Remove(candidate)
SSblackbox.record_feedback("tally", "admin_verb", 1, "Make pAI") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/poll_type_to_del(search_string)
var/list/types = get_fancy_list_of_atom_types()
if (!isnull(search_string) && search_string != "")
types = filter_fancy_list(types, search_string)
if(!length(types))
return
var/key = input(usr, "Choose an object to delete.", "Delete:") as null|anything in sort_list(types)
if(!key)
return
return types[key]
//TODO: merge the vievars version into this or something maybe mayhaps
/client/proc/cmd_debug_del_all(object as text)
set category = "Debug"
set name = "Del-All"
var/list/matches = get_fancy_list_of_atom_types()
if (!isnull(object) && object!="")
matches = filter_fancy_list(matches, object)
var/type_to_del = poll_type_to_del(object)
if(matches.len==0)
if(!type_to_del)
return
var/hsbitem = input(usr, "Choose an object to delete.", "Delete:") as null|anything in sort_list(matches)
if(hsbitem)
hsbitem = matches[hsbitem]
var/counter = 0
for(var/atom/O in world)
if(istype(O, hsbitem))
counter++
qdel(O)
CHECK_TICK
log_admin("[key_name(src)] has deleted all ([counter]) instances of [hsbitem].")
message_admins("[key_name_admin(src)] has deleted all ([counter]) instances of [hsbitem].")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Delete All") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
var/counter = 0
for(var/atom/O in world)
if(istype(O, type_to_del))
counter++
qdel(O)
CHECK_TICK
log_admin("[key_name(src)] has deleted all ([counter]) instances of [type_to_del].")
message_admins("[key_name_admin(src)] has deleted all ([counter]) instances of [type_to_del].")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Delete All") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_debug_force_del_all(object as text)
set category = "Debug"
set name = "Force-Del-All"
var/type_to_del = poll_type_to_del(object)
if(!type_to_del)
return
var/counter = 0
for(var/atom/O in world)
if(istype(O, type_to_del))
counter++
qdel(O, force = TRUE)
CHECK_TICK
log_admin("[key_name(src)] has force-deleted all ([counter]) instances of [type_to_del].")
message_admins("[key_name_admin(src)] has force-deleted all ([counter]) instances of [type_to_del].")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Force-Delete All") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_debug_hard_del_all(object as text)
set category = "Debug"
set name = "Hard-Del-All"
var/type_to_del = poll_type_to_del(object)
if(!type_to_del)
return
var/choice = alert("ARE YOU SURE that you want to hard delete this type? It will cause MASSIVE lag.", "Hoooo lad what happen?", "Yes", "No")
if(choice != "Yes")
return
choice = alert("Do you want to pre qdelete the atom? This will speed things up significantly, but may break depending on your level of fuckup.", "How do you even get it that bad", "Yes", "No")
var/should_pre_qdel = TRUE
if(choice == "No")
should_pre_qdel = FALSE
choice = alert("Ok one last thing, do you want to yield to the game? or do it all at once. These are hard deletes remember.", "Jesus christ man", "Yield", "Ignore the server")
var/should_check_tick = TRUE
if(choice == "Ignore the server")
should_check_tick = FALSE
var/counter = 0
if(should_check_tick)
for(var/atom/O in world)
if(istype(O, type_to_del))
counter++
if(should_pre_qdel)
qdel(O)
del(O)
CHECK_TICK
else
for(var/atom/O in world)
if(istype(O, type_to_del))
counter++
if(should_pre_qdel)
qdel(O)
del(O)
CHECK_TICK
log_admin("[key_name(src)] has hard deleted all ([counter]) instances of [type_to_del].")
message_admins("[key_name_admin(src)] has hard deleted all ([counter]) instances of [type_to_del].")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Hard Delete All") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_debug_make_powernets()
set category = "Debug"