Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wip: SS Central - whitelist, discord link #946

Open
wants to merge 52 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
a512e53
wip ss central: wl and discord link
Furrior Dec 31, 2024
8713643
sshttp "improvement"
Furrior Jan 1, 2025
c537115
wip wl
Furrior Jan 1, 2025
c9191b7
typos
Furrior Jan 1, 2025
73b26b3
giving wl from interview
Furrior Jan 1, 2025
9bd06bd
nuke the old system
Furrior Jan 1, 2025
a50221f
Update modular_bandastation/tts/code/SSHttp.dm
Furrior Jan 1, 2025
91ef632
fixes
Furrior Jan 1, 2025
63508e8
Merge remote-tracking branch 'fur/sscentral' into sscentral
Furrior Jan 1, 2025
e211807
comments in config
Furrior Jan 1, 2025
0c05486
missed log
Furrior Jan 1, 2025
d3c84a6
typo
Furrior Jan 1, 2025
a6c86b4
or
Furrior Jan 1, 2025
06a1f85
Update modular_bandastation/metaserver/code/admin.dm
Furrior Jan 1, 2025
f98a847
various fixes
Furrior Jan 3, 2025
15afadf
atually include admin.dm
Furrior Jan 4, 2025
bc2bc96
rename discord link verb
Furrior Jan 4, 2025
c4bb628
admin.dm fixes
Furrior Jan 4, 2025
73411b9
better check for duration days
Furrior Jan 4, 2025
0188fe9
status code bandaid
Furrior Jan 4, 2025
bfba3c1
ah yes
Furrior Jan 4, 2025
be20bbc
update?
Furrior Feb 1, 2025
304f0fe
Merge remote-tracking branch 'origin/master' into sscentral
Furrior Feb 1, 2025
df71569
typo
Furrior Feb 1, 2025
b342c7e
fuck it
Furrior Feb 1, 2025
b31657e
fix tests
Furrior Feb 6, 2025
4589bab
its working I guess
Furrior Feb 7, 2025
a5e9cb6
config
Furrior Feb 7, 2025
cb5293a
bb
Furrior Feb 7, 2025
33ea3a7
central update
Furrior Feb 10, 2025
5a9575b
Update modular_bandastation/tts/code/SSHttp.dm
Furrior Feb 10, 2025
1b84f1c
req rename
Furrior Feb 10, 2025
255fe2f
admins need wl too
Furrior Feb 11, 2025
82dc99b
fiiiiiine
Furrior Feb 11, 2025
a37d5a7
wl double check
Furrior Feb 11, 2025
44af0ea
translations
Furrior Feb 11, 2025
d9d5d58
fixes
Furrior Feb 11, 2025
8dc5d27
stat entry
Furrior Feb 11, 2025
9ab24bc
typo
Furrior Feb 11, 2025
a24946b
translate no wl message
Furrior Feb 11, 2025
4b4e75c
Update modular_bandastation/metaserver/code/discord_link.dm
Furrior Feb 13, 2025
08a4f53
im tired
Furrior Feb 13, 2025
ba397be
renames
Furrior Feb 28, 2025
bfa084b
Merge remote-tracking branch 'origin/master' into sscentral
Furrior Feb 28, 2025
4822af3
aga
Furrior Mar 1, 2025
5e86dcd
final discord link steps
Furrior Mar 4, 2025
e884bcb
error handling
Furrior Mar 4, 2025
4c914cd
indexing
Furrior Mar 4, 2025
5760e40
some protections
Furrior Mar 4, 2025
de04f82
????
Furrior Mar 5, 2025
f197dfb
bandaid
Furrior Mar 5, 2025
6aa5fb5
sever
Furrior Mar 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
renames
Furrior committed Feb 28, 2025

Verified

This commit was signed with the committer’s verified signature.
Furrior Mikhail G.
commit ba397be5c4e2175c0dd9763c13e583174467ac29
2 changes: 1 addition & 1 deletion config/bandastation/bandastation_config.txt
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
## SS Central
#SS_CENTRAL_URL http://127.0.0.1:8000
#SS_CENTRAL_TOKEN 12345678
#WHITELIST_TYPE default
#SERVER_TYPE default
## Entry from the general config.txt
## New behavior - enabled PANIC_BUNKER_INTERVIEW allows only whitelisted players to play, passing interview gives a year long whitelist
#USEWHITELIST
12 changes: 6 additions & 6 deletions modular_bandastation/metaserver/code/ss_central.dm
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
default = ""
protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN

/datum/config_entry/string/whitelist_type
/datum/config_entry/string/sever_type
default = "default"

SUBSYSTEM_DEF(central)
@@ -22,11 +22,11 @@ SUBSYSTEM_DEF(central)
if(!initialized)
msg = "OFFLINE"
else
msg = "WL: [CONFIG_GET(flag/usewhitelist)] [CONFIG_GET(string/whitelist_type)]"
msg = "WL: [CONFIG_GET(flag/usewhitelist)] [CONFIG_GET(string/sever_type)]"
return ..()

/datum/controller/subsystem/central/proc/load_whitelist()
var/endpoint = "[CONFIG_GET(string/ss_central_url)]/whitelists/ckeys?wl_type=[CONFIG_GET(string/whitelist_type)]&active_only=true&page=1&page_size=9999"
var/endpoint = "[CONFIG_GET(string/ss_central_url)]/whitelists/ckeys?sever_type=[CONFIG_GET(string/sever_type)]&active_only=true&page=1&page_size=9999"

SShttp.create_async_request(RUSTG_HTTP_METHOD_GET, endpoint, "", list(), CALLBACK(src, PROC_REF(load_whitelist_callback)))

@@ -82,7 +82,7 @@ SUBSYSTEM_DEF(central)
if(ckey in GLOB.whitelist)
return TRUE

var/endpoint = "[CONFIG_GET(string/ss_central_url)]/whitelists?wl_type=[CONFIG_GET(string/whitelist_type)]&ckey=[ckey]&page=1&page_size=1"
var/endpoint = "[CONFIG_GET(string/ss_central_url)]/whitelists?sever_type=[CONFIG_GET(string/sever_type)]&ckey=[ckey]&page=1&page_size=1"
var/datum/http_response/response = SShttp.make_sync_request(RUSTG_HTTP_METHOD_GET, endpoint, "", list())
if(response.errored || response.status_code != 200 && response.status_code != 404)
return FALSE
@@ -99,7 +99,7 @@ SUBSYSTEM_DEF(central)
var/list/body = list()
body["player_ckey"] = ckey
body["admin_ckey"] = added_by
body["wl_type"] = CONFIG_GET(string/whitelist_type)
body["sever_type"] = CONFIG_GET(string/sever_type)
body["duration_days"] = duration_days

SShttp.create_async_request(RUSTG_HTTP_METHOD_POST, endpoint, json_encode(body), headers, CALLBACK(src, PROC_REF(add_to_whitelist_callback), ckey))
@@ -134,7 +134,7 @@ SUBSYSTEM_DEF(central)
var/list/body = list()
body["player_ckey"] = player_ckey
body["admin_ckey"] = admin_ckey
body["wl_type"] = CONFIG_GET(string/whitelist_type)
body["sever_type"] = CONFIG_GET(string/sever_type)
body["duration_days"] = duration_days
body["reason"] = reason