Faxes get logged into the SQL server, for discord retreival. (#2874)

## About The Pull Request

Faxes get logged into the SQL server, for discord retreival. Will
integrate with my bot.
## Why It's Good For The Game

More admins responding and seeing your faxes. 

## Proof Of Testing

![heidisql_OsBij5ujr7](https://github.com/user-attachments/assets/8dfd2a74-5148-41fc-a948-85a5ff9b95fe)


## Changelog
🆑
admin: Faxes now get sent to the database. 
/🆑
This commit is contained in:
nevimer
2025-01-10 16:27:34 -05:00
committed by GitHub
parent d5326c7aba
commit e88199c611
2 changed files with 26 additions and 0 deletions

View File

@@ -33,3 +33,15 @@ CREATE TABLE `vetted_list` (
PRIMARY KEY (`ckey`) PRIMARY KEY (`ckey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `stored_faxes`;
CREATE TABLE `stored_faxes` (
`sender` VARCHAR(512) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
`destination_fax_machine` VARCHAR(512) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
`message` MEDIUMTEXT NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
`roundid` INT(11) NULL DEFAULT NULL,
`relayed` INT(11) NULL DEFAULT '0'
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
;

View File

@@ -349,6 +349,20 @@ GLOBAL_VAR_INIT(nt_fax_department, pick("NT HR Department", "NT Legal Department
if (istype(sent, /obj/item/paper)) if (istype(sent, /obj/item/paper))
var/obj/item/paper/sent_paper = sent var/obj/item/paper/sent_paper = sent
log_paper("[usr] has sent a fax with the message \"[sent_paper.get_raw_text()]\" to [name]/[destination_id].") log_paper("[usr] has sent a fax with the message \"[sent_paper.get_raw_text()]\" to [name]/[destination_id].")
// BUBBER EDIT BEGIN
var/datum/db_query/query = SSdbcore.NewQuery({"
INSERT INTO [format_table_name("stored_faxes")] (sender, destination_fax_machine, message, roundid, relayed)
VALUES (:sender, :destination_fax_machine, :message, :roundid, :relayed)
"}, list(
"sender" = usr,
"destination_fax_machine" = destination_id,
"message" = sent_paper.get_raw_text(),
"recipient" = name,
"roundid" = GLOB.round_id,
"relayed" = 0,
))
query.Execute()
// BUBBER EDIT END
return return
log_game("[usr] has faxed [sent] to [name]/[destination_id].]") log_game("[usr] has faxed [sent] to [name]/[destination_id].]")