Merge branch 'master' into upstream-merge-30056
This commit is contained in:
@@ -262,4 +262,4 @@ GLOBAL_PROTECT(exp_to_update)
|
||||
prefs.db_flags = text2num(flags_read.item[1])
|
||||
else if(isnull(prefs.db_flags))
|
||||
prefs.db_flags = 0 //This PROBABLY won't happen, but better safe than sorry.
|
||||
return TRUE
|
||||
return TRUE
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
diff a/code/modules/jobs/job_exp.dm b/code/modules/jobs/job_exp.dm (rejected hunks)
|
||||
@@ -140,15 +140,12 @@ GLOBAL_PROTECT(exp_to_update)
|
||||
//resets a client's exp to what was in the db.
|
||||
/client/proc/set_exp_from_db()
|
||||
if(!config.use_exp_tracking)
|
||||
- return
|
||||
+ return -1
|
||||
if(!SSdbcore.Connect())
|
||||
return -1
|
||||
var/datum/DBQuery/exp_read = SSdbcore.NewQuery("SELECT job, minutes FROM [format_table_name("role_time")] WHERE ckey = '[sanitizeSQL(ckey)]'")
|
||||
if(!exp_read.Execute())
|
||||
- var/err = exp_read.ErrorMsg()
|
||||
- log_sql("SQL ERROR during exp_update_client read. Error : \[[err]\]\n")
|
||||
- message_admins("SQL ERROR during exp_update_client read. Error : \[[err]\]\n")
|
||||
- return
|
||||
+ return -1
|
||||
var/list/play_records = list()
|
||||
while(exp_read.NextRow())
|
||||
play_records[exp_read.item[1]] = text2num(exp_read.item[2])
|
||||
@@ -172,42 +169,24 @@ GLOBAL_PROTECT(exp_to_update)
|
||||
if(!set_db_player_flags())
|
||||
return -1
|
||||
|
||||
- var/datum/DBQuery/flag_read = SSdbcore.NewQuery("SELECT flags FROM [format_table_name("player")] WHERE ckey='[sanitizeSQL(ckey)]'")
|
||||
-
|
||||
- if(!flag_read.Execute())
|
||||
- var/err = flag_read.ErrorMsg()
|
||||
- log_sql("SQL ERROR during player flags read. Error : \[[err]\]\n")
|
||||
- message_admins("SQL ERROR during player flags read. Error : \[[err]\]\n")
|
||||
- return
|
||||
-
|
||||
- var/playerflags = null
|
||||
- if(flag_read.NextRow())
|
||||
- playerflags = text2num(flag_read.item[1])
|
||||
-
|
||||
- if((playerflags & newflag) && !state)
|
||||
+ if((prefs.db_flags & newflag) && !state)
|
||||
prefs.db_flags &= ~newflag
|
||||
else
|
||||
prefs.db_flags |= newflag
|
||||
|
||||
var/datum/DBQuery/flag_update = SSdbcore.NewQuery("UPDATE [format_table_name("player")] SET flags = '[prefs.db_flags]' WHERE ckey='[sanitizeSQL(ckey)]'")
|
||||
|
||||
-
|
||||
if(!flag_update.Execute())
|
||||
- var/err = flag_update.ErrorMsg()
|
||||
- log_sql("SQL ERROR during exp_exempt update. Error : \[[err]\]\n")
|
||||
- message_admins("SQL ERROR during exp_exempt update. Error : \[[err]\]\n")
|
||||
- return
|
||||
+ return -1
|
||||
+
|
||||
|
||||
/client/proc/update_exp_list(minutes, announce_changes = FALSE)
|
||||
if(!config.use_exp_tracking)
|
||||
- return
|
||||
+ return -1
|
||||
if(!SSdbcore.Connect())
|
||||
return -1
|
||||
var/datum/DBQuery/exp_read = SSdbcore.NewQuery("SELECT job, minutes FROM [format_table_name("role_time")] WHERE ckey = '[sanitizeSQL(ckey)]'")
|
||||
if(!exp_read.Execute())
|
||||
- var/err = exp_read.ErrorMsg()
|
||||
- log_sql("SQL ERROR during exp_update_client read. Error : \[[err]\]\n")
|
||||
- message_admins("SQL ERROR during exp_update_client read. Error : \[[err]\]\n")
|
||||
return -1
|
||||
var/list/play_records = list()
|
||||
while(exp_read.NextRow())
|
||||
@@ -241,9 +220,13 @@ GLOBAL_PROTECT(exp_to_update)
|
||||
if(announce_changes)
|
||||
to_chat(mob,"<span class='notice'>You got: [minutes] [role] EXP!</span>")
|
||||
if(mob.mind.special_role && !mob.mind.var_edited)
|
||||
- play_records[mob.mind.special_role] += minutes
|
||||
+ var/trackedrole = mob.mind.special_role
|
||||
+ var/gangrole = lookforgangrole(mob.mind.special_role)
|
||||
+ if(gangrole)
|
||||
+ trackedrole = gangrole
|
||||
+ play_records[trackedrole] += minutes
|
||||
if(announce_changes)
|
||||
- to_chat(src,"<span class='notice'>You got: [minutes] [mob.mind.special_role] EXP!</span>")
|
||||
+ to_chat(src,"<span class='notice'>You got: [minutes] [trackedrole] EXP!</span>")
|
||||
if(!rolefound)
|
||||
play_records["Unknown"] += minutes
|
||||
else
|
||||
@@ -276,11 +259,21 @@ GLOBAL_PROTECT(exp_to_update)
|
||||
var/datum/DBQuery/flags_read = SSdbcore.NewQuery("SELECT flags FROM [format_table_name("player")] WHERE ckey='[ckey]'")
|
||||
|
||||
if(!flags_read.Execute())
|
||||
- var/err = flags_read.ErrorMsg()
|
||||
- log_sql("SQL ERROR during player flags read. Error : \[[err]\]\n")
|
||||
- message_admins("SQL ERROR during player flags read. Error : \[[err]\]\n")
|
||||
return FALSE
|
||||
|
||||
if(flags_read.NextRow())
|
||||
prefs.db_flags = text2num(flags_read.item[1])
|
||||
+ else if(isnull(prefs.db_flags))
|
||||
+ prefs.db_flags = 0 //This PROBABLY won't happen, but better safe than sorry.
|
||||
return TRUE
|
||||
+
|
||||
+//Since each gang is tracked as a different antag type, records need to be generalized or you get up to 57 different possible records
|
||||
+/proc/lookforgangrole(rolecheck)
|
||||
+ if(findtext(rolecheck,"Gangster"))
|
||||
+ return "Gangster"
|
||||
+ else if(findtext(rolecheck,"Gang Boss"))
|
||||
+ return "Gang Boss"
|
||||
+ else if(findtext(rolecheck,"Gang Lieutenant"))
|
||||
+ return "Gang Lieutenant"
|
||||
+ else
|
||||
+ return FALSE
|
||||
\ No newline at end of file
|
||||
@@ -13,6 +13,8 @@ Captain
|
||||
selection_color = "#ccccff"
|
||||
req_admin_notify = 1
|
||||
minimal_player_age = 14
|
||||
exp_requirements = 180
|
||||
exp_type = EXP_TYPE_CREW
|
||||
|
||||
outfit = /datum/outfit/job/captain
|
||||
|
||||
@@ -64,6 +66,9 @@ Head of Personnel
|
||||
selection_color = "#ddddff"
|
||||
req_admin_notify = 1
|
||||
minimal_player_age = 10
|
||||
exp_requirements = 180
|
||||
exp_type = EXP_TYPE_CREW
|
||||
exp_type_department = EXP_TYPE_SUPPLY
|
||||
|
||||
outfit = /datum/outfit/job/hop
|
||||
|
||||
|
||||
@@ -14,6 +14,9 @@ Chief Engineer
|
||||
selection_color = "#ffeeaa"
|
||||
req_admin_notify = 1
|
||||
minimal_player_age = 7
|
||||
exp_requirements = 180
|
||||
exp_type = EXP_TYPE_CREW
|
||||
exp_type_department = EXP_TYPE_ENGINEERING
|
||||
|
||||
outfit = /datum/outfit/job/ce
|
||||
|
||||
@@ -72,6 +75,8 @@ Station Engineer
|
||||
spawn_positions = 5
|
||||
supervisors = "the chief engineer"
|
||||
selection_color = "#fff5cc"
|
||||
exp_requirements = 60
|
||||
exp_type = EXP_TYPE_CREW
|
||||
|
||||
outfit = /datum/outfit/job/engineer
|
||||
|
||||
@@ -127,6 +132,8 @@ Atmospheric Technician
|
||||
spawn_positions = 2
|
||||
supervisors = "the chief engineer"
|
||||
selection_color = "#fff5cc"
|
||||
exp_requirements = 60
|
||||
exp_type = EXP_TYPE_CREW
|
||||
|
||||
outfit = /datum/outfit/job/atmos
|
||||
|
||||
|
||||
@@ -43,6 +43,11 @@
|
||||
|
||||
var/outfit = null
|
||||
|
||||
var/exp_requirements = 0
|
||||
|
||||
var/exp_type = ""
|
||||
var/exp_type_department = ""
|
||||
|
||||
//Only override this proc
|
||||
//H is usually a human unless an /equip override transformed it
|
||||
/datum/job/proc/after_spawn(mob/living/H, mob/M)
|
||||
|
||||
@@ -14,6 +14,9 @@ Chief Medical Officer
|
||||
selection_color = "#ffddf0"
|
||||
req_admin_notify = 1
|
||||
minimal_player_age = 7
|
||||
exp_requirements = 180
|
||||
exp_type = EXP_TYPE_CREW
|
||||
exp_type_department = EXP_TYPE_MEDICAL
|
||||
|
||||
outfit = /datum/outfit/job/cmo
|
||||
|
||||
@@ -30,6 +33,7 @@ Chief Medical Officer
|
||||
|
||||
id = /obj/item/card/id/silver
|
||||
belt = /obj/item/device/pda/heads/cmo
|
||||
l_pocket = /obj/item/pinpointer/crew
|
||||
ears = /obj/item/device/radio/headset/heads/cmo
|
||||
uniform = /obj/item/clothing/under/rank/chief_medical_officer
|
||||
shoes = /obj/item/clothing/shoes/sneakers/brown
|
||||
@@ -90,6 +94,8 @@ Chemist
|
||||
spawn_positions = 2
|
||||
supervisors = "the chief medical officer"
|
||||
selection_color = "#ffeef0"
|
||||
exp_type = EXP_TYPE_CREW
|
||||
exp_requirements = 60
|
||||
|
||||
outfit = /datum/outfit/job/chemist
|
||||
|
||||
@@ -124,6 +130,8 @@ Geneticist
|
||||
spawn_positions = 2
|
||||
supervisors = "the chief medical officer and research director"
|
||||
selection_color = "#ffeef0"
|
||||
exp_type = EXP_TYPE_CREW
|
||||
exp_requirements = 60
|
||||
|
||||
outfit = /datum/outfit/job/geneticist
|
||||
|
||||
@@ -158,6 +166,8 @@ Virologist
|
||||
spawn_positions = 1
|
||||
supervisors = "the chief medical officer"
|
||||
selection_color = "#ffeef0"
|
||||
exp_type = EXP_TYPE_CREW
|
||||
exp_requirements = 60
|
||||
|
||||
outfit = /datum/outfit/job/virologist
|
||||
|
||||
|
||||
@@ -14,6 +14,9 @@ Research Director
|
||||
selection_color = "#ffddff"
|
||||
req_admin_notify = 1
|
||||
minimal_player_age = 7
|
||||
exp_type_department = EXP_TYPE_SCIENCE
|
||||
exp_requirements = 180
|
||||
exp_type = EXP_TYPE_CREW
|
||||
|
||||
outfit = /datum/outfit/job/rd
|
||||
|
||||
@@ -68,6 +71,8 @@ Scientist
|
||||
spawn_positions = 3
|
||||
supervisors = "the research director"
|
||||
selection_color = "#ffeeff"
|
||||
exp_requirements = 60
|
||||
exp_type = EXP_TYPE_CREW
|
||||
|
||||
outfit = /datum/outfit/job/scientist
|
||||
|
||||
@@ -101,6 +106,8 @@ Roboticist
|
||||
spawn_positions = 2
|
||||
supervisors = "research director"
|
||||
selection_color = "#ffeeff"
|
||||
exp_requirements = 60
|
||||
exp_type = EXP_TYPE_CREW
|
||||
|
||||
outfit = /datum/outfit/job/roboticist
|
||||
|
||||
|
||||
@@ -20,6 +20,9 @@ Head of Security
|
||||
selection_color = "#ffdddd"
|
||||
req_admin_notify = 1
|
||||
minimal_player_age = 14
|
||||
exp_requirements = 300
|
||||
exp_type = EXP_TYPE_CREW
|
||||
exp_type_department = EXP_TYPE_SECURITY
|
||||
|
||||
outfit = /datum/outfit/job/hos
|
||||
|
||||
@@ -71,6 +74,8 @@ Warden
|
||||
supervisors = "the head of security"
|
||||
selection_color = "#ffeeee"
|
||||
minimal_player_age = 7
|
||||
exp_requirements = 300
|
||||
exp_type = EXP_TYPE_CREW
|
||||
|
||||
outfit = /datum/outfit/job/warden
|
||||
|
||||
@@ -121,6 +126,8 @@ Detective
|
||||
supervisors = "the head of security"
|
||||
selection_color = "#ffeeee"
|
||||
minimal_player_age = 7
|
||||
exp_requirements = 300
|
||||
exp_type = EXP_TYPE_CREW
|
||||
|
||||
outfit = /datum/outfit/job/detective
|
||||
|
||||
@@ -169,6 +176,8 @@ Security Officer
|
||||
supervisors = "the head of security, and the head of your assigned department (if applicable)"
|
||||
selection_color = "#ffeeee"
|
||||
minimal_player_age = 7
|
||||
exp_requirements = 300
|
||||
exp_type = EXP_TYPE_CREW
|
||||
|
||||
outfit = /datum/outfit/job/security
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ AI
|
||||
supervisors = "your laws"
|
||||
req_admin_notify = 1
|
||||
minimal_player_age = 30
|
||||
exp_requirements = 180
|
||||
exp_type = EXP_TYPE_CREW
|
||||
|
||||
/datum/job/ai/equip(mob/living/carbon/human/H)
|
||||
return H.AIize(FALSE)
|
||||
@@ -44,6 +46,8 @@ Cyborg
|
||||
supervisors = "your laws and the AI" //Nodrak
|
||||
selection_color = "#ddffdd"
|
||||
minimal_player_age = 21
|
||||
exp_requirements = 120
|
||||
exp_type = EXP_TYPE_CREW
|
||||
|
||||
/datum/job/cyborg/equip(mob/living/carbon/human/H)
|
||||
return H.Robotize(FALSE, FALSE)
|
||||
|
||||
@@ -59,6 +59,26 @@ GLOBAL_LIST_INIT(nonhuman_positions, list(
|
||||
"Cyborg",
|
||||
"pAI"))
|
||||
|
||||
GLOBAL_LIST_INIT(exp_jobsmap, list(
|
||||
EXP_TYPE_CREW = list("titles" = command_positions | engineering_positions | medical_positions | science_positions | supply_positions | security_positions | civilian_positions | list("AI","Cyborg")), // crew positions
|
||||
EXP_TYPE_COMMAND = list("titles" = command_positions),
|
||||
EXP_TYPE_ENGINEERING = list("titles" = engineering_positions),
|
||||
EXP_TYPE_MEDICAL = list("titles" = medical_positions),
|
||||
EXP_TYPE_SCIENCE = list("titles" = science_positions),
|
||||
EXP_TYPE_SUPPLY = list("titles" = supply_positions),
|
||||
EXP_TYPE_SECURITY = list("titles" = security_positions),
|
||||
EXP_TYPE_SILICON = list("titles" = list("AI","Cyborg")),
|
||||
EXP_TYPE_SERVICE = list("titles" = civilian_positions),
|
||||
))
|
||||
|
||||
GLOBAL_LIST_INIT(exp_specialmap, list(
|
||||
EXP_TYPE_LIVING = list(), // all living mobs
|
||||
EXP_TYPE_ANTAG = list(),
|
||||
EXP_TYPE_SPECIAL = list("Lifebringer","Ash Walker","Exile","Servant Golem","Free Golem","Hermit","Translocated Vet","Escaped Prisoner","Hotel Staff","SuperFriend","Space Syndicate","Ancient Crew","Space Doctor","Space Bartender","Beach Bum","Skeleton","Zombie","Space Bar Patron","Lavaland Syndicate","Ghost Role"), // Ghost roles
|
||||
EXP_TYPE_GHOST = list() // dead people, observers
|
||||
))
|
||||
GLOBAL_PROTECT(exp_jobsmap)
|
||||
GLOBAL_PROTECT(exp_specialmap)
|
||||
|
||||
/proc/guest_jobbans(job)
|
||||
return ((job in GLOB.command_positions) || (job in GLOB.nonhuman_positions) || (job in GLOB.security_positions))
|
||||
|
||||
Reference in New Issue
Block a user