[MIRROR] Mass-PDA perms is configured on Wirecarp [MDB IGNORE] (#13663)

* Mass-PDA perms is configured on Wirecarp (#66889)

Lawyers and Captains spawn by-default with the ability to send mass PDA messages, but the Wirecarp app (so Research Director and Captain) can grant/revoke permission to send PDAs to everyone

* Mass-PDA perms is configured on Wirecarp

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-05-17 09:12:12 +02:00
committed by GitHub
parent 819ee9f307
commit a11d253cf5
6 changed files with 277 additions and 130 deletions

View File

@@ -77,7 +77,6 @@
circuit = /obj/item/circuitboard/machine/telecomms/message_server
var/list/datum/data_tablet_msg/pda_msgs = list()
var/list/datum/data_tablet_msg/modular_msgs = list()
var/list/datum/data_rc_msg/rc_msgs = list()
var/decryptkey = "password"
var/calibrating = 15 MINUTES //Init reads this and adds world.time, then becomes 0 when that time has passed and the machine works

View File

@@ -26,6 +26,11 @@
/obj/item/modular_computer/tablet/pda/heads/captain/Initialize(mapload)
. = ..()
RegisterSignal(src, COMSIG_TABLET_CHECK_DETONATE, .proc/tab_no_detonate)
var/obj/item/computer_hardware/hard_drive/drive = all_components[MC_HDD]
if(!drive)
return
for(var/datum/computer_file/program/messenger/messenger_app in drive.stored_files)
messenger_app.spam_mode = TRUE
/obj/item/modular_computer/tablet/pda/heads/hop
name = "head of personnel PDA"
@@ -274,6 +279,14 @@
/datum/computer_file/program/records/security,
)
/obj/item/modular_computer/tablet/pda/lawyer/Initialize(mapload)
. = ..()
var/obj/item/computer_hardware/hard_drive/drive = all_components[MC_HDD]
if(!drive)
return
for(var/datum/computer_file/program/messenger/messenger_app in drive.stored_files)
messenger_app.spam_mode = TRUE
/obj/item/modular_computer/tablet/pda/botanist
name = "botanist PDA"
greyscale_config = /datum/greyscale_config/tablet/stripe_thick

View File

@@ -45,6 +45,8 @@
var/is_silicon = FALSE
/// Whether or not we're in a mime PDA.
var/mime_mode = FALSE
/// Whether this app can send messages to all.
var/spam_mode = FALSE
/datum/computer_file/program/messenger/proc/ScrubMessengerList()
var/list/dictionary = list()
@@ -185,11 +187,7 @@
data["sortByJob"] = sort_by_job
data["isSilicon"] = is_silicon
data["photo"] = photo_path
var/obj/item/computer_hardware/card_slot/card_slot = computer.all_components[MC_CARD]
if(card_slot)
var/obj/item/card/id/id_card = card_slot ? card_slot.stored_card : ""
data["canSpam"] = (ACCESS_LAWYER in id_card?.access)
data["canSpam"] = spam_mode
var/obj/item/computer_hardware/hard_drive/portable/virus/disk = computer.all_components[MC_SDD]
if(disk)

View File

@@ -11,7 +11,7 @@
tgui_id = "NtosNetMonitor"
program_icon = "network-wired"
/datum/computer_file/program/ntnetmonitor/ui_act(action, params)
/datum/computer_file/program/ntnetmonitor/ui_act(action, list/params, datum/tgui/ui)
. = ..()
if(.)
return
@@ -49,6 +49,20 @@
return
SSnetworks.station_network.toggle_function(text2num(params["id"]))
return TRUE
if("toggle_mass_pda")
if(!SSnetworks.station_network)
return
var/mob/user = ui.user
var/obj/item/modular_computer/target_tablet = locate(params["ref"]) in GLOB.TabletMessengers
if(!istype(target_tablet))
return
var/obj/item/computer_hardware/hard_drive/drive = target_tablet.all_components[MC_HDD]
if(!drive)
to_chat(user, span_boldnotice("Target tablet somehow is lacking a hard drive."))
return
for(var/datum/computer_file/program/messenger/messenger_app in drive.stored_files)
messenger_app.spam_mode = !messenger_app.spam_mode
/datum/computer_file/program/ntnetmonitor/ui_data(mob/user)
if(!SSnetworks.station_network)
@@ -73,4 +87,19 @@
data["ntnetlogs"] += list(list("entry" = i))
data["ntnetmaxlogs"] = SSnetworks.setting_maxlogcount
data["tablets"] = list()
for(var/obj/item/modular_computer/messenger in GetViewableDevices())
var/list/tablet_data = list()
if(messenger.saved_identification)
var/obj/item/computer_hardware/hard_drive/drive = messenger.all_components[MC_HDD]
if(!drive)
continue
for(var/datum/computer_file/program/messenger/messenger_app in drive.stored_files)
tablet_data["enabled_spam"] += messenger_app.spam_mode
tablet_data["name"] += messenger.saved_identification
tablet_data["ref"] += REF(messenger)
data["tablets"] += list(tablet_data)
return data

View File

@@ -3674,7 +3674,6 @@
#include "code\modules\modular_computers\file_system\programs\notepad.dm"
#include "code\modules\modular_computers\file_system\programs\ntdownloader.dm"
#include "code\modules\modular_computers\file_system\programs\ntmessenger.dm"
#include "code\modules\modular_computers\file_system\programs\ntmonitor.dm"
#include "code\modules\modular_computers\file_system\programs\ntnrc_client.dm"
#include "code\modules\modular_computers\file_system\programs\phys_scanner.dm"
#include "code\modules\modular_computers\file_system\programs\portrait_printer.dm"
@@ -3689,6 +3688,7 @@
#include "code\modules\modular_computers\file_system\programs\sm_monitor.dm"
#include "code\modules\modular_computers\file_system\programs\statusdisplay.dm"
#include "code\modules\modular_computers\file_system\programs\techweb.dm"
#include "code\modules\modular_computers\file_system\programs\wirecarp.dm"
#include "code\modules\modular_computers\file_system\programs\antagonist\dos.dm"
#include "code\modules\modular_computers\file_system\programs\antagonist\revelation.dm"
#include "code\modules\modular_computers\hardware\_hardware.dm"

View File

@@ -1,9 +1,10 @@
import { useBackend } from '../backend';
import { Box, Button, LabeledList, NoticeBox, NumberInput, Section } from '../components';
import { useBackend, useSharedState } from '../backend';
import { Box, Button, LabeledList, NoticeBox, NumberInput, Icon, Section, Stack, Tabs } from '../components';
import { NtosWindow } from '../layouts';
export const NtosNetMonitor = (props, context) => {
const { act, data } = useBackend(context);
const [tab_main, setTab_main] = useSharedState(context, 'tab_main', 1);
const {
ntnetrelays,
ntnetstatus,
@@ -17,10 +18,75 @@ export const NtosNetMonitor = (props, context) => {
maxlogs,
minlogs,
ntnetlogs = [],
tablets = [],
} = data;
return (
<NtosWindow>
<NtosWindow.Content scrollable>
<Stack.Item>
<Tabs>
<Tabs.Tab
icon="network-wired"
lineHeight="23px"
selected={tab_main === 1}
onClick={() => setTab_main(1)}>
NtNet
</Tabs.Tab>
<Tabs.Tab
icon="tablet"
lineHeight="23px"
selected={tab_main === 2}
onClick={() => setTab_main(2)}>
Tablets ({tablets.length})
</Tabs.Tab>
</Tabs>
</Stack.Item>
{tab_main === 1 && (
<Stack.Item>
<MainPage
ntnetrelays={ntnetrelays}
ntnetstatus={ntnetstatus}
config_softwaredownload={config_softwaredownload}
config_peertopeer={config_peertopeer}
config_communication={config_communication}
config_systemcontrol={config_systemcontrol}
idsalarm={idsalarm}
idsstatus={idsstatus}
ntnetmaxlogs={ntnetmaxlogs}
maxlogs={maxlogs}
minlogs={minlogs}
ntnetlogs={ntnetlogs} />
</Stack.Item>
)}
{tab_main === 2 && (
<Stack.Item>
<TabletPage
tablets={tablets} />
</Stack.Item>
)}
</NtosWindow.Content>
</NtosWindow>
);
};
const MainPage = (props, context) => {
const {
ntnetrelays,
ntnetstatus,
config_softwaredownload,
config_peertopeer,
config_communication,
config_systemcontrol,
idsalarm,
idsstatus,
ntnetmaxlogs,
maxlogs,
minlogs,
ntnetlogs = [],
} = props;
const { act, data } = useBackend(context);
return (
<Section>
<NoticeBox>
WARNING: Disabling wireless transmitters when using
a wireless device may prevent you from reenabling them!
@@ -141,7 +207,49 @@ export const NtosNetMonitor = (props, context) => {
))}
</Section>
</Section>
</NtosWindow.Content>
</NtosWindow>
</Section>
);
};
const TabletPage = (props, context) => {
const { tablets } = props;
const { act, data } = useBackend(context);
if (!tablets.length) {
return (
<NoticeBox>
No tablets detected.
</NoticeBox>
);
}
return (
<Section>
<Stack vertical mt={1}>
<Section fill textAlign="center">
<Icon name="comment" mr={1} />
Active Tablets
</Section>
</Stack>
<Stack vertical mt={1}>
<Section fill>
<Stack vertical>
{tablets.map(tablet => (
<Section
key={tablet.ref}
title={tablet.name}
buttons={(
<Button.Confirm
icon={tablet.enabled_spam ? 'unlock' : 'lock'}
color={tablet.enabled_spam ? 'good' : 'default'}
content={tablet.enabled_spam ? "Restrict Mass PDA" : "Allow Mass PDA"}
onClick={() => act('toggle_mass_pda', {
ref: tablet.ref,
})}
/>
)} />
))}
</Stack>
</Section>
</Stack>
</Section>
);
};