Files
Bubberstation/code/modules/wiremod/components/admin/sdql.dm
SkyratBot 9e74cd4a03 [MIRROR] Input ports now connect to multiple output ports. Remove combiner. (#7505)
* Input ports now connect to multiple output ports. Remove combiner. (#60494)

* tgui bsod

* debug disconnections

* prelim

* recomment

* set_value -> put ._.

* DAMN IT

* reinsert subsystem

* prepare

* unditch signals

* remove combiner

* remove combiner some more

* how did router.dm get here? deleting.

* These two COMSIGS should be one.

* critical typo

* inline cast

* have your signals

* Have your set_input & set_output.

* make compile

* upgrade save/load to n-to-n-wires

* have your documentation

* have your unsafe proc

* pay no attention to the compile errors

* unlist the ref

* paste my for block back in ._.

* fix manual input

* oops pushed too soon

* Have your !port.connected_to?.length

Co-authored-by: Watermelon914 <37270891+Watermelon914@ users.noreply.github.com>

Co-authored-by: Watermelon914 <37270891+Watermelon914@ users.noreply.github.com>

* Input ports now connect to multiple output ports. Remove combiner.

Co-authored-by: Gurkenglas <gurkenglas@hotmail.de>
Co-authored-by: Watermelon914 <37270891+Watermelon914@ users.noreply.github.com>
2021-08-11 20:27:29 +01:00

37 lines
1.1 KiB
Plaintext

/**
* # SDQL Component
*
* A component that performs an sdql operation
*/
/obj/item/circuit_component/sdql_operation
display_name = "SDQL Operation"
desc = "A component that performs an SDQL operation when invoked."
circuit_flags = CIRCUIT_FLAG_INPUT_SIGNAL|CIRCUIT_FLAG_OUTPUT_SIGNAL|CIRCUIT_FLAG_ADMIN
/// SDQL Operation to invoke
var/datum/port/input/sdql_operation
var/datum/port/output/results
/obj/item/circuit_component/sdql_operation/Initialize()
. = ..()
sdql_operation = add_input_port("SDQL String", PORT_TYPE_STRING)
results = add_output_port("Result", PORT_TYPE_LIST)
/obj/item/circuit_component/sdql_operation/input_received(datum/port/input/port)
. = ..()
if(.)
return
var/operation = sdql_operation.value
if(GLOB.AdminProcCaller || !operation)
return TRUE
GLOB.AdminProcCaller = "CHAT_[parent.display_name]" //_ won't show up in ckeys so it'll never match with a real admin
var/list/result = world.SDQL2_query(operation, parent.get_creator_admin(), parent.get_creator())
GLOB.AdminProcCaller = null
results.set_output(result)