border
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
///returns L[I] if L exists and I is a valid index of L, runtimes if L is not a list
|
||||
#define LAZYACCESS(L, I) (L ? (isnum(I) ? (I > 0 && I <= length(L) ? L[I] : null) : L[I]) : null)
|
||||
#define LAZYSET(L, K, V) if(!L) { L = list(); } L[K] = V;
|
||||
#define LAZYISIN(L, V) L ? (V in L) : FALSE
|
||||
#define LAZYLEN(L) length(L)
|
||||
///This is used to add onto lazy assoc list when the value you're adding is a /list/. This one has extra safety over lazyaddassoc because the value could be null (and thus cant be used to += objects)
|
||||
#define LAZYADDASSOCLIST(L, K, V) if(!L) { L = list(); } L[K] += list(V);
|
||||
@@ -789,3 +790,25 @@
|
||||
/proc/safe_json_decode(string, default = list())
|
||||
. = default
|
||||
return json_decode(string)
|
||||
|
||||
// Insert an object A into a sorted list using cmp_proc (/code/_helpers/cmp.dm) for comparison.
|
||||
#define ADD_SORTED(list, A, cmp_proc) if(!list.len) {list.Add(A)} else {list.Insert(FindElementIndex(A, list, cmp_proc), A)}
|
||||
|
||||
// Return the index using dichotomic search
|
||||
/proc/FindElementIndex(atom/A, list/L, cmp)
|
||||
var/i = 1
|
||||
var/j = L.len
|
||||
var/mid
|
||||
|
||||
while(i < j)
|
||||
mid = round((i+j)/2)
|
||||
|
||||
if(call(cmp)(L[mid],A) < 0)
|
||||
i = mid + 1
|
||||
else
|
||||
j = mid
|
||||
|
||||
if(i == 1 || i == L.len) // Edge cases
|
||||
return (call(cmp)(L[i],A) > 0) ? i : i+1
|
||||
else
|
||||
return i
|
||||
|
||||
@@ -347,3 +347,5 @@
|
||||
|
||||
/datum/config_entry/str_list/randomizing_station_name_message
|
||||
default = list()
|
||||
|
||||
/datum/config_entry/number/border_control // If border control is enabled
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
|
||||
////////////////////////////////
|
||||
/proc/log_and_message_admins(var/message as text, var/mob/user = usr)
|
||||
var/finalMessage = user ? "[key_name(user)] [message]" : "EVENT [message]"
|
||||
log_admin(finalMessage)
|
||||
message_admins(finalMessage)
|
||||
log_world(finalMessage)
|
||||
|
||||
/proc/message_admins(msg)
|
||||
msg = "<span class=\"admin filter_adminlog\"><span class=\"prefix\">ADMIN LOG:</span> <span class=\"message linkify\">[msg]</span></span>"
|
||||
to_chat(GLOB.admins, msg, confidential = TRUE)
|
||||
|
||||
@@ -91,6 +91,9 @@ GLOBAL_PROTECT(admin_verbs_admin)
|
||||
/datum/admins/proc/open_borgopanel,
|
||||
/datum/admins/proc/change_laws, //change AI laws
|
||||
/datum/admins/proc/display_tags,
|
||||
/datum/admins/proc/BC_WhitelistKeyVerb,
|
||||
/datum/admins/proc/BC_RemoveKeyVerb,
|
||||
/datum/admins/proc/BC_ToggleState,
|
||||
)
|
||||
GLOBAL_LIST_INIT(admin_verbs_ban, list(/client/proc/unban_panel, /client/proc/DB_ban_panel, /client/proc/stickybanpanel))
|
||||
GLOBAL_PROTECT(admin_verbs_ban)
|
||||
|
||||
@@ -429,6 +429,11 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
|
||||
if(admin_memo_note)
|
||||
to_chat(src, admin_memo_note)
|
||||
adminGreet()
|
||||
else if(!BC_IsKeyAllowedToConnect(ckey))
|
||||
to_chat(src, "Sorry, but the server is currently only accepting whitelisted players. Please see the discord to be whitelisted.")
|
||||
log_and_message_admins("[ckey] was denied a connection due to not being whitelisted.")
|
||||
qdel(src)
|
||||
return 0
|
||||
|
||||
add_verbs_from_config()
|
||||
var/cached_player_age = set_client_age_from_db(tdata) //we have to cache this because other shit may change it and we need it's current value now down below.
|
||||
|
||||
Reference in New Issue
Block a user