Removed Karma. It was a shitty system used to punish security for doing their jobs even when it worked, and now it just spits runtimes.

Better defined the viewers in range of the vent crawl to hopefully stop the runtimes that was causing.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3196 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
kortgstation@gmail.com
2012-02-26 03:52:40 +00:00
parent 4eaf8e1d1a
commit c801c50cea
7 changed files with 10 additions and 179 deletions

View File

@@ -32,8 +32,6 @@
var/played = 0
var/team = null
var/warned = 0
var/karma = 0
var/karma_spent = 0
var/STFU_ghosts //80+ people rounds are fun to admin when text flies faster than airport security
var/STFU_radio //80+ people rounds are fun to admin when text flies faster than airport security

View File

@@ -46,77 +46,6 @@ proc/sql_report_round_end()
if(!sqllogging)
return
proc/sql_report_karma(var/mob/spender, var/mob/receiver, var/isnegative = 1)
if(!sqllogging)
return
var/sqlspendername = sanitizeSQL(spender.name)
var/sqlspenderkey = sanitizeSQL(spender.key)
var/sqlreceivername = sanitizeSQL(receiver.name)
var/sqlreceiverkey = sanitizeSQL(receiver.key)
var/sqlreceiverrole = "None"
var/sqlreceiverspecial = "None"
var/sqlisnegative = "TRUE"
if(isnegative)
sqlisnegative = "TRUE"
else
sqlisnegative = "FALSE"
var/sqlspenderip = spender.client.address
if(receiver.mind)
if(receiver.mind.special_role)
sqlreceiverspecial = sanitizeSQL(receiver.mind.special_role)
if(receiver.mind.assigned_role)
sqlreceiverrole = sanitizeSQL(receiver.mind.assigned_role)
var/DBConnection/dbcon = new()
dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
if(!dbcon.IsConnected())
log_game("SQL ERROR during karma logging. Failed to connect.")
else
var/sqltime = time2text(world.realtime, "YYYY-MM-DD hh:mm:ss")
var/DBQuery/query = dbcon.NewQuery("INSERT INTO karma (spendername, spenderkey, receivername, receiverkey, receiverrole, receiverspecial, isnegative, spenderip, time) VALUES ('[sqlspendername]', '[sqlspenderkey]', '[sqlreceivername]', '[sqlreceiverkey]', '[sqlreceiverrole]', '[sqlreceiverspecial]', [sqlisnegative], '[sqlspenderip]', '[sqltime]')")
if(!query.Execute())
var/err = query.ErrorMsg()
log_game("SQL ERROR during karma logging. Error : \[[err]\]\n")
query = dbcon.NewQuery("SELECT * FROM karmatotals WHERE byondkey='[receiver.key]'")
query.Execute()
var/karma
var/id
while(query.NextRow())
id = query.item[1]
karma = text2num(query.item[3])
karma = sanitizeSQL(karma)
karma = text2num(karma) //sanitization turns it into a string, so we need to change it back! -Pete
if(karma == null)
if(isnegative)
karma = -1
else
karma = 1
query = dbcon.NewQuery("INSERT INTO karmatotals (byondkey, karma) VALUES ('[sqlreceiverkey]', [karma])")
if(!query.Execute())
var/err = query.ErrorMsg()
log_game("SQL ERROR during karmatotal logging (adding new key). Error : \[[err]\]\n")
else
if(isnegative && sqlreceiverspecial != "None") // Toss out negative karma applied to traitors/wizards/etc.
dbcon.Disconnect()
return
if(isnegative)
karma -= 1
else
karma += 1
query = dbcon.NewQuery("UPDATE karmatotals SET karma=[karma] WHERE id=[id]")
if(!query.Execute())
var/err = query.ErrorMsg()
log_game("SQL ERROR during karmatotal logging (updating existing entry). Error : \[[err]\]\n")
dbcon.Disconnect()
proc/sql_report_death(var/mob/living/carbon/human/H)
if(!sqllogging)
return

View File

@@ -60,7 +60,7 @@
}
function expand(id,job,name,real_name,image,key,ip,antagonist,karma,ref){
function expand(id,job,name,real_name,image,key,ip,antagonist){
clearAll();
@@ -80,9 +80,7 @@
body += "<a href='?src=\ref[src];adminplayersubtlemessage="+ref+"'>SM</a> - "
body += "<a href='?src=\ref[src];adminplayerobservejump="+ref+"'>JMP</a><br>"
if(antagonist == 1)
body += "<font size='2'><a href='?src=\ref[src];secretsadmin=check_antagonist'><b><font color='red'>Antagonist</font></b></a> with "+karma+" karma</font>";
else
body += "<font size='2'>"+karma+" karma</font>";
body += "<font size='2'><a href='?src=\ref[src];secretsadmin=check_antagonist'>";
body += "</td></tr></table>";
@@ -213,16 +211,6 @@
var/list/mobs = sortmobs()
var/i = 1
var/show_karma = 0
var/DBConnection/dbcon
if(config.sql_enabled) // SQL is enabled in config.txt
dbcon = new() // Setting up connection
dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
if(dbcon.IsConnected())
show_karma = 1
else
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.<br>"
for(var/mob/M in mobs)
if(M.ckey)
@@ -231,15 +219,6 @@
color = "#f2f2f2"
var/is_antagonist = is_special_character(M)
var/karma = "DC"
if(show_karma)
var/DBQuery/query = dbcon.NewQuery("SELECT karma FROM karmatotals WHERE byondkey='[M.key]'")
query.Execute()
while(query.NextRow())
karma = query.item[1]
var/M_job = ""
if(istype(M,/mob/new_player))
@@ -294,7 +273,7 @@
<td align='center' bgcolor='[color]'>
<span id='notice_span[i]'></span>
<a id='link[i]'
onmouseover='expand("item[i]","[M_job]","[M_name]","[M_rname]","--unused--","[M_key]","[M.lastKnownIP]",[is_antagonist],"[karma]","\ref[M]")'
onmouseover='expand("item[i]","[M_job]","[M_name]","[M_rname]","--unused--","[M_key]","[M.lastKnownIP]",[is_antagonist],"\ref[M]")'
>
<b id='search[i]'>[M_name] - [M_rname] - [M_key] ([M_job])</b>
</a>
@@ -326,20 +305,10 @@
if (!usr.client.holder)
return
var/dat = "<html><head><title>Player Menu</title></head>"
dat += "<body><table border=1 cellspacing=5><B><tr><th>Name</th><th>Real Name</th><th>Assigned Job</th><th>Key</th><th>Options</th><th>PM</th><th>Traitor?</th><th>Karma</th></tr></B>"
dat += "<body><table border=1 cellspacing=5><B><tr><th>Name</th><th>Real Name</th><th>Assigned Job</th><th>Key</th><th>Options</th><th>PM</th><th>Traitor?</th></tr></B>"
//add <th>IP:</th> to this if wanting to add back in IP checking
//add <td>(IP: [M.lastKnownIP])</td> if you want to know their ip to the lists below
var/list/mobs = sortmobs()
var/show_karma = 0
var/DBConnection/dbcon
if(config.sql_enabled) // SQL is enabled in config.txt
dbcon = new() // Setting up connection
dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
if(dbcon.IsConnected())
show_karma = 1
else
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.<br>"
for(var/mob/M in mobs)
if(!M.ckey) continue
@@ -385,18 +354,6 @@
if(2)
dat += {"<td align=center><A HREF='?src=\ref[src];traitor=\ref[M]'><font color=red><b>Traitor?</b></font></A></td>"}
var/currentkarma = 0
if(show_karma)
var/DBQuery/query = dbcon.NewQuery("SELECT karma FROM karmatotals WHERE byondkey='[M.key]'")
query.Execute()
while(query.NextRow())
currentkarma = query.item[1]
if(currentkarma)
dat += "<td>[currentkarma]</td></tr>"
else
dat += "<td>0</td></tr>"
dat += "</table></body></html>"
usr << browse(dat, "window=players;size=640x480")

View File

@@ -188,57 +188,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
else
A << "This mob is not located in the game world."
var/list/karma_spenders = list()
/mob/dead/observer/verb/spend_karma(var/mob/M in world) // Karma system -- TLE
set name = "Spend Karma"
set category = "Ghost"
set desc = "Let the gods know whether someone's been naughty or nice. <One use only>"
if(!istype(M, /mob))
usr << "\red That's not a mob. You shouldn't have even been able to specify that. Please inform your server administrator post haste."
return
if(!M.client)
usr << "\red That mob has no client connected at the moment."
return
if(client.karma_spent)
usr << "\red You've already spent your karma for the round."
return
for(var/a in karma_spenders)
if(a == key)
usr << "\red You've already spent your karma for the round."
return
if(M.key == key)
usr << "\red You can't spend karma on yourself!"
return
var/choice = input("Give [M.name] good karma or bad karma?", "Karma") in list("Good", "Bad", "Cancel")
client.karma_spent = 1
if(!choice || choice == "Cancel")
return
client.karma_spent = 0
if(choice == "Good")
M.client.karma += 1
if(choice == "Bad")
M.client.karma -= 1
usr << "[choice] karma spent on [M.name]."
client.karma_spent = 1
karma_spenders.Add(key)
if(M.client.karma <= -2 || M.client.karma >= 2)
var/special_role = "None"
var/assigned_role = "None"
var/karma_diary = file("data/logs/karma_[time2text(world.realtime, "YYYY/MM-Month/DD-Day")].log")
if(M.mind)
if(M.mind.special_role)
special_role = M.mind.special_role
if(M.mind.assigned_role)
assigned_role = M.mind.assigned_role
karma_diary << "[M.name] ([M.key]) [assigned_role]/[special_role]: [M.client.karma] - [time2text(world.timeofday, "hh:mm:ss")]"
var/isnegative = 1
if(choice == "Good")
isnegative = 0
else
isnegative = 1
sql_report_karma(src, M, isnegative)
/mob/dead/observer/verb/toggle_alien_candidate()
set name = "Toggle Be Alien Candidate"

View File

@@ -31,7 +31,7 @@
if(loc==startloc)
var/obj/target_vent = vents[selection_position]
if(target_vent)
for(var/mob/O in oviewers())
for(var/mob/O in oviewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("<B>[src] scrambles into the ventillation ducts!</B>"), 1)
loc = target_vent.loc
@@ -51,12 +51,12 @@
if (layer != TURF_LAYER+0.2)
layer = TURF_LAYER+0.2
src << text("\green You are now hiding.")
for(var/mob/O in oviewers())
for(var/mob/O in oviewers(src, null))
if ((O.client && !( O.blinded )))
O << text("<B>[] scurries to the ground!</B>", src)
else
layer = MOB_LAYER
src << text("\green You have stopped hiding.")
for(var/mob/O in oviewers())
for(var/mob/O in oviewers(src, null))
if ((O.client && !( O.blinded )))
O << text("[] slowly peaks up from the ground...", src)

View File

@@ -35,7 +35,7 @@
if(loc==startloc)
var/obj/target_vent = vents[selection_position]
if(target_vent)
for(var/mob/O in oviewers())
for(var/mob/O in oviewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("<B>[src] scrambles into the ventillation ducts!</B>"), 1)
loc = target_vent.loc

View File

@@ -1,6 +1,6 @@
// DM Environment file for tgstation.dme.
// All manual changes should be made outside the BEGIN_ and END_ blocks.
// New source code should be placed in .dm files: choose File/New --> Code File.
// All manual changes should be made outside the BEGIN_ and END_ blocks.
// New source code should be placed in .dm files: choose File/New --> Code File.
// BEGIN_INTERNALS
// END_INTERNALS
// BEGIN_FILE_DIR
@@ -170,7 +170,6 @@
#define FILE_DIR "icons/vending_icons"
#define FILE_DIR "interface"
#define FILE_DIR "maps"
#define FILE_DIR "maps/backup"
#define FILE_DIR "sound"
#define FILE_DIR "sound/AI"
#define FILE_DIR "sound/ambience"
@@ -711,7 +710,6 @@
#include "code\game\objects\tanks\oxygen.dm"
#include "code\game\verbs\AI_status.dm"
#include "code\game\verbs\authorize.dm"
#include "code\game\verbs\checkkarma.dm"
#include "code\game\verbs\ooc.dm"
#include "code\game\verbs\sound.dm"
#include "code\game\verbs\suicide.dm"