Merge pull request #1118 from Erthilo/master

Adds Soghun/Tajaran whitelisting.
This commit is contained in:
SkyMarshal
2012-05-20 14:29:20 -07:00
13 changed files with 85 additions and 14 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 21 KiB

+4
View File
@@ -47,6 +47,7 @@
var/usewhitelist = 0
var/kick_inactive = 0 //force disconnect for inactive players
var/load_jobs_from_txt = 0
var/usealienwhitelist = 0
var/server
var/banappeals
@@ -233,6 +234,9 @@
if ("usewhitelist")
config.usewhitelist = 1
if ("usealienwhitelist")
config.usealienwhitelist = 1
if ("feature_object_spell_system")
config.feature_object_spell_system = 1
+1
View File
@@ -94,6 +94,7 @@ var
list/lastsignalers = list( ) //keeps last 100 signals here in format: "[src] used \ref[src] @ location [src.loc]: [freq]/[code]"
list/lawchanges = list( ) //Stores who uploaded laws to which silicon-based lifeform, and what the law was
list/admins = list( )
list/alien_whitelist = list( )
list/shuttles = list( )
list/reg_dna = list( )
// list/traitobj = list( )
+2
View File
@@ -85,6 +85,8 @@
src.load_motd()
src.load_rules()
src.load_admins()
if (config.usealienwhitelist)
load_alienwhitelist()
if (config.usewhitelist)
load_whitelist()
LoadBansjob()
+17 -1
View File
@@ -13,4 +13,20 @@ var/list/whitelist
return 0
return ("[M.ckey]" in whitelist)
#undef WHITELISTFILE
#undef WHITELISTFILE
proc/load_alienwhitelist()
var/text = file2text("config/alienwhitelist.txt")
if (!text)
diary << "Failed to load config/alienwhitelist.txt\n"
else
alien_whitelist = dd_text2list(text, "\n")
/proc/is_alien_whitelisted(mob/M, var/species)
if(!alien_whitelist)
return
if(M && species)
for (var/s in alien_whitelist)
if(findtext(s,"[M.ckey] - [species]"))
return 1
return 0
+8 -5
View File
@@ -78,21 +78,24 @@ obj/item/verb/pick_up()
if(!(usr))
return
if((!istype(usr, /mob/living/carbon)) || (istype(usr, /mob/living/carbon/brain)))
if((!istype(usr, /mob/living/carbon)) || (istype(usr, /mob/living/carbon/brain)))//Is humanoid, and is not a brain
usr << "\red You can't pick things up!"
return
if(!istype(src.loc, /turf) || usr.stat || usr.restrained() )
if( usr.stat || usr.restrained() )//Is not asleep/dead and is not restrained
usr << "\red You can't pick things up!"
return
if(src.anchored)
if(src.anchored) //Object isn't anchored
usr << "\red You can't pick that up!"
return
if(!usr.hand && usr.r_hand)
if(!usr.hand && usr.r_hand) //Right hand is not full
usr << "\red Your right hand is full."
return
if(usr.hand && usr.l_hand)
if(usr.hand && usr.l_hand) //Left hand is not full
usr << "\red Your left hand is full."
return
if(!istype(src.loc, /turf)) //Object is on a turf
usr << "\red You can't pick that up!"
return
//All checks are done, time to pick it up!
if(istype(usr, /mob/living/carbon/human))
src.attack_hand(usr)
@@ -20,6 +20,7 @@
var/g_eyes = 0.0
var/b_eyes = 0.0
var/s_tone = 0.0
var/species = "Human"
age = 30.0
var/used_skillpoints = 0
var/skill_specialization = null
+8 -3
View File
@@ -392,7 +392,11 @@
proc/create_character()
spawning = 1
var/mob/living/carbon/human/new_character = new(loc)
var/mob/living/carbon/human/new_character // var/path/to/object/varname
if(preferences.species == "Tajaran")
new_character = new /mob/living/carbon/human/tajaran(loc) // varname = new /path/to/object(location_to_spawn_at)
else
new_character = new /mob/living/carbon/human(loc)
new_character.lastarea = get_area(loc)
close_spawn_windows()
@@ -403,8 +407,9 @@
preferences.randomize_appearance_for(new_character)
else
preferences.copy_to(new_character)
src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) // MAD JAMS cant last forever yo
if(preferences.species == "Soghun") //This probably shouldn't be here, but I can't think of any other way
new_character.mutantrace = "lizard"
src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1)
new_character.dna.ready_dna(new_character)
preferences.copydisabilities(new_character)
+30 -3
View File
@@ -90,6 +90,9 @@ datum/preferences
g_facial = 0
b_facial = 0
//Species
species = "Human"
//Skin color
s_tone = 0
@@ -281,6 +284,7 @@ datum/preferences
dat += "<hr><table><tr><td><b>Body</b> "
dat += "(<a href=\"byond://?src=\ref[user];preferences=1;s_tone=random;underwear=random;backbag_type=random;age=random;b_type=random;hair=random;h_style=random;facial=random;f_style=random;eyes=random\">&reg;</A>)" // Random look
dat += "<br>"
dat += "Species: <a href='byond://?src=\ref[user];preferences=1;species=input'>[species]</a><br>"
dat += "Blood Type: <a href='byond://?src=\ref[user];preferences=1;b_type=input'>[b_type]</a><br>"
dat += "Skin Tone: <a href='byond://?src=\ref[user];preferences=1;s_tone=input'>[-s_tone + 35]/220<br></a>"
@@ -696,6 +700,23 @@ datum/preferences
if("random")
b_type = pickweight ( list ("A+" = 31, "A-" = 7, "B+" = 8, "B-" = 2, "AB+" = 2, "AB-" = 1, "O+" = 40, "O-" = 9))
if(link_tags["species"])
switch(link_tags["species"])
if("input")
var/list/new_species = list("Human")
if(config.usealienwhitelist) //If we're using the whitelist, make sure to check it!
if((is_alien_whitelisted(user, "Soghun")) || ((user.client) && (user.client.holder) && (user.client.holder.level) && (user.client.holder.level >= 5))) //Check for Soghun and admins
new_species += "Soghun"
if((is_alien_whitelisted(user, "Tajaran")) || ((user.client) && (user.client.holder) && (user.client.holder.level) && (user.client.holder.level >= 5))) //Check for Tajaran
new_species += "Tajaran"
else //Not using the whitelist? Aliens for everyone!
new_species += "Tajaran"
new_species += "Soghun"
species = input("Please select a species", "Character Generation", null) in new_species
h_style = "Bald" //Try not to carry face/head hair over.
f_style = "Shaved"
hair_style = new/datum/sprite_accessory/hair/bald
facial_hair_style = new/datum/sprite_accessory/facial_hair/shaved
if(link_tags["hair"])
switch(link_tags["hair"])
@@ -735,14 +756,18 @@ datum/preferences
if("random")
randomize_skin_tone()
if("input")
var/new_tone = input(user, "Please select skin tone level: 1-220 (1=albino, 35=caucasian, 150=black, 220='very' black)", "Character Generation") as text
var/new_tone = input(user, "Please select skin tone level: 1-220 (1=albino, 35=caucasian, 150=black, 220='very' black) or 20-70 for Tajarans", "Character Generation") as text
if(new_tone)
s_tone = max(min(round(text2num(new_tone)), 220), 1)
if(species == "Tajaran")
s_tone = max(min(round(text2num(new_tone)), 70), 20)
else
s_tone = max(min(round(text2num(new_tone)), 220), 1)
s_tone = -s_tone + 35
if(link_tags["h_style"])
if(species != "Human")
return
switch(link_tags["h_style"])
// New and improved hair selection code, by Doohl
if("random") // random hair selection
@@ -785,6 +810,8 @@ datum/preferences
src.ooccolor = ooccolor
if(link_tags["f_style"])
if(species != "Human") //Tajarans and Soghuns don't have hair stuff yet.
return
switch(link_tags["f_style"])
// see above for commentation. This is just a slight modification of the hair code for facial hairs
@@ -209,7 +209,15 @@ datum/preferences
else if (gender == FEMALE)
g = "f"
preview_icon = new /icon('human.dmi', "body_[g]_s", "dir" = preview_dir)
if(species == "Tajaran")
preview_icon = new /icon('tajaran.dmi', "body_[g]_s", "dir" = preview_dir)
else if(species == "Soghun")
if(g == "m")
preview_icon = new /icon('genetics.dmi', "lizard_male_s", "dir" = preview_dir)
else if(g == "f")
preview_icon = new /icon('genetics.dmi', "lizard_female_s", "dir" = preview_dir)
else
preview_icon = new /icon('human.dmi', "body_[g]_s", "dir" = preview_dir)
// Skin tone
if (s_tone >= 0)
+3
View File
@@ -131,6 +131,7 @@ datum/preferences/proc/savefile_save(mob/user, slot)
F["eyes_green"] << src.g_eyes
F["eyes_blue"] << src.b_eyes
F["blood_type"] << src.b_type
F["species"] << src.species
F["underwear"] << src.underwear
F["backbag"] << src.backbag
F["backbag"] << src.backbag
@@ -206,6 +207,8 @@ datum/preferences/proc/savefile_load(mob/user, slot)
F["eyes_green"] >> src.g_eyes
F["eyes_blue"] >> src.b_eyes
F["blood_type"] >> src.b_type
F["species"] >> src.species
if(isnull(species)) species = "Human"
F["underwear"] >> src.underwear
if(underwear == 0) underwear = 6 //For old players who have 0 in their savefile
F["backbag"] >> src.backbag
View File
+2 -1
View File
@@ -164,4 +164,5 @@ TICKLAG 0.9
## Defines if Tick Compensation is used. It results in a minor slowdown of movement of all mobs, but attempts to result in a level movement speed across all ticks. Recommended if tickrate is lowered.
TICKCOMP 0
## Uncomment to restrict non-admins using humanoid alien races
USEALIENWHITELIST