mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-22 16:12:19 +00:00
Only Announce Faxes if someone doesnt have their PDA linked (#5291)
* Adds the ability to announce a fax only if someone doesnt have their PDA linked, * Added SQL migration of expansion of do injunctions * Changes "warning" to "reprimand"
This commit is contained in:
11
SQL/migrate/V031__more_do_options.sql
Normal file
11
SQL/migrate/V031__more_do_options.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
--
|
||||
-- Adds HTML style value to the player preferences table.
|
||||
--
|
||||
|
||||
ALTER TABLE `ss13_ccia_actions`
|
||||
CHANGE COLUMN `type` `type` ENUM('injunction','suspension','warning','reprimand','demotion','other') NOT NULL COLLATE 'utf8_unicode_ci' AFTER `title`;
|
||||
|
||||
UPDATE ss13_ccia_actions SET type = "reprimand" WHERE type = "warning";
|
||||
|
||||
ALTER TABLE `ss13_ccia_actions`
|
||||
CHANGE COLUMN `type` `type` ENUM('injunction','suspension','reprimand','demotion','other') NOT NULL COLLATE 'utf8_unicode_ci' AFTER `title`;
|
||||
@@ -147,7 +147,7 @@ proc/api_update_command_database()
|
||||
var/versionstring = null
|
||||
//The Version Number follows SemVer http://semver.org/
|
||||
version["major"] = 2 //Major Version Number --> Increment when implementing breaking changes
|
||||
version["minor"] = 2 //Minor Version Number --> Increment when adding features
|
||||
version["minor"] = 3 //Minor Version Number --> Increment when adding features
|
||||
version["patch"] = 0 //Patchlevel --> Increment when fixing bugs
|
||||
|
||||
versionstring = "[version["major"]].[version["minor"]].[version["patch"]]"
|
||||
@@ -921,7 +921,7 @@ proc/api_update_command_database()
|
||||
var/senderkey = sanitize(queryparams["senderkey"]) //Identifier of the sender (Ckey / Userid / ...)
|
||||
var/faxtitle = sanitizeSafe(queryparams["title"]) //Title of the report
|
||||
var/faxbody = sanitize(queryparams["body"],max_length=0) //Body of the report
|
||||
var/faxannounce = text2num(queryparams["announce"]) //Announce the contents report to the public: 1 / 0
|
||||
var/faxannounce = text2num(queryparams["announce"]) //Announce the contents report to the public: 0 - Dont announce, 1 - Announce, 2 - Only if pda not linked
|
||||
|
||||
if(!targetlist || targetlist.len < 1)
|
||||
statuscode = 400
|
||||
@@ -930,6 +930,7 @@ proc/api_update_command_database()
|
||||
return 1
|
||||
|
||||
var/sendresult = 0
|
||||
var/notifyresult = 1
|
||||
|
||||
//Send the fax
|
||||
for (var/obj/machinery/photocopier/faxmachine/F in allfaxes)
|
||||
@@ -937,14 +938,18 @@ proc/api_update_command_database()
|
||||
sendresult = send_fax(F, faxtitle, faxbody, senderkey)
|
||||
if (sendresult == 1)
|
||||
sendsuccess.Add(F.department)
|
||||
responselist[F.department] = "success"
|
||||
if(!LAZYLEN(F.alert_pdas))
|
||||
notifyresult = 0
|
||||
responselist[F.department] = "notlinked"
|
||||
else
|
||||
responselist[F.department] = "success"
|
||||
else
|
||||
responselist[F.department] = "failed"
|
||||
|
||||
//Announce that the fax has been sent
|
||||
if(faxannounce == 1)
|
||||
if(faxannounce == 1 || (faxannounce==2 && notifyresult==0))
|
||||
if(sendsuccess.len < 1)
|
||||
command_announcement.Announce("A fax message from Central Command could not be delivered because all of the following fax machines are inoperational: <br>"+jointext(targetlist, ", "), "Fax Received", new_sound = 'sound/AI/commandreport.ogg', msg_sanitized = 1);
|
||||
command_announcement.Announce("A fax message from Central Command could not be delivered because all of the following fax machines are inoperational: <br>"+jointext(targetlist, ", "), "Fax Delivery Failure", new_sound = 'sound/AI/commandreport.ogg', msg_sanitized = 1);
|
||||
else
|
||||
command_announcement.Announce("A fax message from Central Command has been sent to the following fax machines: <br>"+jointext(sendsuccess, ", "), "Fax Received", new_sound = 'sound/AI/commandreport.ogg', msg_sanitized = 1);
|
||||
|
||||
@@ -978,7 +983,7 @@ proc/api_update_command_database()
|
||||
return 1
|
||||
else
|
||||
qdel(P)
|
||||
return 2
|
||||
return 0
|
||||
|
||||
// Update discord_bot's channels.
|
||||
/datum/topic_command/update_bot_channels
|
||||
|
||||
Reference in New Issue
Block a user