mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-16 01:23:41 +01:00
Server regions (#18867)
This commit is contained in:
@@ -123,6 +123,8 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
|
||||
var/list/datum/keybindings = list()
|
||||
/// Keybinding overrides ("name" => ["key"...])
|
||||
var/list/keybindings_overrides = null
|
||||
/// Player's region override for routing optimisation
|
||||
var/server_region = null
|
||||
|
||||
/datum/preferences/New(client/C, datum/db_query/Q) // Process our query
|
||||
parent = C
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
ghost_darkness_level = query.item[20]
|
||||
colourblind_mode = query.item[21]
|
||||
keybindings = init_keybindings(raw = query.item[22])
|
||||
server_region = query.item[23]
|
||||
|
||||
lastchangelog_2 = lastchangelog // Clone please
|
||||
|
||||
@@ -48,6 +49,11 @@
|
||||
screentip_color = sanitize_hexcolor(screentip_color, initial(screentip_color))
|
||||
ghost_darkness_level = sanitize_integer(ghost_darkness_level, 0, 255, initial(ghost_darkness_level))
|
||||
colourblind_mode = sanitize_inlist(colourblind_mode, list(COLOURBLIND_MODE_NONE, COLOURBLIND_MODE_DEUTER, COLOURBLIND_MODE_PROT, COLOURBLIND_MODE_TRIT), COLOURBLIND_MODE_NONE)
|
||||
|
||||
// Sanitize the region
|
||||
if(!(server_region in GLOB.configuration.system.region_map))
|
||||
server_region = null // This region doesnt exist anymore
|
||||
|
||||
return TRUE
|
||||
|
||||
/datum/preferences/proc/save_preferences(client/C)
|
||||
@@ -82,7 +88,8 @@
|
||||
screentip_color=:screentip_color,
|
||||
ghost_darkness_level=:ghost_darkness_level,
|
||||
colourblind_mode=:colourblind_mode,
|
||||
keybindings=:keybindings
|
||||
keybindings=:keybindings,
|
||||
server_region=:server_region
|
||||
WHERE ckey=:ckey"}, list(
|
||||
// OH GOD THE PARAMETERS
|
||||
"ooccolour" = ooccolor,
|
||||
@@ -107,6 +114,7 @@
|
||||
"colourblind_mode" = colourblind_mode,
|
||||
"keybindings" = json_encode(keybindings_overrides),
|
||||
"ckey" = C.ckey,
|
||||
"server_region" = server_region,
|
||||
))
|
||||
|
||||
if(!query.warn_execute())
|
||||
|
||||
Reference in New Issue
Block a user