mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-20 19:44:46 +01:00
[MAJOR CHANGE] Admin rank datum (#17133)
* Admin ranks update * Permissions fix * One missing thing * Further rework to make database also fully work * Adds admin rank bitflag calculator to tools * ZA WARUDO --------- Co-authored-by: C.L. <killer65311@gmail.com>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
/// Returns if the given client is an admin, REGARDLESS of if they're deadminned or not.
|
||||
///proc/is_admin(client/client)
|
||||
// return !isnull(GLOB.admin_datums[client.ckey]) || !isnull(GLOB.deadmins[client.ckey])
|
||||
|
||||
/// Sends a message in the event that someone attempts to elevate their permissions through invoking a certain proc.
|
||||
/proc/alert_to_permissions_elevation_attempt(mob/user)
|
||||
var/message = " has tried to elevate permissions!"
|
||||
message_admins(key_name_admin(user) + message)
|
||||
log_admin(key_name(user) + message)
|
||||
@@ -631,3 +631,14 @@ GLOBAL_LIST_EMPTY(text_tag_cache)
|
||||
/proc/sanitize_css_class_name(name)
|
||||
var/static/regex/regex = new(@"[^a-zA-Z0-9]","g")
|
||||
return replacetext(name, regex, "")
|
||||
|
||||
//finds the first occurrence of one of the characters from needles argument inside haystack
|
||||
//it may appear this can be optimised, but it really can't. findtext() is so much faster than anything you can do in byondcode.
|
||||
//stupid byond :(
|
||||
/proc/findchar(haystack, needles, start=1, end=0)
|
||||
var/temp
|
||||
var/len = length(needles)
|
||||
for(var/i=1, i<=len, i++)
|
||||
temp = findtextEx(haystack, ascii2text(text2ascii(needles,i)), start, end) //Note: ascii2text(text2ascii) is faster than copytext()
|
||||
if(temp) end = temp
|
||||
return end
|
||||
|
||||
Reference in New Issue
Block a user