Skip to content

Commit

Permalink
Merge branch 'master' into aipic
Browse files Browse the repository at this point in the history
  • Loading branch information
AyIong authored Nov 9, 2023
2 parents 3fbb8ec + 45031ed commit 48d6565
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions modular_ss220/modular_ss220.dme
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
#include "outfits/_outfits.dme"
#include "world_view_bigger/_world_view_bigger.dme"
#include "mecha_skins/mecha_skins.dme"
#include "queue/_queue.dme"

// --- PRIME --- //
// #define MODPACK_MAIN_ONLY
Expand Down
Empty file added modular_ss220/queue/_queue.dm
Empty file.
4 changes: 4 additions & 0 deletions modular_ss220/queue/_queue.dme
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include "_queue.dm"

#include "code/new_player_procs.dm"
#include "code/queue_bypass.dm"
30 changes: 30 additions & 0 deletions modular_ss220/queue/code/new_player_procs.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/mob/new_player/Login()
. = ..()

if(!SSdbcore.IsConnected())
return

if(SSqueue.queue_enabled)
if(client?.ckey in SSqueue.queue_bypass_list)
return

if(client?.holder)
SSqueue.queue_bypass_list |= ckey
return

if(length(GLOB.clients) < SSqueue.queue_threshold)
SSqueue.queue_bypass_list |= ckey
return

src << link(GLOB.configuration.overflow.overflow_server_location)

/mob/new_player/Logout()
. = ..()

addtimer(CALLBACK(src, PROC_REF(reserve_queue_slot)), 10 MINUTES)

/mob/new_player/proc/reserve_queue_slot()
if(client?.ckey in GLOB.player_list)
return

SSqueue.queue_bypass_list.Remove(last_known_ckey)
17 changes: 17 additions & 0 deletions modular_ss220/queue/code/queue_bypass.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/datum/world_topic_handler/queue_bypass
topic_key = "queue_bypass"
requires_commskey = TRUE

/datum/world_topic_handler/queue_bypass/execute(list/input, key_valid)
var/ckey_check = input["ckey_check"]

if(!ckey_check)
return json_encode(list("error" = "No ckey supplied"))

var/list/output_data = list()
output_data["queue_enabled"] = SSqueue.queue_enabled

if(SSqueue.queue_enabled)
SSqueue.queue_bypass_list |= ckey_check

return json_encode(output_data)

0 comments on commit 48d6565

Please sign in to comment.