mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
* renamed implant malfunction defines * refactored domutation * possibly fix something about whitelists * fix admin_memo warning * fixed wrong attackby parameters in click.dm * remove superfluous return in BSQL * maybe fix something in mob/add_language * maybe fix more language stuff * Added return-type annotation to job_controller * removed unreachable code from observer.dm * possibly fix electrocute_act * fixed bees wow this code never ran, 100% tested * fixed parrot life * fixed wolf attack logs * fix bear life * removed unreachable slime/show_inv * fixed human/electrocute_act * actually just get rid of this shit * properly add return types * removed more returns from BSQL * added get_organ return type * fixed infrared holder_movement * fixed type_instances declaration * fixed unreacheable overlay/New * possibly fix release_restraints * remove hopefully final return from BSQL
46 lines
1.3 KiB
Plaintext
46 lines
1.3 KiB
Plaintext
/datum/BSQL_Operation
|
|
var/datum/BSQL_Connection/connection
|
|
var/id
|
|
|
|
BSQL_PROTECT_DATUM(/datum/BSQL_Operation)
|
|
|
|
/datum/BSQL_Operation/New(datum/BSQL_Connection/connection, id)
|
|
src.connection = connection
|
|
src.id = id
|
|
|
|
BSQL_DEL_PROC(/datum/BSQL_Operation)
|
|
var/error
|
|
if(!BSQL_IS_DELETED(connection))
|
|
error = world._BSQL_Internal_Call("ReleaseOperation", connection.id, id)
|
|
. = ..()
|
|
if(error)
|
|
BSQL_ERROR(error)
|
|
|
|
/datum/BSQL_Operation/IsComplete()
|
|
if(BSQL_IS_DELETED(connection))
|
|
return TRUE
|
|
var/result = world._BSQL_Internal_Call("OpComplete", connection.id, id)
|
|
if(!result)
|
|
BSQL_ERROR("Error fetching operation [id] for connection [connection.id]!")
|
|
return result == "DONE"
|
|
|
|
/datum/BSQL_Operation/GetError()
|
|
if(BSQL_IS_DELETED(connection))
|
|
return "Connection deleted!"
|
|
return world._BSQL_Internal_Call("GetError", connection.id, id)
|
|
|
|
/datum/BSQL_Operation/GetErrorCode()
|
|
if(BSQL_IS_DELETED(connection))
|
|
return -2
|
|
return text2num(world._BSQL_Internal_Call("GetErrorCode", connection.id, id))
|
|
|
|
/datum/BSQL_Operation/WaitForCompletion()
|
|
if(BSQL_IS_DELETED(connection))
|
|
return
|
|
var/error = world._BSQL_Internal_Call("BlockOnOperation", connection.id, id)
|
|
if(error)
|
|
if(error == "Operation timed out!") //match this with the implementation
|
|
return FALSE
|
|
BSQL_ERROR("Error waiting for operation [id] for connection [connection.id]! [error]")
|
|
return TRUE
|