Skip to content

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
nauticall committed Nov 24, 2024
1 parent ad19318 commit 50e8c4e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
12 changes: 5 additions & 7 deletions code/controllers/subsystems/cargo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ SUBSYSTEM_DEF(cargo)
item_supplier.items = list()
item_supplier.items += I
I.supplier_data = item_supplier
log_subsystem_cargo("Inserted item '[I.name]' into supplier '[I.supplier]'.")

log_subsystem_cargo("Finished loading cargo items.")

Expand Down Expand Up @@ -619,13 +618,10 @@ SUBSYSTEM_DEF(cargo)
//Dumps the cargo orders to the database when the round ends
/datum/controller/subsystem/cargo/proc/dump_orders()
if(dumped_orders)
log_subsystem_cargo("Order Data Dump Aborted - Orders already dumped")
return
if(GLOB.config.cargo_load_items_from != "sql")
log_subsystem_cargo("Order Data Dump Aborted - Cargo not loaded from database")
log_subsystem_cargo("SQL: Orders already dumped. Cargo data dump has been aborted.")
return
if(!establish_db_connection(GLOB.dbcon))
log_subsystem_cargo("SQL ERROR - Failed to connect. - Unable to dump order data")
log_subsystem_cargo("SQL: Unable to connect to SQL database. Cargo data dump has been aborted.")
return

dumped_orders = TRUE
Expand Down Expand Up @@ -665,7 +661,7 @@ SUBSYSTEM_DEF(cargo)
"time_paid"=co.time_paid,
"reason"=co.reason
)))
log_subsystem_cargo("SQL ERROR - Cound not write order to database")
log_subsystem_cargo("SQL: Cound not write order to database. Cargo data dump has been aborted.")
continue

//Run the query to get the inserted id
Expand All @@ -684,6 +680,8 @@ SUBSYSTEM_DEF(cargo)
))
CHECK_TICK

log_subsystem_cargo("SQL: Saved cargo order log to database.")


/hook/roundend/proc/dump_cargoorders()
SScargo.dump_orders()
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@

co.set_submitted(GetNameAndAssignmentFromId(I), usr.character_id, reason)
status_message = "Order submitted successfully. Order ID: [co.order_id] Tracking code: [co.get_tracking_code()]"
//TODO: Print a list with the order data

log_subsystem_cargo("ORDER - '[usr.real_name]' ordered '[jointext(co.items, ", ")]' from cargo for '[co.price]' credits.")
co = null
return TRUE

Expand Down

0 comments on commit 50e8c4e

Please sign in to comment.