Merge pull request #249 from Markolie/master

Revert economy changes, quarantine law fix
This commit is contained in:
Fox-McCloud
2015-02-02 17:59:30 -05:00
15 changed files with 437 additions and 251 deletions
-1
View File
@@ -1371,7 +1371,6 @@ datum/preferences
if("changeslot")
load_character(user,text2num(href_list["num"]))
default_slot=text2num(href_list["num"])
close_load_dialog(user)
if("tab")
+84 -88
View File
@@ -213,61 +213,58 @@
if (istype(I, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = I
visible_message("<span class='info'>[usr] swipes a card through [src].</span>")
// if(vendor_account)
var/attempt_pin = input("Enter pin code", "Vendor transaction") as num
var/datum/money_account/D = attempt_account_access(C.associated_account_number, attempt_pin, 2)
if(D)
var/transaction_amount = total()
if(transaction_amount <= D.money)
if(vendor_account)
var/attempt_pin = input("Enter pin code", "Vendor transaction") as num
var/datum/money_account/D = attempt_account_access(C.associated_account_number, attempt_pin, 2)
if(D)
var/transaction_amount = total()
if(transaction_amount <= D.money)
//transfer the money
D.money -= transaction_amount
D.update_balance(D.account_number,D.money)
//vendor_account.money += transaction_amount
//transfer the money
D.money -= transaction_amount
vendor_account.money += transaction_amount
//Transaction logs
var/datum/transaction/T = new()
T.target_name = "(via [src.name])"
T.purpose = "Purchase of Laptop"
if(transaction_amount > 0)
T.amount = "([transaction_amount])"
else
//Transaction logs
var/datum/transaction/T = new()
T.target_name = "[vendor_account.owner_name] (via [src.name])"
T.purpose = "Purchase of Laptop"
if(transaction_amount > 0)
T.amount = "([transaction_amount])"
else
T.amount = "[transaction_amount]"
T.source_terminal = src.name
T.date = current_date_string
T.time = worldtime2text()
D.transaction_log.Add(T)
//
T = new()
T.target_name = D.owner_name
T.purpose = "Purchase of Laptop"
T.amount = "[transaction_amount]"
T.source_terminal = src.name
T.date = current_date_string
T.time = worldtime2text()
D.transaction_log.Add(T)
T.source_terminal = src.name
T.date = current_date_string
T.time = worldtime2text()
vendor_account.transaction_log.Add(T)
/*
T = new()
T.target_name = D.owner_name
T.purpose = "Purchase of Laptop"
T.amount = "[transaction_amount]"
T.source_terminal = src.name
T.date = current_date_string
T.time = worldtime2text()
vendor_account.transaction_log.Add(T)
*/
newlap = new /obj/machinery/computer3/laptop/vended(src.loc)
newlap = new /obj/machinery/computer3/laptop/vended(src.loc)
choose_progs(C)
vend()
popup.close()
newlap.close_computer()
newlap = null
cardreader = 0
floppy = 0
radionet = 0
camera = 0
network = 0
power = 0
choose_progs(C)
vend()
popup.close()
newlap.close_computer()
newlap = null
cardreader = 0
floppy = 0
radionet = 0
camera = 0
network = 0
power = 0
else
usr << "\icon[src]<span class='warning'>You don't have that much money!</span>"
else
usr << "\icon[src]<span class='warning'>You don't have that much money!</span>"
usr << "\icon[src]<span class='warning'>Unable to access account. Check security settings and try again.</span>"
else
usr << "\icon[src]<span class='warning'>Unable to access account. Check security settings and try again.</span>"
// else
// usr << "\icon[src]<span class='warning'>Unable to access vendor account. Please record the machine ID and call CentComm Support.</span>"
usr << "\icon[src]<span class='warning'>Unable to access vendor account. Please record the machine ID and call CentComm Support.</span>"
/obj/machinery/lapvend/proc/total()
var/total = 0
@@ -363,50 +360,49 @@
if (istype(I, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = I
visible_message("<span class='info'>[usr] swipes a card through [src].</span>")
// if(vendor_account)
var/attempt_pin = input("Enter pin code", "Vendor transaction") as num
var/datum/money_account/D = attempt_account_access(C.associated_account_number, attempt_pin, 2)
if(D)
var/transaction_amount = total()
if(vendor_account)
var/attempt_pin = input("Enter pin code", "Vendor transaction") as num
var/datum/money_account/D = attempt_account_access(C.associated_account_number, attempt_pin, 2)
if(D)
var/transaction_amount = total()
//transfer the money
D.money += transaction_amount
//vendor_account.money -= transaction_amount
//transfer the money
D.money += transaction_amount
vendor_account.money -= transaction_amount
//Transaction logs
var/datum/transaction/T = new()
T.target_name = "(via [src.name])"
T.purpose = "Return purchase of Laptop"
if(transaction_amount > 0)
T.amount = "([transaction_amount])"
else
//Transaction logs
var/datum/transaction/T = new()
T.target_name = "[vendor_account.owner_name] (via [src.name])"
T.purpose = "Return purchase of Laptop"
if(transaction_amount > 0)
T.amount = "([transaction_amount])"
else
T.amount = "[transaction_amount]"
T.source_terminal = src.name
T.date = current_date_string
T.time = worldtime2text()
D.transaction_log.Add(T)
//
T = new()
T.target_name = D.owner_name
T.purpose = "Return purchase of Laptop"
T.amount = "[transaction_amount]"
T.source_terminal = src.name
T.date = current_date_string
T.time = worldtime2text()
D.transaction_log.Add(T)
T.source_terminal = src.name
T.date = current_date_string
T.time = worldtime2text()
vendor_account.transaction_log.Add(T)
/*
T = new()
T.target_name = D.owner_name
T.purpose = "Return purchase of Laptop"
T.amount = "[transaction_amount]"
T.source_terminal = src.name
T.date = current_date_string
T.time = worldtime2text()
vendor_account.transaction_log.Add(T)
*/
del(relap)
del(relap)
vendmode = 0
cardreader = 0
floppy = 0
radionet = 0
camera = 0
network = 0
power = 0
vendmode = 0
cardreader = 0
floppy = 0
radionet = 0
camera = 0
network = 0
power = 0
else
usr << "\icon[src]<span class='warning'>Unable to access account. Check security settings and try again.</span>"
else
usr << "\icon[src]<span class='warning'>Unable to access account. Check security settings and try again.</span>"
// else
// usr << "\icon[src]<span class='warning'>Unable to access vendor account. Please record the machine ID and call CentComm Support.</span>"
usr << "\icon[src]<span class='warning'>Unable to access vendor account. Please record the machine ID and call CentComm Support.</span>"
+1 -14
View File
@@ -98,7 +98,6 @@ log transactions
if(istype(I,/obj/item/weapon/spacecash))
//consume the money
authenticated_account.money += I:worth * I:amount
authenticated_account.update_balance(authenticated_account.account_number,authenticated_account.money)
if(prob(50))
playsound(loc, 'sound/items/polaroid1.ogg', 50, 1)
else
@@ -197,7 +196,6 @@ log transactions
<A href='?src=\ref[src];choice=view_screen;view_screen=1'>Change account security level</a><br>
<A href='?src=\ref[src];choice=view_screen;view_screen=2'>Make transfer</a><br>
<A href='?src=\ref[src];choice=view_screen;view_screen=3'>View transaction log</a><br>
<A href='?src=\ref[src];choice=change_pin'>Change PIN</a><br>
<A href='?src=\ref[src];choice=balance_statement'>Print balance statement</a><br>
<A href='?src=\ref[src];choice=logout'>Logout</a><br>"}
else if(linked_db)
@@ -219,7 +217,6 @@ log transactions
/obj/machinery/atm/Topic(var/href, var/href_list)
if(href_list["choice"])
switch(href_list["choice"])
if("transfer")
if(authenticated_account && linked_db)
var/transfer_amount = text2num(href_list["funds_amount"])
@@ -231,7 +228,6 @@ log transactions
if(linked_db.charge_to_account(target_account_number, authenticated_account.owner_name, transfer_purpose, machine_id, transfer_amount))
usr << "\icon[src]<span class='info'>Funds transfer successful.</span>"
authenticated_account.money -= transfer_amount
authenticated_account.update_balance(authenticated_account.account_number,authenticated_account.money)
//create an entry in the account transaction log
var/datum/transaction/T = new()
@@ -244,6 +240,7 @@ log transactions
authenticated_account.transaction_log.Add(T)
else
usr << "\icon[src]<span class='warning'>Funds transfer failed.</span>"
else
usr << "\icon[src]<span class='warning'>You don't have enough funds to do that!</span>"
if("view_screen")
@@ -315,7 +312,6 @@ log transactions
usr << "\blue The ATM's screen flashes, 'Maximum single withdrawl limit reached, defaulting to 10,000.'"
amount = 10000
authenticated_account.money -= amount
authenticated_account.update_balance(authenticated_account.account_number,authenticated_account.money)
withdraw_arbitrary_sum(amount)
//create an entry in the account transaction log
@@ -372,15 +368,6 @@ log transactions
usr.drop_item()
I.loc = src
held_card = I
if("change_pin")
if(authenticated_account)
var/new_pin = input(usr,"Enter new pin code", "PIN code changer") as num
authenticated_account.remote_access_pin = new_pin
var/DBQuery/query = dbcon.NewQuery("UPDATE characters SET account_pin='[new_pin]' WHERE account_number='[authenticated_account.account_number]'")
if(!query.Execute())
var/err = query.ErrorMsg()
log_game("SQL ERROR changing bank pin. Error : \[[err]\]\n")
message_admins("SQL ERROR changing bank pin. Error : \[[err]\]\n")
if("logout")
authenticated_account = null
//usr << browse(null,"window=atm")
+277 -33
View File
@@ -1,13 +1,12 @@
var/global/current_date_string
var/global/num_financial_terminals = 1
//var/global/datum/money_account/station_account
//var/global/list/datum/money_account/department_accounts = list()
var/global/datum/money_account/station_account
var/global/list/datum/money_account/department_accounts = list()
var/global/next_account_number = 0
var/global/obj/machinery/account_database/centcomm_account_db
//var/global/datum/money_account/vendor_account
var/global/datum/money_account/vendor_account
var/global/list/all_money_accounts = list()
/*
/proc/create_station_account()
if(!station_account)
next_account_number = rand(111111, 999999)
@@ -57,40 +56,67 @@ var/global/list/all_money_accounts = list()
//the current ingame time (hh:mm) can be obtained by calling:
//worldtime2text()
*/
/proc/create_account(var/mob/living/carbon/human/H, var/starting_funds = 0, var/obj/machinery/account_database/source_db, )
var/DBQuery/query = dbcon.NewQuery("SELECT account_number,account_pin,account_balance FROM characters WHERE ckey='[sql_sanitize_text(H.ckey)]' AND slot='[H.client.prefs.default_slot]'")
if(!query.Execute())
var/err = query.ErrorMsg()
log_game("SQL ERROR retrieving bank account information. Error : \[[err]\]\n")
message_admins("SQL ERROR retrieving bank account information. Error : \[[err]\]\n")
return
/proc/create_account(var/new_owner_name = "Default user", var/starting_funds = 0, var/obj/machinery/account_database/source_db)
//create a new account
var/datum/money_account/M = new()
M.owner_name = new_owner_name
M.remote_access_pin = rand(1111, 111111)
M.money = starting_funds
//general preferences
while(query.NextRow())
//create a new account
var/datum/money_account/M = new()
M.owner_name = H.real_name
if(text2num(query.item[1]) == 0)
M.remote_access_pin = rand(1111, 111111)
M.money = 1000
M.account_number = rand(111111, 999999)
var/DBQuery/query2 = dbcon.NewQuery("UPDATE characters SET account_number='[M.account_number]',account_pin='[M.remote_access_pin]', account_balance='[M.money]' WHERE ckey='[sql_sanitize_text(H.ckey)]' AND slot='[H.client.prefs.default_slot]'")
if(!query2.Execute())
var/err = query2.ErrorMsg()
log_game("SQL ERROR creating bank account. Error : \[[err]\]\n")
message_admins("SQL ERROR creating bank account. Error : \[[err]\]\n")
return
//create an entry in the account transaction log for when it was created
var/datum/transaction/T = new()
T.target_name = new_owner_name
T.purpose = "Account creation"
T.amount = starting_funds
if(!source_db)
//set a random date, time and location some time over the past few decades
T.date = "[num2text(rand(1,31))] [pick("January","February","March","April","May","June","July","August","September","October","November","December")], 25[rand(10,56)]"
T.time = "[rand(0,24)]:[rand(11,59)]"
T.source_terminal = "NTGalaxyNet Terminal #[rand(111,1111)]"
else
M.remote_access_pin = text2num(query.item[2])
M.money = text2num(query.item[3])
M.account_number = text2num(query.item[1])
M.account_number = rand(111111, 999999)
else
T.date = current_date_string
T.time = worldtime2text()
T.source_terminal = source_db.machine_id
all_money_accounts.Add(M)
return M
M.account_number = next_account_number
next_account_number += rand(1,25)
//create a sealed package containing the account details
var/obj/item/smallDelivery/P = new /obj/item/smallDelivery(source_db.loc)
var/obj/item/weapon/paper/R = new /obj/item/weapon/paper(P)
P.wrapped = R
R.name = "Account information: [M.owner_name]"
// AUTOFIXED BY fix_string_idiocy.py
// C:\Users\Rob\Documents\Projects\vgstation13\code\WorkInProgress\Cael_Aislinn\Economy\Accounts.dm:94: R.info = "<b>Account details (confidential)</b><br><hr><br>"
R.info = {"<b>Account details (confidential)</b><br><hr><br>
<i>Account holder:</i> [M.owner_name]<br>
<i>Account number:</i> [M.account_number]<br>
<i>Account pin:</i> [M.remote_access_pin]<br>
<i>Starting balance:</i> $[M.money]<br>
<i>Date and time:</i> [worldtime2text()], [current_date_string]<br><br>
<i>Creation terminal ID:</i> [source_db.machine_id]<br>
<i>Authorised NT officer overseeing creation:</i> [source_db.held_card.registered_name]<br>"}
// END AUTOFIX
//stamp the paper
var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
stampoverlay.icon_state = "paper_stamp-cent"
if(!R.stamped)
R.stamped = new
R.stamped += /obj/item/weapon/stamp
R.overlays += stampoverlay
R.stamps += "<HR><i>This paper has been stamped by the Accounts Database.</i>"
//add the account
M.transaction_log.Add(T)
all_money_accounts.Add(M)
return M
/datum/money_account
var/owner_name = ""
@@ -114,7 +140,225 @@ var/global/list/all_money_accounts = list()
var/date = ""
var/time = ""
var/source_terminal = ""
/*
/obj/machinery/account_database
name = "Accounts database"
desc = "Holds transaction logs, account data and all kinds of other financial records."
icon = 'icons/obj/virology.dmi'
icon_state = "analyser"
density = 1
req_one_access = list(access_hop, access_captain)
var/receipt_num
var/machine_id = ""
var/obj/item/weapon/card/id/held_card
var/access_level = 0
var/datum/money_account/detailed_account_view
var/creating_new_account = 0
var/activated = 1
/obj/machinery/account_database/New()
..()
if(!station_account)
create_station_account()
if(department_accounts.len == 0)
for(var/department in station_departments)
create_department_account(department)
if(!vendor_account)
create_department_account("Vendor")
vendor_account = department_accounts["Vendor"]
if(!current_date_string)
current_date_string = "[num2text(rand(1,31))] [pick("January","February","March","April","May","June","July","August","September","October","November","December")], 2557"
machine_id = "[station_name()] Acc. DB #[num_financial_terminals++]"
/obj/machinery/account_database/attack_hand(mob/user as mob)
if(ishuman(user) && !user.stat && get_dist(src,user) <= 1)
var/dat = "<b>Accounts Database</b><br>"
// AUTOFIXED BY fix_string_idiocy.py
// C:\Users\Rob\Documents\Projects\vgstation13\code\WorkInProgress\Cael_Aislinn\Economy\Accounts.dm:171: dat += "<i>[machine_id]</i><br>"
dat += {"<i>[machine_id]</i><br>
Confirm identity: <a href='?src=\ref[src];choice=insert_card'>[held_card ? held_card : "-----"]</a><br>"}
// END AUTOFIX
if(access_level > 0)
// AUTOFIXED BY fix_string_idiocy.py
// C:\Users\Rob\Documents\Projects\vgstation13\code\WorkInProgress\Cael_Aislinn\Economy\Accounts.dm:175: dat += "<a href='?src=\ref[src];toggle_activated=1'>[activated ? "Disable" : "Enable"] remote access</a><br>"
dat += {"<a href='?src=\ref[src];toggle_activated=1'>[activated ? "Disable" : "Enable"] remote access</a><br>
You may not edit accounts at this terminal, only create and view them.<br>"}
// END AUTOFIX
if(creating_new_account)
// AUTOFIXED BY fix_string_idiocy.py
// C:\Users\Rob\Documents\Projects\vgstation13\code\WorkInProgress\Cael_Aislinn\Economy\Accounts.dm:178: dat += "<br>"
dat += {"<br>
<a href='?src=\ref[src];choice=view_accounts_list;'>Return to accounts list</a>
<form name='create_account' action='?src=\ref[src]' method='get'>
<input type='hidden' name='src' value='\ref[src]'>
<input type='hidden' name='choice' value='finalise_create_account'>
<b>Holder name:</b> <input type='text' id='holder_name' name='holder_name' style='width:250px; background-color:white;'><br>
<b>Initial funds:</b> <input type='text' id='starting_funds' name='starting_funds' style='width:250px; background-color:white;'> (subtracted from station account)<br>
<i>New accounts are automatically assigned a secret number and pin, which are printed separately in a sealed package.</i><br>
<input type='submit' value='Create'><br>
</form>"}
// END AUTOFIX
else
if(detailed_account_view)
// AUTOFIXED BY fix_string_idiocy.py
// C:\Users\Rob\Documents\Projects\vgstation13\code\WorkInProgress\Cael_Aislinn\Economy\Accounts.dm:190: dat += "<br>"
dat += {"<br>
<a href='?src=\ref[src];choice=view_accounts_list;'>Return to accounts list</a><hr>
<b>Account number:</b> #[detailed_account_view.account_number]<br>
<b>Account holder:</b> [detailed_account_view.owner_name]<br>
<b>Account balance:</b> $[detailed_account_view.money]<br>
<table border=1 style='width:100%'>
<tr>
<td><b>Date</b></td>
<td><b>Time</b></td>
<td><b>Target</b></td>
<td><b>Purpose</b></td>
<td><b>Value</b></td>
<td><b>Source terminal ID</b></td>
</tr>"}
// END AUTOFIX
for(var/datum/transaction/T in detailed_account_view.transaction_log)
// AUTOFIXED BY fix_string_idiocy.py
// C:\Users\Rob\Documents\Projects\vgstation13\code\WorkInProgress\Cael_Aislinn\Economy\Accounts.dm:205: dat += "<tr>"
dat += {"<tr>
<td>[T.date]</td>
<td>[T.time]</td>
<td>[T.target_name]</td>
<td>[T.purpose]</td>
<td>$[T.amount]</td>
<td>[T.source_terminal]</td>
</tr>"}
// END AUTOFIX
dat += "</table>"
else
// AUTOFIXED BY fix_string_idiocy.py
// C:\Users\Rob\Documents\Projects\vgstation13\code\WorkInProgress\Cael_Aislinn\Economy\Accounts.dm:215: dat += "<a href='?src=\ref[src];choice=create_account;'>Create new account</a><br><br>"
dat += {"<a href='?src=\ref[src];choice=create_account;'>Create new account</a><br><br>
<table border=1 style='width:100%'>"}
// END AUTOFIX
for(var/i=1, i<=all_money_accounts.len, i++)
var/datum/money_account/D = all_money_accounts[i]
// AUTOFIXED BY fix_string_idiocy.py
// C:\Users\Rob\Documents\Projects\vgstation13\code\WorkInProgress\Cael_Aislinn\Economy\Accounts.dm:219: dat += "<tr>"
dat += {"<tr>
<td>#[D.account_number]</td>
<td>[D.owner_name]</td>
<td><a href='?src=\ref[src];choice=view_account_detail;account_index=[i]'>View in detail</a></td>
</tr>"}
// END AUTOFIX
dat += "</table>"
user << browse(dat,"window=account_db;size=700x650")
else
user << browse(null,"window=account_db")
/obj/machinery/account_database/attackby(O as obj, user as mob)//TODO:SANITY
if(istype(O, /obj/item/weapon/card))
var/obj/item/weapon/card/id/idcard = O
if(!held_card)
usr.drop_item()
idcard.loc = src
held_card = idcard
if(access_cent_captain in idcard.access)
access_level = 2
else if(access_hop in idcard.access || access_captain in idcard.access)
access_level = 1
else
..()
/obj/machinery/account_database/Topic(var/href, var/href_list)
..()
if(href_list["toggle_activated"])
activated = !activated
if(href_list["choice"])
switch(href_list["choice"])
if("create_account")
creating_new_account = 1
if("finalise_create_account")
var/account_name = href_list["holder_name"]
var/starting_funds = max(text2num(href_list["starting_funds"]), 0)
create_account(account_name, starting_funds, src)
if(starting_funds > 0)
//subtract the money
station_account.money -= starting_funds
//create a transaction log entry
var/datum/transaction/T = new()
T.target_name = account_name
T.purpose = "New account funds initialisation"
T.amount = "([starting_funds])"
T.date = current_date_string
T.time = worldtime2text()
T.source_terminal = machine_id
station_account.transaction_log.Add(T)
creating_new_account = 0
if("insert_card")
if(held_card)
held_card.loc = src.loc
if(ishuman(usr) && !usr.get_active_hand())
usr.put_in_hands(held_card)
held_card = null
access_level = 0
else
var/obj/item/I = usr.get_active_hand()
if (istype(I, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = I
usr.drop_item()
C.loc = src
held_card = C
if(access_cent_captain in C.access)
access_level = 2
else if(access_hop in C.access || access_captain in C.access)
access_level = 1
if("view_account_detail")
var/index = text2num(href_list["account_index"])
if(index && index <= all_money_accounts.len)
detailed_account_view = all_money_accounts[index]
if("view_accounts_list")
detailed_account_view = null
creating_new_account = 0
src.attack_hand(usr)
*/
/obj/machinery/account_database/proc/charge_to_account(var/attempt_account_number, var/source_name, var/purpose, var/terminal_id, var/amount)
if(!activated)
return 0
for(var/datum/money_account/D in all_money_accounts)
if(D.account_number == attempt_account_number && !D.suspended)
D.money += amount
//create a transaction log entry
var/datum/transaction/T = new()
T.target_name = source_name
T.purpose = purpose
if(amount < 0)
T.amount = "([amount])"
else
T.amount = "[amount]"
T.date = current_date_string
T.time = worldtime2text()
T.source_terminal = terminal_id
D.transaction_log.Add(T)
return 1
return 0
//this returns the first account datum that matches the supplied accnum/pin combination, it returns null if the combination did not match any account
/proc/attempt_account_access(var/attempt_account_number, var/attempt_pin_number, var/security_level_passed = 0,var/pin_needed=1)
+11 -37
View File
@@ -10,7 +10,7 @@
var/machine_id = ""
var/obj/item/weapon/card/id/held_card
var/datum/money_account/detailed_account_view
// var/creating_new_account = 0
var/creating_new_account = 0
var/activated = 1
proc/get_access_level()
@@ -39,32 +39,8 @@
<u>Generated By:</u> [held_card.registered_name], [held_card.assignment]<br>
"}
/obj/machinery/account_database/proc/charge_to_account(var/attempt_account_number, var/source_name, var/purpose, var/terminal_id, var/amount)
if(!activated)
return 0
for(var/datum/money_account/D in all_money_accounts)
if(D.account_number == attempt_account_number && !D.suspended)
D.money += amount
//create a transaction log entry
var/datum/transaction/T = new()
T.target_name = source_name
T.purpose = purpose
if(amount < 0)
T.amount = "([amount])"
else
T.amount = "[amount]"
T.date = current_date_string
T.time = worldtime2text()
T.source_terminal = terminal_id
D.transaction_log.Add(T)
return 1
return 0
/obj/machinery/account_database/New()
/* if(!station_account)
if(!station_account)
create_station_account()
if(department_accounts.len == 0)
@@ -72,7 +48,7 @@
create_department_account(department)
if(!vendor_account)
create_department_account("Vendor")
vendor_account = department_accounts["Vendor"]*/
vendor_account = department_accounts["Vendor"]
if(!current_date_string)
current_date_string = "[num2text(rand(1,31))] [pick("January","February","March","April","May","June","July","August","September","October","November","December")], 2557"
@@ -106,9 +82,9 @@
data["id_card"] = held_card ? text("[held_card.registered_name], [held_card.assignment]") : "-----"
data["access_level"] = get_access_level()
data["machine_id"] = machine_id
// data["creating_new_account"] = creating_new_account
data["creating_new_account"] = creating_new_account
data["detailed_account_view"] = !!detailed_account_view
// data["station_account_number"] = station_account.account_number
data["station_account_number"] = station_account.account_number
data["transactions"] = null
data["accounts"] = null
@@ -153,11 +129,10 @@
if(..())
return 1
// var/datum/nanoui/ui = nanomanager.get_open_ui(usr, src, "main")
var/datum/nanoui/ui = nanomanager.get_open_ui(usr, src, "main")
if(href_list["choice"])
switch(href_list["choice"])
/*
if("create_account")
creating_new_account = 1
@@ -170,16 +145,16 @@
var/amount = input("Enter the amount you wish to remove", "Silently remove funds") as num
if(detailed_account_view)
detailed_account_view.money -= amount
*/
if("toggle_suspension")
if(detailed_account_view)
detailed_account_view.suspended = !detailed_account_view.suspended
callHook("change_account_status", list(detailed_account_view))
/*
if("finalise_create_account")
var/account_name = href_list["holder_name"]
var/starting_funds = max(text2num(href_list["starting_funds"]), 0)
create_account(account_name, starting_funds, src) // CHANGE account_name for human mob with new econ code
create_account(account_name, starting_funds, src)
if(starting_funds > 0)
//subtract the money
station_account.money -= starting_funds
@@ -192,7 +167,6 @@
ui.close()
creating_new_account = 0
*/
if("insert_card")
if(held_card)
held_card.loc = src.loc
@@ -216,7 +190,7 @@
if("view_accounts_list")
detailed_account_view = null
/* creating_new_account = 0
creating_new_account = 0
if("revoke_payroll")
var/funds = detailed_account_view.money
@@ -230,7 +204,7 @@
station_account.transaction_log.Add(station_trx)
callHook("revoke_payroll", list(detailed_account_view))
*/
if("print")
var/text
var/obj/item/weapon/paper/P = new(loc)
+3 -11
View File
@@ -38,8 +38,8 @@
if(D.remote_access_pin != attempt_pin)
return null
return D
// else if(issilicon(src))
// return station_account
else if(issilicon(src))
return station_account
/datum/money_account/proc/fmtBalance()
return "$[num2septext(money)]"
@@ -48,7 +48,6 @@
if(transaction_amount <= money)
//transfer the money
money -= transaction_amount
update_balance(account_number,money)
if(dest)
dest.money += transaction_amount
@@ -84,11 +83,4 @@
return 1
else
usr << "\icon[src]<span class='warning'>You don't have that much money!</span>"
return 0
/datum/money_account/proc/update_balance(var/account_number,var/newbalance)
var/DBQuery/query = dbcon.NewQuery("UPDATE characters SET account_balance='[newbalance]' WHERE account_number='[account_number]'")
if(!query.Execute())
var/err = query.ErrorMsg()
log_game("SQL ERROR charging bank account. Error : \[[err]\]\n")
message_admins("SQL ERROR charging bank account. Error : \[[err]\]\n")
return 0
@@ -59,7 +59,7 @@
req_tech = list("programming" = 3, "biotech" = 2, "materials" = 4)
build_type = IMPRINTER
materials = list("$glass" = 1000, "sacid" = 20, "$gold" = 100)
build_path = /obj/item/weapon/aiModule/supplied/quarantine
build_path = /obj/item/weapon/aiModule/zeroth/quarantine
category = list("AI Modules")
/datum/design/reset_module