mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-09 16:05:07 +00:00
Adds a warning and single retry to byond membership lookup (#86765)
## About The Pull Request A few people are having issues getting byond membership features disabled even though they're a byond member. This is *likely* due to byond server troubles, and according to lummox the lookup proc should return null when a connection issue happens. So I've put some handling in there for that case as well as a single retry. 🆑 fix: Byond membership lookup should now warn you when it fails due to a connection failure. /🆑
This commit is contained in:
@@ -105,9 +105,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
load_path(parent.ckey)
|
||||
if(load_and_save && !fexists(path))
|
||||
try_savefile_type_migration()
|
||||
unlock_content = !!parent.IsByondMember()
|
||||
if(unlock_content)
|
||||
max_save_slots = 8
|
||||
|
||||
refresh_membership()
|
||||
else
|
||||
CRASH("attempted to create a preferences datum without a client or mock!")
|
||||
load_savefile()
|
||||
@@ -536,3 +535,23 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
default_randomization[preference_key] = RANDOM_ENABLED
|
||||
|
||||
return default_randomization
|
||||
|
||||
/datum/preferences/proc/refresh_membership()
|
||||
var/byond_member = parent.IsByondMember()
|
||||
if(isnull(byond_member)) // Connection failure, retry once
|
||||
byond_member = parent.IsByondMember()
|
||||
var/static/admins_warned = FALSE
|
||||
if(!admins_warned)
|
||||
admins_warned = TRUE
|
||||
message_admins("BYOND membership lookup had a connection failure for a user. This is most likely an issue on the BYOND side but if this consistently happens you should bother your server operator to look into it.")
|
||||
if(isnull(byond_member)) // Retrying didn't work, warn the user
|
||||
log_game("BYOND membership lookup for [parent.ckey] failed due to a connection error.")
|
||||
else
|
||||
log_game("BYOND membership lookup for [parent.ckey] failed due to a connection error but succeeded after retry.")
|
||||
|
||||
if(isnull(byond_member))
|
||||
to_chat(parent, span_warning("There's been a connection failure while trying to check the status of your BYOND membership. Reconnecting may fix the issue, or BYOND could be experiencing downtime."))
|
||||
|
||||
unlock_content = !!byond_member
|
||||
if(unlock_content)
|
||||
max_save_slots = 8
|
||||
|
||||
Reference in New Issue
Block a user