From 679606d0aa28707ebdabf15bd53d0ba17dac96fb Mon Sep 17 00:00:00 2001 From: Lzimann Date: Thu, 10 Nov 2016 01:23:52 -0200 Subject: [PATCH] Adds a button that show all players that are currently connected and in the watchlist. --- code/_globalvars/lists/mobs.dm | 3 ++- code/modules/admin/secrets.dm | 8 ++++++++ code/modules/client/client_procs.dm | 11 ++++++----- code/modules/mob/logout.dm | 2 ++ 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/code/_globalvars/lists/mobs.dm b/code/_globalvars/lists/mobs.dm index 4d6d82147f2..ae84f5b1dfe 100644 --- a/code/_globalvars/lists/mobs.dm +++ b/code/_globalvars/lists/mobs.dm @@ -2,7 +2,8 @@ var/list/clients = list() //all clients var/list/admins = list() //all clients whom are admins var/list/deadmins = list() //all clients who have used the de-admin verb. var/list/directory = list() //all ckeys with associated client -var/list/stealthminID = list() //reference list with IDs that store ckeys, for stealthmins +var/list/stealthminID = list() //reference list with IDs that store ckeys, for stealthmins +var/global/list/current_watchlist = list() //stores players that are currently online and in the watchlist //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 diff --git a/code/modules/admin/secrets.dm b/code/modules/admin/secrets.dm index 1065b1fa29c..86a1ff5dfe7 100644 --- a/code/modules/admin/secrets.dm +++ b/code/modules/admin/secrets.dm @@ -9,6 +9,7 @@ Show Job Debug
Admin Log
Show Admin List
+ Show online players in the watchlist

"} @@ -119,6 +120,13 @@ dat += "[ckey] - [D.rank.name]
" usr << browse(dat, "window=showadmins;size=600x500") + if("show_current_watchlist") + var/dat = "Watchlist:
" + if(current_watchlist) + for(var/ckey in current_watchlist) + dat += "[ckey] - [current_watchlist[ckey]]" + usr << browse(dat, "window=showcurrentwatchlist;size=600x500") + if("tdomereset") if(!check_rights(R_ADMIN)) return diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index a783d8a1ada..a9102fd7d90 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -316,6 +316,7 @@ var/next_external_rsc = 0 var/watchreason = check_watchlist(sql_ckey) if(watchreason) + current_watchlist[sql_ckey] = watchreason message_admins("Notice: [key_name_admin(src)] is on the watchlist and has just connected - Reason: [watchreason]") send2irc_adminless_only("Watchlist", "[key_name(src)] is on the watchlist and has just connected - Reason: [watchreason]") @@ -351,11 +352,11 @@ var/next_external_rsc = 0 cidcheck_spoofckeys[ckey] = TRUE cidcheck[ckey] = computer_id tokens[ckey] = cid_check_reconnect() - + sleep(10) //browse is queued, we don't want them to disconnect before getting the browse() command. qdel(src) return TRUE - + if (oldcid != computer_id) //IT CHANGED!!! cidcheck -= ckey //so they can try again after removing the cid randomizer. @@ -369,7 +370,7 @@ var/next_external_rsc = 0 note_randomizer_user() log_access("Failed Login: [key] [computer_id] [address] - CID randomizer confirmed (oldcid: [oldcid])") - + qdel(src) return TRUE else @@ -393,11 +394,11 @@ var/next_external_rsc = 0 if (computer_id != lastcid) cidcheck[ckey] = computer_id tokens[ckey] = cid_check_reconnect() - + sleep(10) //browse is queued, we don't want them to disconnect before getting the browse() command. qdel(src) return TRUE - + /client/proc/cid_check_reconnect() var/token = md5("[rand(0,9999)][world.time][rand(0,9999)][ckey][rand(0,9999)][address][rand(0,9999)][computer_id][rand(0,9999)]") . = token diff --git a/code/modules/mob/logout.dm b/code/modules/mob/logout.dm index 77d6ca571ea..f70821346c9 100644 --- a/code/modules/mob/logout.dm +++ b/code/modules/mob/logout.dm @@ -2,6 +2,8 @@ SStgui.on_logout(src) unset_machine() player_list -= src + if(ckey in current_watchlist) + current_watchlist -= ckey log_access("Logout: [key_name(src)]") if(admin_datums[src.ckey]) if (ticker && ticker.current_state == GAME_STATE_PLAYING) //Only report this stuff if we are currently playing.