From cb987d36923941196bfe926c69a18f6ef9a14f2d Mon Sep 17 00:00:00 2001 From: ZomgPonies Date: Mon, 6 Apr 2015 23:12:15 -0400 Subject: [PATCH] Alt Account checking --- code/modules/admin/admin.dm | 4 ++++ code/modules/admin/admin_verbs.dm | 3 ++- code/modules/admin/verbs/alt_check.dm | 20 ++++++++++++++++++++ code/modules/client/client defines.dm | 6 +++--- code/modules/client/client procs.dm | 16 ++++++++++------ paradise.dme | 1 + 6 files changed, 40 insertions(+), 10 deletions(-) create mode 100644 code/modules/admin/verbs/alt_check.dm diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index bb2d820e54f..dee6c2afaaf 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -180,6 +180,10 @@ var/global/nologevent = 0 Thunderdome Admin | Thunderdome Observer | "} + if(M.client.related_accounts_cid.len) + body += "

Related accounts by CID: [list2text(M.client.related_accounts_cid, " - ")]
" + if(M.client.related_accounts_ip.len) + body += "Related accounts by IP: [list2text(M.client.related_accounts_ip, " - ")]
" body += {"
diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index bfb9dbb5cc1..076b05d2187 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -63,7 +63,8 @@ var/list/admin_verbs_admin = list( /client/proc/delbook, /client/proc/empty_ai_core_toggle_latejoin, /client/proc/freeze, - /client/proc/freezemecha + /client/proc/freezemecha, + /client/proc/alt_check ) var/list/admin_verbs_ban = list( diff --git a/code/modules/admin/verbs/alt_check.dm b/code/modules/admin/verbs/alt_check.dm new file mode 100644 index 00000000000..5366f240945 --- /dev/null +++ b/code/modules/admin/verbs/alt_check.dm @@ -0,0 +1,20 @@ +/client/proc/alt_check() + set category = "Admin" + set name = "Alt Account Checker" + + var/dat = {"Just to be sure you should try to also look up computer IDs/IPs on the server logs for a second opinion. +
Additionally make an attempt to introduce new players to the server +
"} + + if(dbcon.IsConnected()) + for(var/client/C in clients) + dat += "

[C.ckey] (Player Age: [C.player_age]) - [C.computer_id] / [C.address]
" + if(C.related_accounts_cid.len) + dat += "--Accounts associated with CID: " + dat += "[list2text(C.related_accounts_cid, " - ")]
" + if(C.related_accounts_ip.len) + dat += "--Accounts associated with IP: " + dat += "[list2text(C.related_accounts_ip, " - ")] " + usr << browse(dat, "window=alt_panel;size=640x480") + return + diff --git a/code/modules/client/client defines.dm b/code/modules/client/client defines.dm index 8f96fa89437..3e5dea3cacc 100644 --- a/code/modules/client/client defines.dm +++ b/code/modules/client/client defines.dm @@ -41,9 +41,9 @@ //////////////////////////////////// //things that require the database// //////////////////////////////////// - var/player_age = "Requires database" //So admins know why it isn't working - Used to determine how old the account is - in days. - var/related_accounts_ip = "Requires database" //So admins know why it isn't working - Used to determine what other accounts previously logged in from this ip - var/related_accounts_cid = "Requires database" //So admins know why it isn't working - Used to determine what other accounts previously logged in from this computer id + var/player_age = "--" //So admins know why it isn't working - Used to determine how old the account is - in days. + var/list/related_accounts_ip = list() //So admins know why it isn't working - Used to determine what other accounts previously logged in from this ip + var/list/related_accounts_cid = list() //So admins know why it isn't working - Used to determine what other accounts previously logged in from this computer id preload_rsc = 1 // This is 0 so we can set it to an URL once the player logs in and have them download the resources from a different server. diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 43d9569ea39..67bf068d604 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -307,17 +307,21 @@ var/DBQuery/query_ip = dbcon.NewQuery("SELECT ckey FROM erro_player WHERE ip = '[address]'") query_ip.Execute() - related_accounts_ip = "" + related_accounts_ip = list() while(query_ip.NextRow()) - related_accounts_ip += "[query_ip.item[1]], " - break + if(ckey != query_ip.item[1]) + related_accounts_ip.Add("[query_ip.item[1]]") var/DBQuery/query_cid = dbcon.NewQuery("SELECT ckey FROM erro_player WHERE computerid = '[computer_id]'") query_cid.Execute() - related_accounts_cid = "" + related_accounts_cid = list() while(query_cid.NextRow()) - related_accounts_cid += "[query_cid.item[1]], " - break + if(ckey != query_cid.item[1]) + related_accounts_cid.Add("[query_cid.item[1]]") + + //Log all the alts + if(related_accounts_cid.len) + log_access("Alts: [key_name(src)]:[list2text(related_accounts_cid, " - ")]") //Just the standard check to see if it's actually a number if(sql_id) diff --git a/paradise.dme b/paradise.dme index a41357ac689..19e1c0e3aad 100644 --- a/paradise.dme +++ b/paradise.dme @@ -831,6 +831,7 @@ #include "code\modules\admin\verbs\adminjump.dm" #include "code\modules\admin\verbs\adminpm.dm" #include "code\modules\admin\verbs\adminsay.dm" +#include "code\modules\admin\verbs\alt_check.dm" #include "code\modules\admin\verbs\atmosdebug.dm" #include "code\modules\admin\verbs\BrokenInhands.dm" #include "code\modules\admin\verbs\cinematic.dm"