mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 17:52:36 +00:00
NTNet airlocks (#35947)
* Standardizes access checks * Makes SS Networks init before SS Atoms to prevent NTNet interfaces from initializing before them * Adds passkey support to NTNet packets * Adds NTNet support to airlocks, makes door remote use NTNet * Access levels given by jobs are now shuffled * Access code improvements * Adds IC card readers * Fixes a delay issue with opening/closing airlocks with NTNet or signalers * code review memes * Renames plaintext_passkey to encrypted_passkey * death by thousand nitpicks
This commit is contained in:
@@ -6,7 +6,24 @@
|
||||
|
||||
var/plaintext_data
|
||||
var/plaintext_data_secondary
|
||||
var/plaintext_passkey
|
||||
var/encrypted_passkey
|
||||
|
||||
var/list/passkey
|
||||
|
||||
// Process data before sending it
|
||||
/datum/netdata/proc/pre_send(datum/component/ntnet_interface/interface)
|
||||
// Decrypt the passkey.
|
||||
if(encrypted_passkey && !passkey)
|
||||
passkey = json_decode(XorEncrypt(hextostr(encrypted_passkey, TRUE), SScircuit.cipherkey))
|
||||
|
||||
// Encrypt the passkey.
|
||||
if(!encrypted_passkey && passkey)
|
||||
encrypted_passkey = strtohex(XorEncrypt(json_encode(passkey), SScircuit.cipherkey))
|
||||
|
||||
// If there is no sender ID, set the default one.
|
||||
if(!sender_id && interface)
|
||||
sender_id = interface.hardware_id
|
||||
|
||||
|
||||
/datum/netdata/proc/json_list_generation_admin() //for admin logs and such.
|
||||
. = list()
|
||||
@@ -21,9 +38,9 @@
|
||||
. = list()
|
||||
.["recipient_ids"] = recipient_ids
|
||||
.["sender_id"] = sender_id
|
||||
.["plaintext_data"] = plaintext_data
|
||||
.["plaintext_data_secondary"] = plaintext_data_secondary
|
||||
.["plaintext_passkey"] = plaintext_passkey
|
||||
.["data"] = plaintext_data
|
||||
.["data_secondary"] = plaintext_data_secondary
|
||||
.["passkey"] = encrypted_passkey
|
||||
|
||||
/datum/netdata/proc/generate_netlog()
|
||||
return "[json_encode(json_list_generation_netlog())]"
|
||||
|
||||
Reference in New Issue
Block a user