Skip to content

Commit

Permalink
downgrade auto 5 tier to second tier
Browse files Browse the repository at this point in the history
  • Loading branch information
Legendaxe committed Nov 22, 2023
1 parent 3043bfd commit 9822319
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 11 deletions.
41 changes: 31 additions & 10 deletions modular_ss220/donor/code/client_procs.dm
Original file line number Diff line number Diff line change
@@ -1,28 +1,49 @@
#define MAX_SAVE_SLOTS_SS220 5


/datum/client_login_processor/donator_check/proc/CheckAutoDonatorLevel(client/C)
if(C.holder)
C.donator_level = 2
return

var/is_wl = GLOB.configuration.overflow.reroute_cap == 0.5 ? TRUE : FALSE

var/datum/db_query/rank_ckey_read = SSdbcore.NewQuery(
"SELECT admin_rank FROM [is_wl ? "admin" : "admin_wl"] WHERE ckey=:ckey",
list("ckey" = C.ckey), disable_replace = is_wl)

if(!rank_ckey_read.warn_execute())
qdel(rank_ckey_read)
return

while(rank_ckey_read.NextRow())
C.donator_level = 2

qdel(rank_ckey_read)

/datum/client_login_processor/donator_check/process_result(datum/db_query/Q, client/C)
if(IsGuestKey(C.ckey))
return

if(check_rights_client(R_ADMIN, FALSE, C))
C.donator_level = DONATOR_LEVEL_MAX
C.donor_loadout_points()
C.donor_character_slots()
return
CheckAutoDonatorLevel(C)

while(Q.NextRow())
var/total = Q.item[1]
var/donator_level = 0
switch(total)
if(220 to 439)
C.donator_level = 1
donator_level = 1
if(440 to 999)
C.donator_level = 2
donator_level = 2
if(1000 to 2219)
C.donator_level = 3
donator_level = 3
if(2220 to 9999)
C.donator_level = 4
donator_level = 4
if(10000 to INFINITY)
C.donator_level = DONATOR_LEVEL_MAX
donator_level = DONATOR_LEVEL_MAX

C.donator_level = max(donator_level, C.donator_level)


C.donor_loadout_points()
C.donor_character_slots()
Expand Down
6 changes: 5 additions & 1 deletion modular_ss220/whitelist/code/wl_admin.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
/datum/controller/subsystem/dbcore/NewQuery(sql_query, arguments)
/datum/controller/subsystem/dbcore/NewQuery(sql_query, arguments, disable_replace = FALSE)
if(GLOB.configuration.overflow.reroute_cap != 0.5)
return ..()

if(disable_replace)
return ..()

var/regex/r = regex("\\b(admin)\\b")
sql_query = r.Replace(sql_query, "admin_wl")
. = ..()

0 comments on commit 9822319

Please sign in to comment.