diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index 29e9ad28ad..4238c756ac 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -1,12 +1,15 @@ +var/list/clients = list() //list of all clients +var/list/admins = list() //list of all clients whom are admins +var/list/directory = list() //list of all ckeys with associated client + //Since it didn't really belong in any other category, I'm putting this here //This is for procs to replace all the goddamn 'in world's that are chilling around the code -var/global/list/player_list = list() //List of all logged in players **with clients attached** (Based on mob reference) -var/global/list/admin_list = list() //List of all logged in admins (Based on mob reference) +var/global/list/player_list = list() //List of all mobs **with clients attached**. Excludes /mob/new_player var/global/list/mob_list = list() //List of all mobs, including clientless -var/global/list/living_mob_list = list() //List of all living mobs, including clientless -var/global/list/dead_mob_list = list() //List of all dead mobs, including clientless -var/global/list/client_list = list() //List of all clients, based on ckey +var/global/list/living_mob_list = list() //List of all alive mobs, including clientless. Excludes /mob/new_player +var/global/list/dead_mob_list = list() //List of all dead mobs, including clientless. Excludes /mob/new_player + var/global/list/cable_list = list() //Index for all cables, so that powernets don't have to look through the entire world all the time var/global/list/hair_styles_list = list() //stores /datum/sprite_accessory/hair indexed by name var/global/list/facial_hair_styles_list = list() //stores /datum/sprite_accessory/facial_hair indexed by name @@ -32,115 +35,3 @@ var/global/list/landmarks_list = list() //list of all landmarks created var/datum/sprite_accessory/facial_hair/H = new path() facial_hair_styles_list[H.name] = H -proc/make_player_list()//Global proc that rebuilds the player list - for(var/mob/p in player_list)//Clears out everyone that logged out - if(!(p.client)) - player_list -= p - for(var/mob/M in world)//Adds everyone that has logged in - if(M.client) - player_list += M - -proc/make_admin_list()//Rebuild that shit to try and avoid issues with stealthmins - admin_list = list() - for(var/client/C in client_list) - if(C && C.holder) - admin_list += C - -proc/make_mob_list() - for(var/mob/p in mob_list) - if(!p)//If it's a null reference, remove it - mob_list -= p - for(var/mob/M in world) - mob_list += M - -proc/make_extra_mob_list() - for(var/mob/p in living_mob_list) - if(!p) - living_mob_list -= p - if(p.stat == DEAD)//Transfer - living_mob_list -= p - dead_mob_list += p - for(var/mob/p in dead_mob_list) - if(!p) - dead_mob_list -= p - if(p.stat != DEAD) - dead_mob_list -= p - living_mob_list += p - for(var/mob/M in world) - if(M.stat == DEAD) - living_mob_list += M - else - dead_mob_list += M - - -//Alright, this proc should NEVER be called in the code, ever. This is more of an 'oh god everything is broken'-emergency button. -proc/rebuild_mob_lists() - player_list = list() - admin_list = list() - mob_list = list() - living_mob_list = list() - dead_mob_list = list() - client_list = list() - for(var/mob/M in world) - mob_list += M - if(M.client) - player_list += M - if(M.stat != DEAD) - living_mob_list += M - else - dead_mob_list += M - for(var/client/C) - client_list += C.ckey - if(C.holder) - admin_list += C - -proc/add_to_mob_list(var/mob/A)//Adds an individual mob - if(A) - mob_list |= A - if(istype(A,/mob/new_player))//New players are only on the mob list, but not the dead/living - return - else - if(A.stat == 2) - dead_mob_list |= A - if(A.stat != 2) - living_mob_list |= A -// if(A.client) -// player_list |= A - -proc/remove_from_mob_list(var/mob/R)//Removes an individual mob - mob_list -= R - if(R.stat == 2) - dead_mob_list -= R - if(R.stat != 2) - living_mob_list -= R -// if(R.client) -// player_list -= R - -proc/make_client_list()//Rebuilds client list - for(var/mob/c in client_list) - if(!c.client) - client_list -= c.ckey - for(var/mob/M in world) - if(M.client) - client_list += M.ckey - - - -/*/obj/item/listdebug//Quick debugger for the global lists - icon = 'icons/obj/assemblies.dmi' - icon_state = "radio-igniter-tank" - -/obj/item/listdebug/attack_self() - switch(input("Which list?") in list("Players","Admins","Mobs","Living Mobs","Dead Mobs", "Clients")) - if("Players") - usr << dd_list2text(player_list,",") - if("Admins") - usr << dd_list2text(admin_list,",") - if("Mobs") - usr << dd_list2text(mob_list,",") - if("Living Mobs") - usr << dd_list2text(living_mob_list,",") - if("Dead Mobs") - usr << dd_list2text(dead_mob_list,",") - if("Clients") - usr << dd_list2text(client_list,",")*/ \ No newline at end of file diff --git a/code/controllers/failsafe.dm b/code/controllers/failsafe.dm index fd95e7720c..91449e10c8 100644 --- a/code/controllers/failsafe.dm +++ b/code/controllers/failsafe.dm @@ -34,12 +34,10 @@ var/datum/controller/failsafe/Failsafe if(0 to 3) MC_defcon++ if(4) - for(var/client/C in admin_list) - C << "Warning. The Master Controller has not fired in the last [MC_defcon*processing_interval] ticks. Automatic restart in [processing_interval] ticks." + admins << "Warning. The Master Controller has not fired in the last [MC_defcon*processing_interval] ticks. Automatic restart in [processing_interval] ticks." MC_defcon = 5 if(5) - for(var/client/C in admin_list) - C << "Warning. The Master Controller has still not fired within the last [MC_defcon*processing_interval] ticks. Killing and restarting..." + admins << "Warning. The Master Controller has still not fired within the last [MC_defcon*processing_interval] ticks. Killing and restarting..." new /datum/controller/game_controller() //replace the old master_controller (hence killing the old one's process) master_controller.process() //Start it rolling again MC_defcon = 0 @@ -53,12 +51,10 @@ var/datum/controller/failsafe/Failsafe if(0 to 3) lighting_defcon++ if(4) - for(var/client/C in admin_list) - C << "Warning. The Lighting Controller has not fired in the last [lighting_defcon*processing_interval] ticks. Automatic restart in [processing_interval] ticks." + admins << "Warning. The Lighting Controller has not fired in the last [lighting_defcon*processing_interval] ticks. Automatic restart in [processing_interval] ticks." lighting_defcon = 5 if(5) - for(var/client/C in admin_list) - C << "Warning. The Lighting Controller has still not fired within the last [lighting_defcon*processing_interval] ticks. Killing and restarting..." + admins << "Warning. The Lighting Controller has still not fired within the last [lighting_defcon*processing_interval] ticks. Killing and restarting..." new /datum/controller/lighting() //replace the old lighting_controller (hence killing the old one's process) lighting_controller.process() //Start it rolling again lighting_defcon = 0 diff --git a/code/controllers/voting.dm b/code/controllers/voting.dm index 2cf82f1123..b4c8ac2f89 100644 --- a/code/controllers/voting.dm +++ b/code/controllers/voting.dm @@ -61,7 +61,7 @@ datum/controller/vote greatest_votes = votes //default-vote for everyone who didn't vote if(!config.vote_no_default && choices.len) - var/non_voters = (client_list.len - total_votes) + var/non_voters = (clients.len - total_votes) if(non_voters > 0) if(mode == "restart") choices["Continue Playing"] += non_voters diff --git a/code/defines/procs/statistics.dm b/code/defines/procs/statistics.dm index bf4caa111c..b667857e2d 100644 --- a/code/defines/procs/statistics.dm +++ b/code/defines/procs/statistics.dm @@ -21,10 +21,7 @@ proc/sql_poll_players() proc/sql_poll_admins() if(!sqllogging) return - var/admincount = 0 - for (var/client/C in admin_list) - if(C) - admincount += 1 + var/admincount = admins.len var/DBConnection/dbcon = new() dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]") if(!dbcon.IsConnected()) diff --git a/code/game/verbs/who.dm b/code/game/verbs/who.dm index fb5fa7fac0..4c88dd127d 100644 --- a/code/game/verbs/who.dm +++ b/code/game/verbs/who.dm @@ -1,44 +1,24 @@ -proc/get_all_clients() - var/list/client/clients = list() - for (var/mob/M in player_list) - - clients += M.client - - return clients - -proc/get_all_admin_clients() - var/list/client/clients = list() - - for (var/client/C in admin_list) - - clients += C - - return clients - - -/mob/verb/who() +/client/verb/who() set name = "Who" set category = "OOC" - usr << "Current Players:" + var/msg = "Current Players:\n" - var/list/peeps = list() + var/list/Lines = list() - for (var/client/C in client_list) - var/entry = "\t" - if(usr.client.holder && usr.client.holder.level >= 0) //Everything above admin-observers get this. - entry += "[C.key]" + if(holder && holder.level >= 0) //Everything above admin-observers get this. + for(var/client/C in clients) + var/entry = "\t[C.key]" if(C.holder && C.holder.fakekey) entry += " (as [C.holder.fakekey])" - var/mob/M = C.mob - entry += " - Playing as [M.real_name]" - switch(M.stat) + entry += " - Playing as [C.mob.real_name]" + switch(C.mob.stat) if(UNCONSCIOUS) entry += " - Unconscious" if(DEAD) - if(isobserver(M)) - var/mob/dead/observer/O = M + if(isobserver(C.mob)) + var/mob/dead/observer/O = C.mob if(O.started_as_observer) entry += " - Observing" else @@ -47,39 +27,46 @@ proc/get_all_admin_clients() entry += " - DEAD" if(is_special_character(C.mob)) entry += " - Antagonist" - entry += " (?)" - else + entry += " (?)" + Lines += entry + else + for(var/client/C in clients) if(C.holder && C.holder.fakekey) - entry += "[C.holder.fakekey]" + Lines += C.holder.fakekey else - entry += "[C.key]" + Lines += C.key - peeps += entry + for(var/line in sortList(Lines)) + msg += "[line]\n" - peeps = sortList(peeps) - - for (var/p in peeps) - usr << p - - usr << "Total Players: [length(peeps)]" + msg += "Total Players: [length(Lines)]" + src << msg /client/verb/adminwho() set category = "Admin" set name = "Adminwho" - usr << "Current Admins:" + var/msg = "Current Admins:\n" + if(holder) + for(var/client/C in admins) + msg += "\t[C] is a [C.holder.rank]" - for (var/client/C in admin_list) - if(C && C.holder) - if(usr.client && usr.client.holder) - var/afk = 0 - if(C.inactivity > AFK_THRESHOLD ) //When I made this, the AFK_THRESHOLD was 3000ds = 300s = 5m, see setup.dm for the new one. - afk = 1 - if(isobserver(C.mob)) - usr << "\t[C] is a [C.holder.rank][C.holder.fakekey ? " (as [C.holder.fakekey])" : ""] - Observing [afk ? "(AFK)" : ""]" - else if(istype(C.mob,/mob/new_player)) - usr << "\t[C] is a [C.holder.rank][C.holder.fakekey ? " (as [C.holder.fakekey])" : ""] - Has not entered [afk ? "(AFK)" : ""]" - else if(istype(C.mob,/mob/living)) - usr << "\t[C] is a [C.holder.rank][C.holder.fakekey ? " (as [C.holder.fakekey])" : ""] - Playing [afk ? "(AFK)" : ""]" - else if(!C.holder.fakekey) - usr << "\t[C] is a [C.holder.rank]" + if(C.holder.fakekey) + msg += " (as [C.holder.fakekey])" + + if(isobserver(C.mob)) + msg += " - Observing" + else if(istype(C.mob,/mob/new_player)) + msg += " - Lobby" + else + msg += " - Playing" + + if(C.inactivity > AFK_THRESHOLD) + msg += " (AFK)" + msg += "\n" + else + for(var/client/C in admins) + if(!C.holder.fakekey) + msg += "\t[C] is a [C.holder.rank]\n" + + src << msg \ No newline at end of file diff --git a/code/global.dm b/code/global.dm index 698fa2397f..3b17a71a81 100644 --- a/code/global.dm +++ b/code/global.dm @@ -76,7 +76,6 @@ var/list/bombers = list( ) var/list/admin_log = list ( ) var/list/lastsignalers = list( ) //keeps last 100 signals here in format: "[src] used \ref[src] @ location [src.loc]: [freq]/[code]" var/list/lawchanges = list( ) //Stores who uploaded laws to which silicon-based lifeform, and what the law was -var/list/admins = list( ) var/list/shuttles = list( ) var/list/reg_dna = list( ) // list/traitobj = list( ) diff --git a/code/modules/admin/DB ban/functions.dm b/code/modules/admin/DB ban/functions.dm index 2d2b0ec3a2..01b87611c8 100644 --- a/code/modules/admin/DB ban/functions.dm +++ b/code/modules/admin/DB ban/functions.dm @@ -53,17 +53,15 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration = a_computerid = src.owner:computer_id a_ip = src.owner:address -// var/list/client/clients = get_all_clients() var/who - for(var/client/C in client_list) + for(var/client/C in clients) if(!who) who = "[C]" else who += ", [C]" - var/list/client/admin_clients = get_all_admin_clients() var/adminwho - for(var/client/C in admin_clients) + for(var/client/C in admins) if(!adminwho) adminwho = "[C]" else diff --git a/code/modules/admin/IsBanned.dm b/code/modules/admin/IsBanned.dm index a3321b1655..a65b5beb36 100644 --- a/code/modules/admin/IsBanned.dm +++ b/code/modules/admin/IsBanned.dm @@ -1,6 +1,6 @@ //Blocks an attempt to connect before even creating our client datum thing. world/IsBanned(key,address,computer_id) - if(ckey(key) in admins) + if(ckey(key) in admin_datums) return ..() //Guest Checking diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index d1ed4652a5..7c5d4e8a0b 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -7,14 +7,13 @@ var/global/floorIsLava = 0 /proc/message_admins(var/text, var/admin_ref = 0, var/admin_holder_ref = 0) var/rendered = "ADMIN LOG: [text]" log_adminwarn(rendered) - for (var/client/C in admin_list) - if (C) - var/msg = rendered - if (admin_ref) - msg = dd_replacetext(msg, "%admin_ref%", "\ref[C]") - if (admin_holder_ref && C.holder) - msg = dd_replacetext(msg, "%holder_ref%", "\ref[C.holder]") - C << msg + for(var/client/C in admins) + var/msg = rendered + if(admin_ref) + msg = dd_replacetext(msg, "%admin_ref%", "\ref[C]") + if(admin_holder_ref && C.holder) + msg = dd_replacetext(msg, "%holder_ref%", "\ref[C.holder]") + C << msg ///////////////////////////////////////////////////////////////////////////////////////////////Panels diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 7621044686..fc97b1a686 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -25,8 +25,8 @@ /client/proc/update_admins(var/rank) if(!holder) holder = new /datum/admins(rank) - admin_list |= src - admins[ckey] = holder + admins |= src + admin_datums[ckey] = holder var/need_update = 0 //check if our rank has changed @@ -253,7 +253,6 @@ verbs += /datum/admins/proc/adjump verbs += /client/proc/callproc verbs += /client/proc/triple_ai - verbs += /client/proc/get_admin_state verbs += /client/proc/reload_admins verbs += /client/proc/cmd_debug_make_powernets verbs += /client/proc/object_talk @@ -299,7 +298,6 @@ /client/proc/show_verbs, /client/proc/colorooc, /client/proc/triple_ai, - /client/proc/get_admin_state, /client/proc/reload_admins, /client/proc/kill_air, /client/proc/cmd_debug_make_powernets, @@ -419,11 +417,11 @@ body.key = "@[key]" //Haaaaaaaack. But the people have spoken. If it breaks; blame adminbus feedback_add_details("admin_verb","O") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - +/* /client/proc/get_admin_state() set name = "Get Admin State" set category = "Debug" - for(var/client/C in admin_list) + for(var/client/C in admins) if(C.holder.state == 1) src << "[C.key] is playing - [C.holder.state]" else if(C.holder.state == 2) @@ -431,6 +429,7 @@ else src << "[C.key] is undefined - [C.holder.state]" feedback_add_details("admin_verb","GAS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! +*/ /client/proc/invisimin() set name = "Invisimin" diff --git a/code/modules/admin/holder2.dm b/code/modules/admin/holder2.dm index 5729a6c111..1c3eae6f1f 100644 --- a/code/modules/admin/holder2.dm +++ b/code/modules/admin/holder2.dm @@ -1,8 +1,8 @@ /client/proc/deadmin() - admins.Remove(ckey) + admin_datums -= ckey if(holder) del(holder) - src.clear_admin_verbs() - admin_list -= src + clear_admin_verbs() + admins -= src return 1 var/list/admin_datums = list() diff --git a/code/modules/admin/verbs/adminsay.dm b/code/modules/admin/verbs/adminsay.dm index b4d0d75d94..d29ab0de16 100644 --- a/code/modules/admin/verbs/adminsay.dm +++ b/code/modules/admin/verbs/adminsay.dm @@ -22,9 +22,10 @@ return feedback_add_details("admin_verb","M") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - for (var/client/C in admin_list) - if (src.holder.rank == "Admin Observer") + if(holder.rank == "Admin Observer") + for(var/client/C in admins) C << "ADMIN: [key_name(usr, C)]: [msg]" - else + else + for(var/client/C in admins) C << "ADMIN: [key_name(usr, C)] (JMP): [msg]" diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 744ccdc28c..95068c1330 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -939,7 +939,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that if("Players") usr << dd_list2text(player_list,",") if("Admins") - usr << dd_list2text(admin_list,",") + usr << dd_list2text(admins,",") if("Mobs") usr << dd_list2text(mob_list,",") if("Living Mobs") @@ -947,4 +947,4 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that if("Dead Mobs") usr << dd_list2text(dead_mob_list,",") if("Clients") - usr << dd_list2text(client_list,",") + usr << dd_list2text(clients,",") diff --git a/code/modules/admin/verbs/getlogs.dm b/code/modules/admin/verbs/getlogs.dm index 91dafd2c6b..e64df78c53 100644 --- a/code/modules/admin/verbs/getlogs.dm +++ b/code/modules/admin/verbs/getlogs.dm @@ -35,10 +35,6 @@ src << "Only Game Masters may use this command." return - var/list/clients = list() - for(var/client/C) - clients += C - var/client/target = input(src,"Choose somebody to grant access to the server's runtime logs (permissions expire at the end of each round):","Grant Permissions",null) as null|anything in clients if( !target || !istype(target,/client) ) src << "Error: giveruntimelog(): Client not found." diff --git a/code/modules/admin/verbs/pray.dm b/code/modules/admin/verbs/pray.dm index fd4fcb9cc1..3ecc8d3894 100644 --- a/code/modules/admin/verbs/pray.dm +++ b/code/modules/admin/verbs/pray.dm @@ -17,8 +17,8 @@ var/icon/cross = icon('icons/obj/storage.dmi',"bible") - for (var/client/C in admin_list) - if (C.seeprayers) + for(var/client/C in admins) + if(C.seeprayers) C << "\blue \icon[cross] PRAY: [key_name(src, C)] (?) (PP) (VV) (SM) (JMP) (CA) (SC): [msg]" usr << "Your prayers have been received by the gods." @@ -27,20 +27,12 @@ /proc/Centcomm_announce(var/text , var/mob/Sender) - var/msg = copytext(sanitize(text), 1, MAX_MESSAGE_LEN) - -// log_admin("[key_name(Sender)] sent a message to Centcomm! The message was [msg]") // Handled somewhere else - - for (var/client/C in admin_list) + for(var/client/C in admins) C << "\blue CENTCOMM:[key_name(Sender, C)] (PP) (VV) (SM) (JMP) (CA) (BSA) (RPLY): [msg]" - // + /proc/Syndicate_announce(var/text , var/mob/Sender) - var/msg = copytext(sanitize(text), 1, MAX_MESSAGE_LEN) - -// log_admin("[key_name(Sender)] sent a message to the Syndicate! The message was [msg]") // Handled somewhere else - - for (var/client/C in admin_list) + for(var/client/C in admins) C << "\blue SYNDICATE:[key_name(Sender, C)] (PP) (VV) (SM) (JMP) (CA) (BSA) (RPLY): [msg]" - // + diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index cdc704dfc0..7003eb6cae 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -95,21 +95,22 @@ if(byond_version < MIN_CLIENT_VERSION) //Out of date client. return null - client_list += src - if ( (world.address == address || !address) && !host ) - host = key - world.update_status() + clients += src + directory[ckey] = src //Admin Authorisation - var/datum/admins/Admin_Obj = admins[ckey] - if(istype(Admin_Obj)) - admin_list += src - holder = Admin_Obj + holder = admin_datums[ckey] + if(holder) + admins += src holder.owner = src holder.state = null . = ..() //calls mob.Login() + if( (world.address == address || !address) && !host ) + host = key + world.update_status() + if(holder) admin_memo_show() @@ -122,8 +123,10 @@ /client/Del() if(holder) holder.state = null - admin_list -= src - client_list -= src + holder.owner = null + admins -= src + directory -= ckey + clients -= src return ..() diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index c005b3593b..f4fb834c4b 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -24,10 +24,7 @@ verbs += /mob/dead/observer/proc/dead_tele stat = DEAD - dead_mob_list += src - add_to_mob_list(src) var/turf/T - if(ismob(body)) T = get_turf(body) //Where is the body located? attack_log = body.attack_log //preserve our attack logs by copying them to our ghost @@ -52,7 +49,7 @@ if(!name) //To prevent nameless ghosts name = capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names)) real_name = name - return + ..() /mob/dead/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) return 1 diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/drone.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/drone.dm index 031ef4f9b5..c88d62f56e 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/drone.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/drone.dm @@ -14,8 +14,7 @@ src.name = text("alien drone ([rand(1, 1000)])") src.real_name = src.name verbs.Add(/mob/living/carbon/alien/humanoid/proc/resin,/mob/living/carbon/alien/humanoid/proc/corrosive_acid) - //verbs -= /mob/living/carbon/alien/humanoid/verb/ActivateHuggers //<-- pointless - add_to_mob_list(src) + ..() //Drones use the same base as generic humanoids. //Drone verbs diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm index 0a9a69dd14..3a15f620b2 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm @@ -15,7 +15,7 @@ if(name == "alien hunter") name = text("alien hunter ([rand(1, 1000)])") real_name = name - add_to_mob_list(src) + ..() /mob/living/carbon/alien/humanoid/hunter diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm index ac3d3f1703..226824c6ab 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm @@ -16,7 +16,7 @@ name = text("alien sentinel ([rand(1, 1000)])") real_name = name verbs.Add(/mob/living/carbon/alien/humanoid/proc/corrosive_acid,/mob/living/carbon/alien/humanoid/proc/neurotoxin) - add_to_mob_list(src) + ..() /mob/living/carbon/alien/humanoid/sentinel diff --git a/code/modules/mob/living/carbon/alien/humanoid/queen.dm b/code/modules/mob/living/carbon/alien/humanoid/queen.dm index 644eee5e81..efa2d0cc11 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/queen.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/queen.dm @@ -26,7 +26,7 @@ real_name = src.name verbs.Add(/mob/living/carbon/alien/humanoid/proc/corrosive_acid,/mob/living/carbon/alien/humanoid/proc/neurotoxin,/mob/living/carbon/alien/humanoid/proc/resin) verbs -= /mob/living/carbon/alien/verb/ventcrawl - add_to_mob_list(src) + ..() /mob/living/carbon/alien/humanoid/queen diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 5b8a4ba173..82b6b13dee 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -106,7 +106,7 @@ job = "AI" - add_to_mob_list(src) + ..() return diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index fc5d44a1ad..6111ea9cec 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -106,7 +106,6 @@ //Improved /N /mob/living/silicon/robot/Del() if(mmi)//Safety for when a cyborg gets dust()ed. Or there is no MMI inside. - add_to_mob_list(mmi.brainmob) var/turf/T = get_turf(loc)//To hopefully prevent run time errors. if(T) mmi.loc = T if(mind) mind.transfer_to(mmi.brainmob) diff --git a/code/modules/mob/logout.dm b/code/modules/mob/logout.dm index 99024d04cf..f85ff5bae5 100644 --- a/code/modules/mob/logout.dm +++ b/code/modules/mob/logout.dm @@ -1,9 +1,9 @@ /mob/Logout() player_list -= src log_access("Logout: [key_name(src)]") - if(admins[src.ckey]) + if(admin_datums[src.ckey]) if (ticker && ticker.current_state == GAME_STATE_PLAYING) //Only report this stuff if we are currently playing. - var/admins_number = admin_list.len + var/admins_number = admins.len message_admins("Admin logout: [key_name(src)]") if(admins_number == 0) //Apparently the admin logging out is no longer an admin at this point, so we have to check this towards 0 and not towards 1. Awell. diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index c3dd9749de..abfeb82cb0 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1,10 +1,16 @@ /mob/Del()//This makes sure that mobs with clients/keys are not just deleted from the game. + mob_list -= src + dead_mob_list -= src + living_mob_list -= src ghostize() - remove_from_mob_list(src) ..() /mob/New() - add_to_mob_list(src) + mob_list += src + if(stat == DEAD) + dead_mob_list += src + else + living_mob_list += src ..() /mob/proc/Cell() diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index f166ff82cd..18eb945aed 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -15,6 +15,9 @@ anchored = 1 // don't get pushed around + New() + mob_list += src + verb/new_player_panel() set src = usr new_player_panel_proc() diff --git a/code/world.dm b/code/world.dm index f22e808f64..4c936fade2 100644 --- a/code/world.dm +++ b/code/world.dm @@ -132,7 +132,7 @@ Starting up. [time2text(world.timeofday, "hh:mm.ss")] var/n = 0 var/admins = 0 - for(var/client/C in client_list) + for(var/client/C in clients) if(C.holder) if(C.holder.fakekey) continue //so stealthmins aren't revealed by the hub @@ -202,7 +202,7 @@ Starting up. [time2text(world.timeofday, "hh:mm.ss")] if(pos) var/m_key = copytext(line, 1, pos) var/a_lev = copytext(line, pos + 3, length(line) + 1) - admins[m_key] = new /datum/admins(a_lev) + admin_datums[m_key] = new /datum/admins(a_lev) diary << ("ADMIN: [m_key] = [a_lev]") else //The current admin system uses SQL @@ -258,9 +258,9 @@ Starting up. [time2text(world.timeofday, "hh:mm.ss")] var/datum/admins/AD = new /datum/admins(adminrank) AD.level = adminlevel //Legacy support for old verbs AD.sql_permissions = permissions_actual - admins[adminckey] = AD + admin_datums[adminckey] = AD - if(!admins) + if(!admin_datums) diary << "The database query in load_admins() resulted in no admins being added to the list. Reverting to legacy system." config.admin_legacy_system = 1 load_admins()