mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-22 08:01:06 +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
|
var/versionstring = null
|
||||||
//The Version Number follows SemVer http://semver.org/
|
//The Version Number follows SemVer http://semver.org/
|
||||||
version["major"] = 2 //Major Version Number --> Increment when implementing breaking changes
|
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
|
version["patch"] = 0 //Patchlevel --> Increment when fixing bugs
|
||||||
|
|
||||||
versionstring = "[version["major"]].[version["minor"]].[version["patch"]]"
|
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/senderkey = sanitize(queryparams["senderkey"]) //Identifier of the sender (Ckey / Userid / ...)
|
||||||
var/faxtitle = sanitizeSafe(queryparams["title"]) //Title of the report
|
var/faxtitle = sanitizeSafe(queryparams["title"]) //Title of the report
|
||||||
var/faxbody = sanitize(queryparams["body"],max_length=0) //Body 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)
|
if(!targetlist || targetlist.len < 1)
|
||||||
statuscode = 400
|
statuscode = 400
|
||||||
@@ -930,6 +930,7 @@ proc/api_update_command_database()
|
|||||||
return 1
|
return 1
|
||||||
|
|
||||||
var/sendresult = 0
|
var/sendresult = 0
|
||||||
|
var/notifyresult = 1
|
||||||
|
|
||||||
//Send the fax
|
//Send the fax
|
||||||
for (var/obj/machinery/photocopier/faxmachine/F in allfaxes)
|
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)
|
sendresult = send_fax(F, faxtitle, faxbody, senderkey)
|
||||||
if (sendresult == 1)
|
if (sendresult == 1)
|
||||||
sendsuccess.Add(F.department)
|
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
|
else
|
||||||
responselist[F.department] = "failed"
|
responselist[F.department] = "failed"
|
||||||
|
|
||||||
//Announce that the fax has been sent
|
//Announce that the fax has been sent
|
||||||
if(faxannounce == 1)
|
if(faxannounce == 1 || (faxannounce==2 && notifyresult==0))
|
||||||
if(sendsuccess.len < 1)
|
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
|
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);
|
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
|
return 1
|
||||||
else
|
else
|
||||||
qdel(P)
|
qdel(P)
|
||||||
return 2
|
return 0
|
||||||
|
|
||||||
// Update discord_bot's channels.
|
// Update discord_bot's channels.
|
||||||
/datum/topic_command/update_bot_channels
|
/datum/topic_command/update_bot_channels
|
||||||
|
|||||||
Reference in New Issue
Block a user