Skip to content
Open
3 changes: 2 additions & 1 deletion code/__DEFINES/jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
#define JOB_UNAVAILABLE_JOB_COOLDOWN 11
#define JOB_UNAVAILABLE_SLOTFULL 12
#define JOB_UNAVAILABLE_VIRTUESVICE 13
#define JOB_UNAVAILABLE_AGEVET 14

#define DEFAULT_RELIGION "Christianity"
#define DEFAULT_DEITY "Space Jesus"
Expand Down Expand Up @@ -235,7 +236,7 @@
#define TUORO (1<<5)
#define PAFANTO (1<<6) //heavy weapon technician - melee weapon and machine gun
#define MULO (1<<7) // heavy weapon ammo bearer - stripped down soldato gear and ammo storage
#define SERVISTO (1<<8) //support role - can probably shit meds out the wazoo
#define SERVISTO (1<<8) //support role - can probably shit meds out the wazoo
#define CURACISTO (1<<9)
#define CAMPFOLLOWER (1<<10)
#define CONSULO (1<<11)
Expand Down
3 changes: 3 additions & 0 deletions code/controllers/configuration/entries/general.dm
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,9 @@
/datum/config_entry/string/channel_announce_new_game_message
default = null

/datum/config_entry/string/chat_announce_verify
config_entry_value = null

/datum/config_entry/flag/debug_admin_hrefs

/datum/config_entry/number/mc_tick_rate/base_mc_tick_rate
Expand Down
9 changes: 9 additions & 0 deletions code/controllers/subsystem/job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,14 @@ SUBSYSTEM_DEF(job)
if(!job.special_job_check(player))
JobDebug("FOC player did not pass special check, Player: [player], Job:[job.title]")
continue
if(job.agevet_req && !(player.client.ckey in GLOB.agevetted_list))
JobDebug("FOC player is not agevetted, Player: [player], Job: [job.title]")
continue

if(CONFIG_GET(flag/usewhitelist))
if(job.whitelist_req && (!player.client.whitelisted()))
continue

if(player.client.prefs.job_preferences[job.title] == level)
JobDebug("FOC pass, Player: [player], Level:[level]")
candidates += player
Expand Down Expand Up @@ -252,6 +257,10 @@ SUBSYSTEM_DEF(job)
JobDebug("GRJ player did not pass special check, Player: [player], Job:[job.title]")
continue

if(job.agevet_req && !(player.client.ckey in GLOB.agevetted_list))
JobDebug("GRJ player is not agevetted, Player: [player], Job: [job.title]")
continue

if(CONFIG_GET(flag/usewhitelist))
if(job.whitelist_req && (!player.client.whitelisted()))
continue
Expand Down
12 changes: 11 additions & 1 deletion code/datums/sexcon/sexcon_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@
if(!user?.client?.prefs.sexable)
to_chat(user, "<span class='warning'>I don't want to touch [target]. (Your ERP preference, in the options)</span>")
return
if(!user.check_agevet())
to_chat(user, "<span class='warning'>You're not age verified.</span>")
log_combat(user, target, "tried ERP while non verified")
message_admins("[ADMIN_LOOKUPFLW(user)] has tried to use the ERP panel despite not being vetted.")
log_admin("[key_name(user)] has tried to use the ERP panel despite not being vetted.")
return
if(!target.check_agevet())
to_chat(user, "<span class='warning'>[target] is not age verified.</span>")
log_combat(user, target, "tried ERP against non verified")
return
if(!target?.client?.prefs)
to_chat(user, span_warning("[target] is simply not there. I can't do this."))
log_combat(user, target, "tried ERP menu against d/ced")
Expand Down Expand Up @@ -180,7 +190,7 @@
if(my_demihuman || their_demihuman)
return (my_demihuman && their_demihuman)
return TRUE

/mob/living/carbon/human/proc/try_impregnate(mob/living/carbon/human/wife)
var/obj/item/organ/testicles/testes = getorganslot(ORGAN_SLOT_TESTICLES)
if(!testes)
Expand Down
12 changes: 11 additions & 1 deletion code/modules/admin/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@
patron = initial(living.patron.name)
body += "<br><br>Current Patron: [patron]"

var/idstatus = "<br>ID Status: "
if(!M.ckey)
idstatus += "No key!"
else if(!M.check_agevet())
idstatus += "Unverified"
else
var/vetadmin = LAZYACCESS(GLOB.agevetted_list, M.ckey)
idstatus += "<b>Age Verified</b> by [vetadmin]"
body += idstatus

//Azure port. Incompatibility.
/*var/curse_string = ""
if(ishuman(M))
Expand Down Expand Up @@ -328,7 +338,7 @@

if(!check_rights())
return

if(!M.ckey)
to_chat(src, span_warning("There is no ckey attached to this mob."))
return
Expand Down
3 changes: 2 additions & 1 deletion code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ GLOBAL_PROTECT(admin_verbs_default)
/client/proc/admin_spread_effect,
/client/proc/open_bounty_menu,
/client/proc/remove_bounty,
/client/proc/agevet_player,
// RATWOOD MODULAR START
/client/proc/bunker_bypass,
// RATWOOD MODULAR END
Expand Down Expand Up @@ -887,7 +888,7 @@ GLOBAL_PROTECT(admin_verbs_hideable)
scom_announce("An unknown force has erased the bounty on [target_name]. The gods are displeased.")
message_admins("[ADMIN_LOOKUPFLW(src)] has removed the bounty on [ADMIN_LOOKUPFLW(target_name)]")
return
to_chat(src, "Error. Bounty no longer active.")
to_chat(src, "Error. Bounty no longer active.")

/client/proc/enable_browser_debug()
set category = "Debug"
Expand Down
83 changes: 83 additions & 0 deletions code/modules/admin/agevetting.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// This is almost entirely a copy paste of the Ratwood bunker system repurposed for adding in Age vetted people.
// Agevets matter more than simple whitelist access, so the approach is a bit different.
// We currently store age vets in an assoc list locally.
// The keys: player ckeys, values: the admin who added them.

GLOBAL_LIST_INIT(agevetted_list, load_agevets_from_file())
GLOBAL_PROTECT(agevetted_list)

/client/proc/check_agevet()
if(LAZYACCESS(GLOB.agevetted_list, ckey) || holder)
return TRUE
return FALSE

/mob/proc/check_agevet()
if(client)
return client.check_agevet()
if(LAZYACCESS(GLOB.agevetted_list, ckey) || copytext(key,1,2)=="@") //aghosted people stay verified
return TRUE
return FALSE

/client/proc/agevet_player()
set category = "-Server-"
set name = "BC - Add Age Vetted"

if(!check_rights())
return

var/selection = input("Who would you like to verify?", "CKEY", "") as text|null
if(selection)
if(alert(src, "Confirm: [selection] as being ID verified?", "Age Vetting", "Yes!", "No") == "Yes!")
add_agevet(selection, ckey, src) // keep the client ref to save us a duplicate list call

/proc/add_agevet(target_ckey, admin_ckey = "SYSTEM", clientref)
if(!target_ckey || (target_ckey in GLOB.agevetted_list))
return

if(IsAdminAdvancedProcCall())
return

if(LAZYACCESS(GLOB.agevetted_list, target_ckey))
to_chat(clientref, span_warning("The ckey \"[target_ckey]\" has already been ID vetted."))
return

target_ckey = ckey(target_ckey)
GLOB.agevetted_list[target_ckey] = admin_ckey
message_admins("ID VETTING: Added [target_ckey] to the agevetted list[admin_ckey? " by [admin_ckey]":""]")
log_admin("ID VETTING: Added [target_ckey] to the agevetted list[admin_ckey? " by [admin_ckey]":""]")
save_agevets_to_file()
log_agevet_to_csv(target_ckey, admin_ckey)
if(CONFIG_GET(string/chat_announce_verify))
send2chat(new /datum/tgs_message_content("ID VETTING: Added [target_ckey] to the agevetted list[admin_ckey? " by [admin_ckey]":""]"), CONFIG_GET(string/chat_announce_verify))

// if they're online, notify
var/recipient = LAZYACCESS(GLOB.directory, target_ckey)
if(recipient)
to_chat(recipient, span_notice("Good news! You are now ID verified."))

// Read/write the assoc list. Player ckey maps to vetting admin ckey.
/proc/load_agevets_from_file()
var/json_file = file("data/agevets.json")
if(fexists(json_file))
var/list/json = json_decode(file2text(json_file))
return json
else
return list()

/proc/save_agevets_to_file()
var/json_file = file("data/agevets.json")
var/list/file_data = list()
file_data = GLOB.agevetted_list
fdel(json_file)
WRITE_FILE(json_file,json_encode(file_data))

// for more convenient host oversight and perhaps an eventual database import.
/proc/log_agevet_to_csv(target_ckey, admin_ckey = "SYSTEM")
if(IsAdminAdvancedProcCall()) // sorry for using this twice
return
var/csv_file = file("data/agevets_log.csv")
var/current_date = time2text(world.timeofday, "YYYY-MM-DD")
if(!fexists(csv_file))
var/csv_columns = "player_ckey,admin_ckey,datestamp,rogue_round_id"
WRITE_FILE(csv_file,csv_columns)
csv_file << "[target_ckey],[admin_ckey],[current_date],[GLOB.rogue_round_id]"
6 changes: 4 additions & 2 deletions code/modules/admin/player_panel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,9 @@
M_job = "Observer"
else
M_job = "Ghost"

var/M_vetstatus = "Unverified"
if(M.check_agevet())
M_vetstatus = "Verified"
var/M_name = html_encode(M.name)
var/M_rname = html_encode(M.real_name)
var/M_key = html_encode(M.key)
Expand All @@ -266,7 +268,7 @@
<a id='link[i]'
onmouseover='expand("item[i]","[M_job]","[M_name]","[M_rname]","[previous_names]","[M_key]","[M.lastKnownIP]",[is_antagonist],"[REF(M)]")'
>
<b id='search[i]'>[M_name] - [M_rname] - [M_key] ([M_job])</b>
<b id='search[i]'>[M_name] - [M_rname] - [M_key] ([M_job]) - [M_vetstatus]</b>
<span hidden class='filter_data'>[M_name] [M_rname] [M_key] [M_job] [previous_names]</span>
</a>
<br><span id='item[i]'></span>
Expand Down
15 changes: 14 additions & 1 deletion code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,13 @@ GLOBAL_LIST_EMPTY(chosen_names)

dat += "</table>"

var/agevetted = user.check_agevet()
dat += "<td style='width:33%;text-align:right'>"
dat += "<a href='?_src_=prefs;preference=agevet'><b>VERIFIED:</b></a> [agevetted ? "<font color='#74cde0'>YAE!</font>" : "<font color='#897472'>NAE?</font>"]"
dat += "</td>"

dat += "</table>"

if(CONFIG_GET(flag/roundstart_traits))
dat += "<center><h2>Quirk Setup</h2>"
dat += "<a href='?_src_=prefs;preference=trait;task=menu'>Configure Quirks</a><br></center>"
Expand Down Expand Up @@ -1267,6 +1274,12 @@ Slots: [job.spawn_positions] [job.round_contrib_points ? "RCP: +[job.round_contr
else if(href_list["preference"] == "playerquality")
check_pq_menu(user.ckey)

else if(href_list["preference"] == "agevet")
if(!user.check_agevet())
to_chat(usr, span_info("- You are currently not <b>AGE-VERIFIED</b> limiting your access to the server. To get access to more features, age-verify through the discord."))
else
to_chat(usr, span_love("- You have been successfully <b>AGE-VERIFIED!</b>"))

else if(href_list["preference"] == "markings")
ShowMarkings(user)
return
Expand Down Expand Up @@ -1892,7 +1905,7 @@ Slots: [job.spawn_positions] [job.round_contrib_points ? "RCP: +[job.round_contr
charflaw = C
if(charflaw.desc)
to_chat(user, "<span class='info'>[charflaw.desc]</span>")
else
else
var/result = input(user, "Select a flaw", "Roguetown") as null|anything in elf_flaw
if(result)
result = elf_flaw[result]
Expand Down
1 change: 1 addition & 0 deletions code/modules/jobs/job_types/_job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
var/tutorial = null

var/whitelist_req = FALSE
var/agevet_req = TRUE

var/bypass_jobban = FALSE
var/bypass_lastclass = TRUE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
faction = "Station"
total_positions = 16
spawn_positions = 16
agevet_req = FALSE
allowed_races = RACES_CONSCRIPT
allowed_sexes = list(MALE, FEMALE)
allowed_ages = list(AGE_ADULT, AGE_MIDDLEAGED)

tutorial = "You are the rank and file soldier of the Great Empire of Perserdun. \
Your main purpose is to bundle together with other Armsmen and to kill the enemies of the Empire. \
Typically, Armsmen are filled with a great love for their nation and volunteer. Others are conscripted, or are convicts."
Typically, Armsmen are filled with a great love for their nation and volunteer. Others are conscripted, or are convicts."

outfit = /datum/outfit/job/roguetown/armsman
display_order = JDO_ARMSMAN
Expand Down
1 change: 1 addition & 0 deletions code/modules/jobs/job_types/roguetown/risvonian/soldato.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
faction = "Station"
total_positions = 16
spawn_positions = 16
agevet_req = FALSE
allowed_races = RACES_CONSCRIPT
allowed_sexes = list(MALE, FEMALE)
allowed_ages = list(AGE_ADULT, AGE_MIDDLEAGED)
Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/dead/new_player/new_player.dm
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,8 @@ GLOBAL_LIST_INIT(roleplay_readme, world.file2list("strings/rt/rp_prompt.txt"))
switch(retval)
if(JOB_AVAILABLE)
return "[jobtitle] is available."
if(JOB_UNAVAILABLE_AGEVET)
return "[jobtitle] is restricted to agevetted players."
if(JOB_UNAVAILABLE_GENERIC)
return "[jobtitle] is unavailable."
if(JOB_UNAVAILABLE_BANNED)
Expand Down Expand Up @@ -394,6 +396,8 @@ GLOBAL_LIST_INIT(roleplay_readme, world.file2list("strings/rt/rp_prompt.txt"))
if(CONFIG_GET(flag/usewhitelist))
if(job.whitelist_req && !client.whitelisted())
return JOB_UNAVAILABLE_GENERIC
if(job.agevet_req && !(ckey in GLOB.agevetted_list))
return JOB_UNAVAILABLE_AGEVET
if(!job.bypass_jobban)
if(is_banned_from(ckey, rank))
return JOB_UNAVAILABLE_BANNED
Expand Down
Loading
Loading