From a39cd3b6bac25337f03e15f69c522a47d1441eeb Mon Sep 17 00:00:00 2001 From: "musketstgstation@gmail.com" Date: Wed, 20 Oct 2010 19:04:56 +0000 Subject: [PATCH] Added a Karma column to the player panel. Hopefully this works and doesn't lag too badly. Kind of hard to test locally. Should be OK, the code is mostly copied from the check karma verb git-svn-id: http://tgstation13.googlecode.com/svn/trunk@333 316c924e-a436-60f5-8080-3fe189b3f50e --- code/modules/admin/admin.dm | 90 +++++++++++++++++++++++++++---------- 1 file changed, 66 insertions(+), 24 deletions(-) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index ed70858673f..6280fb32100 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -13,7 +13,7 @@ var/showadminmessages = 1 /proc/toggle_adminmsg() set name = "Toggle Admin Messages" set category = "Server" - showadminmessages = !showadminmessages + //showadminmessages = !showadminmessages /obj/admins/Topic(href, href_list) ..() @@ -1352,33 +1352,75 @@ var/showadminmessages = 1 /obj/admins/proc/player() var/dat = "Player Menu" - dat += "" + dat += "
NameReal NameKeyOptionsPMTraitor?
" //add to this if wanting to add back in IP checking //add if you want to know their ip to the lists below var/list/mobs = sortmobs() + var/DBConnection/dbcon = new() + dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]") + if(!dbcon.IsConnected()) + usr << "\red Unable to connect to karma database. This error can occur if your host has failed to set up an SQL database or improperly configured its login credentials.
" - for(var/mob/M in mobs) - if(M.ckey) - dat += "" - if(istype(M, /mob/living/silicon/ai)) - dat += "" - if(istype(M, /mob/living/silicon/robot)) - dat += "" - if(istype(M, /mob/living/carbon/human)) - dat += "" - if(istype(M, /mob/new_player)) - dat += "" - if(istype(M, /mob/dead/observer)) - dat += "" - if(istype(M, /mob/living/carbon/monkey)) - dat += "" - if(istype(M, /mob/living/carbon/alien)) - dat += "" - dat += {" - - - - "} + for(var/mob/M in mobs) + if(M.ckey) + dat += "" + if(istype(M, /mob/living/silicon/ai)) + dat += "" + if(istype(M, /mob/living/silicon/robot)) + dat += "" + if(istype(M, /mob/living/carbon/human)) + dat += "" + if(istype(M, /mob/new_player)) + dat += "" + if(istype(M, /mob/dead/observer)) + dat += "" + if(istype(M, /mob/living/carbon/monkey)) + dat += "" + if(istype(M, /mob/living/carbon/alien)) + dat += "" + dat += {" + + + + "} + dat += "" + + else + + for(var/mob/M in mobs) + if(M.ckey) + + var/DBQuery/query = dbcon.NewQuery("SELECT karma FROM karmatotals WHERE byondkey='[M.ckey]'") + query.Execute() + + var/currentkarma + while(query.NextRow()) + currentkarma = query.item[1] + + dat += "" + if(istype(M, /mob/living/silicon/ai)) + dat += "" + if(istype(M, /mob/living/silicon/robot)) + dat += "" + if(istype(M, /mob/living/carbon/human)) + dat += "" + if(istype(M, /mob/new_player)) + dat += "" + if(istype(M, /mob/dead/observer)) + dat += "" + if(istype(M, /mob/living/carbon/monkey)) + dat += "" + if(istype(M, /mob/living/carbon/alien)) + dat += "" + dat += {" + + + + "} + if(currentkarma) + dat += "" + else + dat += "" dat += "
NameReal NameKeyOptionsPMTraitor?Karma
IP:(IP: [M.lastKnownIP])
[M.name]AICyborg[M.real_name]New PlayerGhostMonkeyAlien[(M.client ? "[(M.client.goon ? "" : "")][M.client]" : "No client")]XPM[checktraitor(M) ? "" : ""]Traitor?
[M.name]AICyborg[M.real_name]New PlayerGhostMonkeyAlien[(M.client ? "[(M.client.goon ? "" : "")][M.client]" : "No client")]XPM[checktraitor(M) ? "" : ""]Traitor?NOT CONNECTED
[M.name]AICyborg[M.real_name]New PlayerGhostMonkeyAlien[(M.client ? "[(M.client.goon ? "" : "")][M.client]" : "No client")]XPM[checktraitor(M) ? "" : ""]Traitor?[currentkarma]
0
"