|
23 | 23 | if(!parent.client)
|
24 | 24 | return
|
25 | 25 |
|
26 |
| - if(parent.client.restricted_mode) |
27 |
| - if(href_list["verify"]) |
28 |
| - show_otp_menu() |
29 |
| - return TRUE |
30 | 26 |
|
31 |
| - if(href_list["link_to_discord"]) |
32 |
| - var/_link = CONFIG_GET(string/panic_bunker_discord_link) |
33 |
| - if(_link) |
34 |
| - parent << link(_link) |
35 |
| - return TRUE |
| 27 | + if(href_list["verify"]) |
| 28 | + show_otp_menu() |
| 29 | + return TRUE |
36 | 30 |
|
| 31 | + if(href_list["link_to_discord"]) |
| 32 | + var/_link = CONFIG_GET(string/panic_bunker_discord_link) |
| 33 | + if(_link) |
| 34 | + parent << link(_link) |
| 35 | + return TRUE |
| 36 | + |
| 37 | + //Restricted clients can't do anything else. |
| 38 | + if(parent.client.restricted_mode) |
37 | 39 | return TRUE
|
38 | 40 |
|
39 | 41 | if(href_list["npp_options"])
|
|
218 | 220 | <div>
|
219 | 221 | >[LINKIFY_CONSOLE_OPTION("lore_primer.txt", "view_primer=1")]
|
220 | 222 | </div>
|
| 223 | + <div> |
| 224 | + >[LINKIFY_CONSOLE_OPTION("discord_link.lnk", "verify=1")] |
| 225 | + </div> |
221 | 226 | [poll]
|
222 | 227 | <br>
|
223 | 228 | <div>
|
|
330 | 335 | if(!parent.client)
|
331 | 336 | return
|
332 | 337 |
|
| 338 | + if(!CONFIG_GET(flag/sql_enabled)) |
| 339 | + alert(parent.client, "No database to link to, bud. Scream at the host.", "Writing to Nowhere.") |
| 340 | + return |
| 341 | + |
| 342 | + if(isnull(parent.client.linked_discord_account)) |
| 343 | + alert(parent.client, "You haven't fully loaded, please wait...", "Please Wait") |
| 344 | + return |
| 345 | + |
| 346 | + if(parent.client.linked_discord_account?.valid) |
| 347 | + alert(parent.client, "Your discord account is already linked.\nIf you believe this is in error, please contact staff.\nLinked ID: [parent.client.linked_discord_account.discord_id]", "Already Linked") |
| 348 | + return |
| 349 | + |
333 | 350 | var/discord_otp = parent.client.discord_get_or_generate_one_time_token_for_ckey(parent.ckey)
|
334 | 351 | var/discord_prefix = CONFIG_GET(string/discordbotcommandprefix)
|
335 | 352 | var/browse_body = {"
|
|
348 | 365 | "}
|
349 | 366 |
|
350 | 367 | var/datum/browser/popup = new(parent, "discordauth", "<center><div>Verification</div></center>", 660, 270)
|
351 |
| - popup.set_window_options("can_close=0;focus=true;can_resize=0") |
| 368 | + //If we aren't in restricted mode, let them close the window. |
| 369 | + popup.set_window_options("can_close=[!parent.client.restricted_mode];focus=true;can_resize=0") |
352 | 370 | popup.set_content(browse_body)
|
353 | 371 | popup.open()
|
354 | 372 |
|
|
0 commit comments