mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 05:00:55 +01:00
## About The Pull Request just macro-izes all the usages of verbs in the codebase as a pre-requisite to my follow up pr that serializes all the verbs arguments so we can tgui-ify the command bar, so we can then put it on the onscreen map. this also basically does the same as #94487 so can easily be integrated into the verb queueing stuff... but does not actually do any verb queueing by itself. basically im just trying to be https://github.com/tgstation/tgstation/labels/Atomic ## Why It's Good For The Game it doesn't really do anything by itself but it does let us do more stuff ## Changelog 🆑 code: the backend to all verbs in the game has been played with, please report any issues to github /🆑 --------- Co-authored-by: harryob <55142896+harryob@users.noreply.github.com>
37 lines
1.9 KiB
Plaintext
37 lines
1.9 KiB
Plaintext
// IF you have linked your account, this will trigger a verify of the user
|
|
GAME_VERB_DESC(/client, verify_in_discord, "Verify Discord Account", "Verify your discord account with your BYOND account", "OOC")
|
|
|
|
// Safety checks
|
|
if(!CONFIG_GET(flag/sql_enabled))
|
|
to_chat(src, span_warning("This feature requires the SQL backend to be running."))
|
|
return
|
|
|
|
// Why this would ever be unset, who knows
|
|
var/prefix = CONFIG_GET(string/discordbotcommandprefix)
|
|
if(!prefix)
|
|
to_chat(src, span_warning("This feature is disabled."))
|
|
return
|
|
|
|
if(!SSdiscord || !SSdiscord.reverify_cache)
|
|
to_chat(src, span_warning("Wait for the Discord subsystem to finish initialising"))
|
|
return
|
|
var/message = ""
|
|
// Simple sanity check to prevent a user doing this too often
|
|
var/cached_one_time_token = SSdiscord.reverify_cache[usr.ckey]
|
|
if(cached_one_time_token && cached_one_time_token != "")
|
|
message = "You already generated your one time token, it is [cached_one_time_token]. If you need a new one, you will have to wait until the round ends, or switch to another server; try verifying yourself on Discord by copying this command: <span class='code user-select'>[prefix]verify [cached_one_time_token]</span> and pasting it into the verification channel."
|
|
|
|
|
|
else
|
|
// Will generate one if an expired one doesn't exist already, otherwise will grab existing token
|
|
var/one_time_token = SSdiscord.get_or_generate_one_time_token_for_ckey(ckey)
|
|
SSdiscord.reverify_cache[usr.ckey] = one_time_token
|
|
message = "Your one time token is: [one_time_token]. Assuming you have the required living minutes in game, you can now verify yourself on Discord by using the command: <span class='code user-select'>[prefix]verify [one_time_token]</span>"
|
|
|
|
//Now give them a browse window so they can't miss whatever we told them
|
|
var/datum/browser/window = new /datum/browser(usr, "discordverification", "Discord Verification")
|
|
window.set_content("<div>[message]</div>")
|
|
window.open()
|
|
|
|
|