mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-24 13:30:42 +01:00
Converted emitter remote control
Also converted crematoriums, although they are not working at the moment. Removed redundant wireless manager file.
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
/datum/wifi/receiver/button
|
||||
var/obj/parent
|
||||
|
||||
/datum/wifi/receiver/button/proc/activate(mob/living/user)
|
||||
|
||||
|
||||
/datum/wifi/sender/button/proc/activate(mob/living/user)
|
||||
for(var/datum/wifi/receiver/button/B in connected_devices)
|
||||
B.activate(user)
|
||||
|
||||
//-------------------------------
|
||||
// Emitter
|
||||
//-------------------------------
|
||||
/datum/wifi/receiver/button/emitter/New(var/new_id, var/obj/machinery/power/emitter/E)
|
||||
id = new_id
|
||||
if(istype(E))
|
||||
parent = E
|
||||
..()
|
||||
|
||||
/datum/wifi/receiver/button/emitter/activate(mob/living/user)
|
||||
..()
|
||||
var/obj/machinery/power/emitter/E = parent
|
||||
E.activate(user)
|
||||
|
||||
//-------------------------------
|
||||
// Crematorium
|
||||
//-------------------------------
|
||||
/datum/wifi/receiver/button/crematorium/New(var/new_id, var/obj/structure/crematorium/C)
|
||||
id = new_id
|
||||
if(istype(C))
|
||||
parent = C
|
||||
..()
|
||||
|
||||
/datum/wifi/receiver/button/crematorium/activate(mob/living/user)
|
||||
..()
|
||||
var/obj/structure/crematorium/C = parent
|
||||
C.cremate(user)
|
||||
@@ -1,47 +0,0 @@
|
||||
/datum/wifi_manager
|
||||
var/list/pending_connections
|
||||
var/list/receiver_list
|
||||
var/list/failed_connections
|
||||
|
||||
/datum/wifi_manager/New()
|
||||
pending_connections = new()
|
||||
receiver_list = new()
|
||||
failed_connections = new()
|
||||
|
||||
/datum/wifi_manager/proc/add_device(var/datum/wifi/receiver/R)
|
||||
receiver_list |= R
|
||||
|
||||
/datum/wifi_manager/proc/remove_device(var/datum/wifi/receiver/R)
|
||||
receiver_list -= R
|
||||
|
||||
/datum/wifi_manager/proc/add_request(var/datum/connection_request/C)
|
||||
pending_connections += C
|
||||
|
||||
/datum/wifi_manager/proc/process()
|
||||
//check any failed connections from the previous pass
|
||||
if(failed_connections.len > 0)
|
||||
for(var/datum/connection_request/C in failed_connections)
|
||||
var/target_found = 0
|
||||
for(var/datum/wifi/receiver/R in receiver_list)
|
||||
if(R.id == C.target)
|
||||
var/datum/wifi/sender/S = C.source
|
||||
S.connect_device(R)
|
||||
R.connect_device(S)
|
||||
target_found = 1
|
||||
failed_connections -= C
|
||||
if(!target_found)
|
||||
log_debug("[C.source] could not connect to \"[C.target]\"")
|
||||
|
||||
//check and try assigning any pending connections
|
||||
if(pending_connections.len > 0)
|
||||
for(var/datum/connection_request/C in pending_connections)
|
||||
var/target_found = 0
|
||||
for(var/datum/wifi/receiver/R in receiver_list)
|
||||
if(R.id == C.target)
|
||||
var/datum/wifi/sender/S = C.source
|
||||
S.connect_device(R)
|
||||
R.connect_device(S)
|
||||
target_found = 1
|
||||
pending_connections -= C
|
||||
if(!target_found)
|
||||
failed_connections += C
|
||||
Reference in New Issue
Block a user