Adds a round notify system

This commit is contained in:
AffectedArc07
2019-01-26 21:23:10 +00:00
parent 693eae879a
commit 3b75eaaba3
9 changed files with 152 additions and 3 deletions
+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