Shuttle console refactoring

Also adjusted the way undocking signals were used.
This commit is contained in:
mwerezak
2014-06-11 19:42:59 -04:00
parent acec01fb14
commit 232e50e415
7 changed files with 216 additions and 176 deletions

View File

@@ -109,11 +109,6 @@
/datum/computer/file/embedded_program/docking/airlock/ready_for_undocking()
return airlock_program.check_doors_secured()
/datum/computer/file/embedded_program/docking/airlock/reset()
airlock_program.stop_cycling()
airlock_program.close_doors()
..()
//An airlock controller to be used by the airlock-based docking port controller.
//Same as a regular airlock controller but allows disabling of the regular airlock functions when docking
/datum/computer/file/embedded_program/airlock/docking
@@ -132,7 +127,7 @@
if (master_prog.undocked() || master_prog.override_enabled) //only allow the port to be used as an airlock if nothing is docked here or the override is enabled
..(target)
/*** DEBUG VERBS ***
/*** DEBUG VERBS ***/
/datum/computer/file/embedded_program/docking/proc/print_state()
world << "id_tag: [id_tag]"
@@ -171,4 +166,5 @@
set category = "Debug"
set src in view(1)
src.program:initiate_undocking()
*/
/**/

View File

@@ -14,7 +14,7 @@
MODE_CLIENT|STATE_UNDOCKED sent a request for docking and now waiting for a reply.
MODE_CLIENT|STATE_DOCKING server told us they are OK to dock, waiting for our docking port to be ready.
MODE_CLIENT|STATE_DOCKED idle - docked as client.
MODE_CLIENT|STATE_UNDOCKING we are either waiting for our docking port to be ready or for the server to give us the OK to undock.
MODE_CLIENT|STATE_UNDOCKING we are either waiting for our docking port to be ready or for the server to give us the OK to finish undocking.
MODE_SERVER|STATE_UNDOCKED should never happen.
MODE_SERVER|STATE_DOCKING someone requested docking, we are waiting for our docking port to be ready.
@@ -34,7 +34,7 @@
launches is not the docking controller's responsibility). In this case it is up to the players to manually get the docking port into a good state to undock
(which usually just means closing and locking the doors).
In line with this, docking controllers should prevent players from manually doing things when the override is disabled.
In line with this, docking controllers should prevent players from manually doing things when the override is NOT enabled.
*/
@@ -88,7 +88,7 @@
dock_state = STATE_UNDOCKING
if (!override_enabled)
prepare_for_undocking()
if ("dock_error")
if (receive_tag == tag_target)
reset()
@@ -96,7 +96,7 @@
/datum/computer/file/embedded_program/docking/process()
switch(dock_state)
if (STATE_DOCKING) //waiting for our docking port to be ready for docking
if (ready_for_docking() || override_enabled)
if (ready_for_docking())
if (!response_sent)
send_docking_command(tag_target, "confirm_dock") //tell the other guy we're ready
response_sent = 1
@@ -107,16 +107,17 @@
finish_docking() //client done docking!
response_sent = 0
if (STATE_UNDOCKING)
if (ready_for_undocking() || override_enabled)
if (ready_for_undocking())
if (control_mode == MODE_CLIENT)
if (!response_sent)
send_docking_command(tag_target, "request_undock") //tell the server we want to undock now.
response_sent = 1
else if (control_mode == MODE_SERVER)
send_docking_command(tag_target, "confirm_undock") //tell the client we are OK to undock.
if (!override_enabled)
finish_undocking()
reset() //server is done undocking!
if (!override_enabled)
finish_undocking()
reset() //server is done undocking!
if (dock_state != STATE_DOCKING && dock_state != STATE_UNDOCKING)
response_sent = 0
@@ -147,8 +148,7 @@
if (!override_enabled)
prepare_for_undocking()
send_docking_command(tag_target, "request_undock")
//send_docking_command(tag_target, "request_undock")
//tell the docking port to start getting ready for docking - e.g. pressurize
/datum/computer/file/embedded_program/docking/proc/prepare_for_docking()
@@ -187,6 +187,7 @@
response_sent = 0
/datum/computer/file/embedded_program/docking/proc/force_undock()
world << "[id_tag]: forcing undock"
if (tag_target)
send_docking_command(tag_target, "dock_error")
reset()

View File

@@ -127,11 +127,7 @@
/datum/computer/file/embedded_program/docking/simple/ready_for_undocking()
return (memory["door_status"]["state"] == "closed" && memory["door_status"]["lock"] == "locked")
/datum/computer/file/embedded_program/docking/simple/reset()
close_door()
..()
/*** DEBUG VERBS ***
/*** DEBUG VERBS ***/
/obj/machinery/embedded_controller/radio/simple_docking_controller/verb/view_state()
set category = "Debug"
@@ -157,4 +153,5 @@
set category = "Debug"
set src in view(1)
src.program:initiate_undocking()
*/
/**/