From 6274f6a7d073648d30b4ae10db0e54c7ce752af9 Mon Sep 17 00:00:00 2001 From: tmtmtl30 <53132901+tmtmtl30@users.noreply.github.com> Date: Tue, 5 Dec 2023 19:36:20 -0800 Subject: [PATCH] fixes some backend shipjoin stuff (#2535) ## About The Pull Request admin + DB flag exemptions weren't respected by the ship joining UI, but _all_ players were assumed to have the requisite playtime to spawn / join a ship by the code that actually handled joining. this fixes both, technically fixing an href exploit i suppose ## Why It's Good For The Game bugs bad + consistency good. i am bad at web dev ## Changelog :cl: fix: Small playtime-based ship join restriction edge cases fixed. /:cl: --- code/modules/jobs/job_exp.dm | 1 + .../mob/dead/new_player/ship_select.dm | 2 ++ tgui/packages/tgui/interfaces/ShipSelect.js | 33 +++++++++++-------- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/code/modules/jobs/job_exp.dm b/code/modules/jobs/job_exp.dm index 159c1e1df6aa..9cf57432b4ea 100644 --- a/code/modules/jobs/job_exp.dm +++ b/code/modules/jobs/job_exp.dm @@ -45,6 +45,7 @@ GLOBAL_PROTECT(exp_to_update) return FALSE if(CONFIG_GET(flag/use_exp_restrictions_admin_bypass) && check_rights_for(src, R_ADMIN)) return FALSE // if admin exemption is enabled, and client is an admin, let them through + return TRUE /client/proc/get_exp_living(pure_numeric = FALSE) if(!prefs.exp) diff --git a/code/modules/mob/dead/new_player/ship_select.dm b/code/modules/mob/dead/new_player/ship_select.dm index 0ace7574101a..88146c9ea0fd 100644 --- a/code/modules/mob/dead/new_player/ship_select.dm +++ b/code/modules/mob/dead/new_player/ship_select.dm @@ -112,6 +112,8 @@ .["ships"] = list() .["shipSpawnAllowed"] = SSovermap.player_ship_spawn_allowed() .["purchaseBanned"] = is_banned_from(user.ckey, "Ship Purchasing") + // if the player has a client which is not eligible for playtime restriction (for admin + player DB flag playtime exemption), they "auto meet" playtime requirements + .["autoMeet"] = user.client && !user.client.is_playtime_restriction_eligible() .["playMin"] = user.client ? user.client.get_exp_living(TRUE) : 0 for(var/datum/overmap/ship/controlled/S as anything in SSovermap.controlled_ships) diff --git a/tgui/packages/tgui/interfaces/ShipSelect.js b/tgui/packages/tgui/interfaces/ShipSelect.js index b64016650650..11c48f96175e 100644 --- a/tgui/packages/tgui/interfaces/ShipSelect.js +++ b/tgui/packages/tgui/interfaces/ShipSelect.js @@ -189,10 +189,11 @@ export const ShipSelect = (props, context) => {