mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-11 23:23:28 +01:00
Adds a round notify system
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user