mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Add department playtime requirement config, code
This commit is contained in:
@@ -54,6 +54,7 @@
|
||||
var/account_join_date = "(Requires database)"
|
||||
var/account_age = "(Requires database)"
|
||||
var/list/department_hours // VOREStation Edit - Track hours of leave accured for each department.
|
||||
var/list/play_hours // VOREStation Edit - Tracks total playtime hours for each departments.
|
||||
|
||||
preload_rsc = PRELOAD_RSC
|
||||
|
||||
|
||||
@@ -324,11 +324,13 @@
|
||||
|
||||
// VOREStation Edit Start - Department Hours
|
||||
if(config.time_off)
|
||||
var/DBQuery/query_hours = dbcon.NewQuery("SELECT department, hours FROM vr_player_hours WHERE ckey = '[sql_ckey]'")
|
||||
var/DBQuery/query_hours = dbcon.NewQuery("SELECT department, hours, total_hours FROM vr_player_hours WHERE ckey = '[sql_ckey]'")
|
||||
query_hours.Execute()
|
||||
LAZYINITLIST(department_hours)
|
||||
LAZYINITLIST(play_hours)
|
||||
while(query_hours.NextRow())
|
||||
LAZYINITLIST(department_hours)
|
||||
department_hours[query_hours.item[1]] = text2num(query_hours.item[2])
|
||||
play_hours[query_hours.item[1]] = text2num(query_hours.item[3])
|
||||
// VOREStation Edit End - Department Hours
|
||||
|
||||
if(sql_id)
|
||||
|
||||
@@ -143,6 +143,12 @@
|
||||
var/available_in_days = job.available_in_days(user.client)
|
||||
. += "<del>[rank]</del></td></a><td> \[IN [(available_in_days)] DAYS]</td></tr>"
|
||||
continue
|
||||
//VOREStation Add
|
||||
if(!job.player_has_enough_playtime(user.client))
|
||||
var/available_in_hours = job.available_in_playhours(user.client)
|
||||
. += "<del>[rank]</del></td></a><td> \[IN [(available_in_hours)] DEPTHOURS]</td></tr>"
|
||||
continue
|
||||
//VOREStation Add End
|
||||
if(job.minimum_character_age && user.client && (user.client.prefs.age < job.minimum_character_age))
|
||||
. += "<del>[rank]</del></td></a><td> \[MINIMUM CHARACTER AGE: [job.minimum_character_age]]</td></tr>"
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user