[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:
Selis
2025-03-06 01:38:19 +01:00
committed by GitHub
parent caec59322e
commit 7a7ae89713
88 changed files with 1993 additions and 904 deletions
+2 -5
View File
@@ -524,7 +524,7 @@
if(chosen_species && use_species_name)
// Have to recheck admin due to no usr at roundstart. Latejoins are fine though.
if(is_alien_whitelisted(chosen_species))
if(is_alien_whitelisted(src.client, chosen_species))
new_character = new(T, use_species_name)
if(!new_character)
@@ -600,9 +600,6 @@
src << browse(null, "window=News") //closes news window
panel.close()
/mob/new_player/proc/has_admin_rights()
return check_rights(R_ADMIN, 0, src)
/mob/new_player/get_species()
var/datum/species/chosen_species
if(client.prefs.species)
@@ -611,7 +608,7 @@
if(!chosen_species)
return SPECIES_HUMAN
if(is_alien_whitelisted(chosen_species))
if(is_alien_whitelisted(src.client, chosen_species))
return chosen_species.name
return SPECIES_HUMAN
+1 -1
View File
@@ -27,7 +27,7 @@
to_chat(src,span_warning("You have not set your scale yet. Do this on the VORE tab in character setup."))
//Can they play?
if(!is_alien_whitelisted(src,GLOB.all_species[client?.prefs?.species]) && !check_rights(R_ADMIN, 0))
if(!is_alien_whitelisted(src.client,GLOB.all_species[client?.prefs?.species]) && !check_rights(R_ADMIN, 0))
pass = FALSE
to_chat(src,span_warning("You are not allowed to spawn in as this species."))
+3 -3
View File
@@ -398,7 +398,7 @@
var/adminrank = "Player"
if(usr && usr.client && usr.client.holder)
adminrank = usr.client.holder.rank
adminrank = usr.client.holder.rank_names()
var/datum/db_query/insert_query = SSdbcore.NewQuery("INSERT INTO erro_poll_vote (id ,datetime ,pollid ,optionid ,ckey ,ip ,adminrank) VALUES (null, Now(), [pollid], [optionid], '[usr.ckey]', '[usr.client.address]', '[adminrank]')")
@@ -449,7 +449,7 @@
var/adminrank = "Player"
if(usr && usr.client && usr.client.holder)
adminrank = usr.client.holder.rank
adminrank = usr.client.holder.rank_names()
replytext = replacetext(replytext, "%BR%", "")
@@ -522,7 +522,7 @@
var/adminrank = "Player"
if(usr && usr.client && usr.client.holder)
adminrank = usr.client.holder.rank
adminrank = usr.client.holder.rank_names()
var/datum/db_query/insert_query = SSdbcore.NewQuery("INSERT INTO erro_poll_vote (id ,datetime ,pollid ,optionid ,ckey ,ip ,adminrank, rating) VALUES (null, Now(), [pollid], [optionid], '[usr.ckey]', '[usr.client.address]', '[adminrank]', [(isnull(rating)) ? "null" : rating])")