diff --git a/code/WorkInProgress/Mini/ATM.dm b/code/WorkInProgress/Mini/ATM.dm index 7b72f915eea..9578c3a2a3d 100644 --- a/code/WorkInProgress/Mini/ATM.dm +++ b/code/WorkInProgress/Mini/ATM.dm @@ -43,7 +43,7 @@ log transactions if(stat & NOPOWER) return - if(linked_db && ( !(linked_db.stat & NOPOWER) || !linked_db.activated) ) + if(linked_db && ( (linked_db.stat & NOPOWER) || !linked_db.activated ) ) linked_db = null authenticated_account = null src.visible_message("\red \icon[src] [src] buzzes rudely, \"Connection to remote database lost.\"") @@ -68,7 +68,7 @@ log transactions /obj/machinery/atm/proc/reconnect_database() for(var/obj/machinery/account_database/DB in world) - if(DB.z == src.z && ( !(DB.stat & NOPOWER) || !linked_db.activated) ) + if( DB.z == src.z && !(DB.stat & NOPOWER) && DB.activated ) linked_db = DB break @@ -259,7 +259,7 @@ log transactions T.time = worldtime2text() authenticated_account.transaction_log.Add(T) else - usr << "\red \icon[src] incorrect pin/account combination entered, [max_pin_attempts - number_incorrect_tries] attempts remaining." + usr << "\red \icon[src] Incorrect pin/account combination entered, [max_pin_attempts - number_incorrect_tries] attempts remaining." previous_account_number = tried_account_num playsound(src, 'buzz-sigh.ogg', 50, 1) else @@ -279,6 +279,8 @@ log transactions T.time = worldtime2text() authenticated_account.transaction_log.Add(T) + usr << "\blue \icon[src] Access granted. Welcome user '[authenticated_account.owner_name].'" + previous_account_number = tried_account_num if("withdrawal") var/amount = max(text2num(href_list["funds_amount"]),0) @@ -342,8 +344,8 @@ log transactions held_card = I if("logout") authenticated_account = null - usr << browse(null,"window=atm") - return + //usr << browse(null,"window=atm") + src.attack_hand(usr) //create the most effective combination of notes to make up the requested amount @@ -385,3 +387,14 @@ log transactions I = P.id if(I) authenticated_account = linked_db.attempt_account_access(I.associated_account_number) + if(authenticated_account) + human_user << "\blue \icon[src] Access granted. Welcome user '[authenticated_account.owner_name].'" + + //create a transaction log entry + var/datum/transaction/T = new() + T.target_name = authenticated_account.owner_name + T.purpose = "Remote terminal access" + T.source_terminal = machine_id + T.date = current_date_string + T.time = worldtime2text() + authenticated_account.transaction_log.Add(T)