mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-06 23:41:57 +00:00
Wireless and spawn_sync tweaks
Modified spawn_sync to include the spawning code, thus simplifying it's usage. Modified spawn_sync to use actual time for failsafes. A couple of sensibility tweaks for the wireless controller. Cleaned up devices.dm to use new spawn_sync code. Suggestions courtesy of @mwerezak Added a changelog
This commit is contained in:
@@ -46,20 +46,18 @@ var/datum/controller/process/wireless/wirelessProcess
|
||||
pending_connections += C
|
||||
|
||||
/datum/controller/process/wireless/doWork()
|
||||
//process any pending connection requests
|
||||
if(pending_connections.len > 0)
|
||||
//any that fail are moved to the retry queue
|
||||
process_queue(pending_connections, retry_connections)
|
||||
//quit here so the retry connection attempt is delayed one cycle
|
||||
return
|
||||
|
||||
//process any connection requests waiting to be retried
|
||||
if(retry_connections.len > 0)
|
||||
//any that fail are moved into the failed connections list
|
||||
process_queue(retry_connections, failed_connections)
|
||||
|
||||
/datum/controller/process/wireless/proc/process_queue(var/list/input_queue, var/list/output_queue)
|
||||
for(var/datum/connection_request/C in input_queue)
|
||||
//process any pending connection requests
|
||||
if(pending_connections.len > 0)
|
||||
//any that fail are moved to the retry queue
|
||||
process_queue(pending_connections, retry_connections)
|
||||
|
||||
/datum/controller/process/wireless/proc/process_queue(var/list/process_conections, var/list/unsuccesful_connections)
|
||||
for(var/datum/connection_request/C in process_conections)
|
||||
var/target_found = 0
|
||||
for(var/datum/wifi/receiver/R in receiver_list)
|
||||
if(R.id == C.id)
|
||||
@@ -67,7 +65,7 @@ var/datum/controller/process/wireless/wirelessProcess
|
||||
S.connect_device(R)
|
||||
R.connect_device(S)
|
||||
target_found = 1
|
||||
input_queue -= C
|
||||
process_conections -= C
|
||||
if(!target_found)
|
||||
output_queue += C
|
||||
unsuccesful_connections += C
|
||||
SCHECK
|
||||
|
||||
Reference in New Issue
Block a user