Various fixes for bans and mutations.

This commit is contained in:
Erthilo
2012-06-03 03:40:26 +01:00
parent c5ef488150
commit c3c5304397
14 changed files with 48 additions and 47 deletions
+3 -3
View File
@@ -1,10 +1,10 @@
//Blocks an attempt to connect before even creating our client datum thing.
world/IsBanned(key,address,computer_id)
if(ckey(key) in admins)
return ..()
// if(ckey(key) in admins)
// return ..()
//Guest Checking
if( !guests_allowed && IsGuestKey(key) )
if(IsGuestKey(key))
log_access("Failed Login: [key] - Guests not allowed")
message_admins("\blue Failed Login: [key] - Guests not allowed")
return list("reason"="guest", "desc"="\nReason: Guests not allowed.brb")
+10 -14
View File
@@ -2,9 +2,7 @@ var/CMinutes = null
var/savefile/Banlist
/proc/CheckBan(var/ckey, var/id, var/address)
if(!Banlist) // if Banlist cannot be located for some reason
LoadBans() // try to load the bans
if(!Banlist) // uh oh, can't find bans!
@@ -18,11 +16,11 @@ var/savefile/Banlist
if( "[ckey][id]" in Banlist.dir )
Banlist.cd = "[ckey][id]"
if (Banlist["temp"])
if (!GetBanExp(Banlist["minutes"]))
if (!GetExp(Banlist["minutes"]))
ClearTempbans()
return 0
else
.["desc"] = "\nReason: [Banlist["reason"]]\nExpires: [GetBanExp(Banlist["minutes"])]\nBy: [Banlist["bannedby"]][appeal]"
.["desc"] = "\nReason: [Banlist["reason"]]\nExpires: [GetExp(Banlist["minutes"])]\nBy: [Banlist["bannedby"]][appeal]"
else
Banlist.cd = "/base/[ckey][id]"
.["desc"] = "\nReason: [Banlist["reason"]]\nExpires: <B>PERMENANT</B>\nBy: [Banlist["bannedby"]][appeal]"
@@ -34,7 +32,7 @@ var/savefile/Banlist
var/matches
if( ckey == Banlist["key"] )
matches += "ckey"
if( id == Banlist["id"] && Banlist["skipIdCheck"] == 0)
if( id == Banlist["id"] )
if(matches)
matches += "/"
matches += "id"
@@ -45,11 +43,11 @@ var/savefile/Banlist
if(matches)
if(Banlist["temp"])
if (!GetBanExp(Banlist["minutes"]))
if (!GetExp(Banlist["minutes"]))
ClearTempbans()
return 0
else
.["desc"] = "\nReason: [Banlist["reason"]]\nExpires: [GetBanExp(Banlist["minutes"])]\nBy: [Banlist["bannedby"]][appeal]"
.["desc"] = "\nReason: [Banlist["reason"]]\nExpires: [GetExp(Banlist["minutes"])]\nBy: [Banlist["bannedby"]][appeal]"
else
.["desc"] = "\nReason: [Banlist["reason"]]\nExpires: <B>PERMENANT</B>\nBy: [Banlist["bannedby"]][appeal]"
.["reason"] = matches
@@ -63,16 +61,15 @@ var/savefile/Banlist
/proc/LoadBans()
Banlist = new("data/banlist.bdb")
log_admin("Loading Banlist")
log_admin("Loading banlist.")
if (!length(Banlist.dir)) log_admin("Banlist is empty.")
if (!Banlist.dir.Find("base"))
log_admin("Banlist missing base dir.")
Banlist.dir.Add("base")
Banlist.cd = "/base"
else if (Banlist.dir.Find("base"))
Banlist.cd = "/base"
Banlist.cd = "/base"
ClearTempbans()
return 1
@@ -112,7 +109,6 @@ var/savefile/Banlist
Banlist.cd = "/base/[ckey][computerid]"
Banlist["key"] << ckey
Banlist["id"] << computerid
Banlist["skipIdCheck"] << 0
Banlist["reason"] << reason
Banlist["bannedby"] << bannedby
Banlist["temp"] << temp
@@ -149,7 +145,7 @@ var/savefile/Banlist
return 1
/proc/GetBanExp(minutes as num)
/proc/GetExp(minutes as num)
UpdateTime()
var/exp = minutes - CMinutes
if (exp <= 0)
@@ -172,7 +168,7 @@ var/savefile/Banlist
for (var/A in Banlist.dir)
count++
Banlist.cd = "/base/[A]"
dat += text("<tr><td><A href='?src=\ref[src];unban_del=[Banlist["key"]][Banlist["id"]]'>(U)</A><A href='?src=\ref[src];unban_edit=[Banlist["key"]][Banlist["id"]]'>(E)</A><A href='?src=\ref[src];unban_cid=[Banlist["key"]][Banlist["id"]]'>(K)</A> Key: <B>[Banlist["key"]]</B></td><td> ([Banlist["temp"] ? "[GetBanExp(Banlist["minutes"]) ? GetBanExp(Banlist["minutes"]) : "Removal pending" ]" : "Permaban"])</td><td>(By: [Banlist["bannedby"]])</td><td>(Reason: [Banlist["reason"]])</td></tr>")
dat += text("<tr><td><A href='?src=\ref[src];unban_del=[Banlist["key"]][Banlist["id"]]'>(U)</A><A href='?src=\ref[src];unban_edit=[Banlist["key"]][Banlist["id"]]'>(E)</A><A href='?src=\ref[src];unban_cid=[Banlist["key"]][Banlist["id"]]'>(K)</A> Key: <B>[Banlist["key"]]</B></td><td> ([Banlist["temp"] ? "[GetExp(Banlist["minutes"]) ? GetExp(Banlist["minutes"]) : "Removal pending" ]" : "Permaban"])</td><td>(By: [Banlist["bannedby"]])</td><td>(Reason: [Banlist["reason"]])</td></tr>")
dat += "</table>"
dat = "<HR><B>Bans:</B> <FONT COLOR=blue>(U) = Unban , (E) = Edit Ban , (K) = Remove Computer ID</FONT> - <FONT COLOR=green>([count] Bans)</FONT><HR><table border=1 rules=all frame=void cellspacing=0 cellpadding=3 >[dat]"
+3 -3
View File
@@ -282,10 +282,10 @@ var/global/BSACooldown = 0
if(!reason)
return
log_admin("[key_name(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [GetBanExp(mins + CMinutes)]")
log_admin("[key_name(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [GetExp(mins + CMinutes)]")
ban_unban_log_save("[key_name(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [GetBanExp(mins + CMinutes)]")
message_admins("\blue [key_name_admin(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [GetBanExp(mins + CMinutes)]", 1)
ban_unban_log_save("[key_name(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [GetExp(mins + CMinutes)]")
message_admins("\blue [key_name_admin(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [GetExp(mins + CMinutes)]", 1)
Banlist.cd = "/base/[banfolder]"
Banlist["reason"] << reason
Banlist["temp"] << temp
+10 -7
View File
@@ -11,8 +11,6 @@
mind.key = key
mind.current = src
spawn() Playmusic() // git some tunes up in heeyaa~
var/starting_loc = pick(newplayer_start)
if(!starting_loc) starting_loc = locate(1,1,1)
loc = starting_loc
@@ -28,7 +26,7 @@
if(watch_locations.len>0)
loc = pick(watch_locations)
if(!preferences.savefile_load(src, 0))
if(!preferences.savefile_load(src, 1))
preferences.ShowChoices(src)
if(!client.changes)
changes()
@@ -37,11 +35,16 @@
if(!client.changes && preferences.lastchangelog!=lastchangelog)
changes()
preferences.lastchangelog = lastchangelog
preferences.savefile_save(src)
preferences.savefile_save(src, 1)
if(preferences.pregame_music)
spawn() Playmusic() // git some tunes up in heeyaa~
if(client.has_news())
src << "<b><font color=blue>There are some unread <a href='?src=\ref[news_topic_handler];client=\ref[client];action=show_news'>news</a> for you! Please make sure to read all news, as they may contain important updates about roleplay rules or canon.</font></b>"
new_player_panel()
spawn(10)
if(client)
new_player_panel()
//PDA Resource Initialisation =======================================================>
/*
Quick note: local dream daemon instances don't seem to cache images right. Might be
+2 -2
View File
@@ -230,7 +230,7 @@
continue
M.show_message("[user.name] smashed the light!", 3, "You hear a tinkle of breaking glass", 2)
if(on && (W.flags & CONDUCT))
//if(!user.mutations & COLD_RESISTANCE)
//if(!(COLD_RESISTANCE in user.mutations))
if (prob(12))
electrocute_mob(user, get_area(src), src, 0.3)
broken()
@@ -245,7 +245,7 @@
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(3, 1, src)
s.start()
//if(!user.mutations & COLD_RESISTANCE)
//if(!(COLD_RESISTANCE in user.mutations))
if (prob(75))
electrocute_mob(user, get_area(src), src, rand(0.7,1.0))