Merge remote-tracking branch 'ParadiseSS13/master' into flatline_partner_fluff

This commit is contained in:
Gwydion Brain
2019-02-08 19:13:51 -08:00
18 changed files with 190 additions and 4 deletions
+7
View File
@@ -1327,6 +1327,13 @@
/obj/item/toy/plushie/fluff/fox/ui_action_click()
change_color()
/obj/item/clothing/suit/jacket/miljacket/desert/fox
name = "rugged military jacket"
desc = "A rugged brown military jacket with a stylized 'A' embroidered on the back. It seems very old, yet is in near mint condition. Has a tag on the inside collar signed 'Fox McCloud'."
icon = 'icons/obj/custom_items.dmi'
icon_state = "fox_coat"
item_color = "fox_coat"
// TheFlagbearer: Willow Walker
/obj/item/clothing/under/fluff/arachno_suit
name = "Arachno-Man costume"
+52
View File
@@ -0,0 +1,52 @@
// DONT TOUCH ANYTHING IN HERE UNLESS YOU KNOW WHAT YOU ARE DOING -affected
/client/verb/linkdiscord()
set category = "OOC"
set name = "Link Discord Account"
set desc = "Link your discord account to your BYOND account."
ckey = sanitizeSQL(usr.ckey) // Probably not neccassary but better safe than sorry
if(!config.sql_enabled)
to_chat(src, "<span class='warning'>This is feature requires the SQL backend</span>")
return
var/DBQuery/db_discord_id = dbcon.NewQuery("SELECT discord_id FROM [format_table_name("discord")] WHERE ckey = '[ckey]'")
if(!db_discord_id.Execute())
var/err = db_discord_id.ErrorMsg()
log_game("SQL ERROR while selecting discord account. Error : \[[err]\]\n")
to_chat(src, "<span class='warning'>Error checking Discord account. Please inform an administrator</span>")
return
var/stored_id
while(db_discord_id.NextRow())
stored_id = db_discord_id.item[1]
if(!stored_id) // Not linked
var/know_how = alert("Do you know how to get a discord user ID?","Question","Yes","No")
if(know_how == "No") // Opens discord support on how to collect IDs
src << link("https://support.discordapp.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID")
var/entered_id = input("Please enter your Discord ID.", "Enter Discord ID", null, null) as text|null
var/sql_id = sanitizeSQL(entered_id)
var/DBQuery/store_discord_id = dbcon.NewQuery("INSERT INTO [format_table_name("discord")] (ckey, discord_id, notify) VALUES ('[ckey]', [sql_id], 0)")
if(!store_discord_id.Execute())
var/err = db_discord_id.ErrorMsg()
log_game("SQL ERROR while linking discord account. Error : \[[err]\]\n")
to_chat(src, "<span class='warning'>Error linking Discord account. Please inform an administrator</span>")
return
to_chat(src, "<span class='notice'>Successfully linked discord account [entered_id] to [ckey]</span>")
else // Linked
var/choice = alert("You already have the Discord Account [stored_id] linked to [ckey]. Would you like to unlink or replace","Already Linked","Unlink","Replace")
switch(choice)
if("Unlink")
var/DBQuery/unlink_discord_id = dbcon.NewQuery("DELETE FROM [format_table_name("discord")] WHERE ckey = '[ckey]'")
if(!unlink_discord_id.Execute())
var/err = unlink_discord_id.ErrorMsg()
log_game("SQL ERROR while unlinking discord account. Error : \[[err]\]\n")
to_chat(src, "<span class='warning'>Error unlinking Discord account. Please inform an administrator</span>")
return
to_chat(src, "<span class='notice'>Successfully unlinked discord account</span>")
if("Replace")
var/entered_id = input("Please enter your Discord ID. Instructions can be found at https://bit.ly/2AfUu40", "Enter Discord ID", null, null) as text|null
var/sql_id = sanitizeSQL(entered_id)
var/DBQuery/store_discord_id = dbcon.NewQuery("UPDATE [format_table_name("discord")] SET discord_id = '[sql_id]' WHERE ckey='[ckey]'")
if(!store_discord_id.Execute())
var/err = db_discord_id.ErrorMsg()
to_chat(src, "<span class='warning'>Error replacing Discord account. Please inform an administrator</span>")
log_game("SQL ERROR while linking discord account. Error : \[[err]\]\n")
return
to_chat(src, "<span class='notice'>Successfully linked discord account [entered_id] to [ckey]</span>")
+48
View File
@@ -0,0 +1,48 @@
// DONT TOUCH ANYTHING IN HERE UNLESS YOU KNOW WHAT YOU ARE DOING -affected
/client/verb/notify_restart()
set category = "OOC"
set name = "Notify Restart"
set desc = "Notifies you on Discord when the server restarts."
if(!config.sql_enabled)
to_chat(src, "<span class='warning'>This is feature requires the SQL backend</span>")
return
var/DBQuery/db_discord_id = dbcon.NewQuery("SELECT discord_id FROM [format_table_name("discord")] WHERE ckey = '[ckey]'")
if(!db_discord_id.Execute())
var/err = db_discord_id.ErrorMsg()
log_game("SQL ERROR while selecting discord account. Error : \[[err]\]\n")
to_chat(src, "<span class='warning'>Error checking Discord account. Please inform an administrator</span>")
return
var/stored_id
while(db_discord_id.NextRow())
stored_id = db_discord_id.item[1]
if(!stored_id) // Not linked
to_chat(src, "<span class='warning'>This requires you to link your Discord account with the \"Link Discord Account\" verb.</span>")
return
else // Linked
var/DBQuery/toggle_status = dbcon.NewQuery("SELECT notify FROM [format_table_name("discord")] WHERE ckey = '[ckey]'")
if(!toggle_status.Execute())
var/err = toggle_status.ErrorMsg()
log_game("SQL ERROR while getting discord account. Error : \[[err]\]\n")
var/notify_status
while(toggle_status.NextRow())
notify_status = toggle_status.item[1]
if(notify_status) // Data is there
switch(notify_status)
if("0")
var/DBQuery/update_notify = dbcon.NewQuery("UPDATE [format_table_name("discord")] SET notify = 1 WHERE ckey='[ckey]'")
if(!update_notify.Execute())
var/err = db_discord_id.ErrorMsg()
to_chat(src, "<span class='warning'>Error updating notify status. Please inform an administrator</span>")
log_game("SQL ERROR while updating notify status. Error : \[[err]\]\n")
return
to_chat(src, "<span class='notice'>You will now be notified on discord when the next round is starting</span>")
if("1")
var/DBQuery/update_notify = dbcon.NewQuery("UPDATE [format_table_name("discord")] SET notify = 0 WHERE ckey='[ckey]'")
if(!update_notify.Execute())
var/err = db_discord_id.ErrorMsg()
to_chat(src, "<span class='warning'>Error updating notify status. Please inform an administrator</span>")
log_game("SQL ERROR while updating notify status. Error : \[[err]\]\n")
return
to_chat(src, "<span class='notice'>You will no longer be notified on discord when the next round is starting</span>")
else // Oh fuck what the hell happened
to_chat(src, "<span class='danger'>Something has gone VERY wrong, or affected cant code.</span>")
+14 -1
View File
@@ -17,5 +17,18 @@
return
/hook/startup/proc/ircNotify()
send2mainirc("Server starting up on [station_name()]. Connect to: [config.server? "[config.server]" : "[world.address]:[world.port]"]")
var/people_to_ping = ""
var/DBQuery/pull_notify = dbcon.NewQuery("SELECT discord_id FROM [format_table_name("discord")] WHERE notify = 1")
if(!pull_notify.Execute())
var/err = pull_notify.ErrorMsg()
log_game("SQL ERROR while pulling notify people. Error : \[[err]\]\n")
else
while(pull_notify.NextRow())
people_to_ping += "<@" + pull_notify.item[1] + "> "
send2mainirc("Server starting up on [station_name()]. Connect to: <byond://[config.server? "[config.server]" : "[world.address]:[world.port]"]> "+people_to_ping)
// Set notify to 0 so people arent pinged round after round
var/DBQuery/reset_notify = dbcon.NewQuery("UPDATE [format_table_name("discord")] SET notify = 0 WHERE notify = 1")
if(!reset_notify.Execute())
var/err = reset_notify.ErrorMsg()
log_game("SQL ERROR while resetting notify status. Error : \[[err]\]\n")
return 1