April sync (#360)
* Maps and things no code/icons * helpers defines globalvars * Onclick world.dm orphaned_procs * subsystems Round vote and shuttle autocall done here too * datums * Game folder * Admin - chatter modules * clothing - mining * modular computers - zambies * client * mob level 1 * mob stage 2 + simple_animal * silicons n brains * mob stage 3 + Alien/Monkey * human mobs * icons updated * some sounds * emitter y u no commit * update tgstation.dme * compile fixes * travis fixes Also removes Fast digest mode, because reasons. * tweaks for travis Mentors are broke again Also fixes Sizeray guns * oxygen loss fix for vore code. * removes unused code * some code updates * bulk fixes * further fixes * outside things * whoops. * Maint bar ported * GLOBs.
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
dat += "<A href='?src=\ref[src];setauthor=1'>Filter by Author: [author]</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];search=1'>\[Start Search\]</A><BR>"
|
||||
if(1)
|
||||
if (!dbcon.Connect())
|
||||
if (!GLOB.dbcon.Connect())
|
||||
dat += "<font color=red><b>ERROR</b>: Unable to contact External Archive. Please contact your system administrator for assistance.</font><BR>"
|
||||
else if(!SQLquery)
|
||||
dat += "<font color=red><b>ERROR</b>: Malformed search request. Please contact your system administrator for assistance.</font><BR>"
|
||||
@@ -51,7 +51,7 @@
|
||||
dat += "<table>"
|
||||
dat += "<tr><td>AUTHOR</td><td>TITLE</td><td>CATEGORY</td><td>SS<sup>13</sup>BN</td></tr>"
|
||||
|
||||
var/DBQuery/query_library_list_books = dbcon.NewQuery(SQLquery)
|
||||
var/DBQuery/query_library_list_books = GLOB.dbcon.NewQuery(SQLquery)
|
||||
if(!query_library_list_books.Execute())
|
||||
dat += "<font color=red><b>ERROR</b>: Unable to retrieve book listings. Please contact your system administrator for assistance.</font><BR>"
|
||||
while(query_library_list_books.NextRow())
|
||||
@@ -128,16 +128,16 @@
|
||||
var/author
|
||||
var/category
|
||||
|
||||
var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums
|
||||
GLOBAL_LIST(cachedbooks) // List of our cached book datums
|
||||
|
||||
|
||||
/proc/load_library_db_to_cache()
|
||||
if(cachedbooks)
|
||||
if(GLOB.cachedbooks)
|
||||
return
|
||||
if(!dbcon.Connect())
|
||||
if(!GLOB.dbcon.Connect())
|
||||
return
|
||||
cachedbooks = list()
|
||||
var/DBQuery/query_library_cache = dbcon.NewQuery("SELECT id, author, title, category FROM [format_table_name("library")] WHERE isnull(deleted)")
|
||||
GLOB.cachedbooks = list()
|
||||
var/DBQuery/query_library_cache = GLOB.dbcon.NewQuery("SELECT id, author, title, category FROM [format_table_name("library")] WHERE isnull(deleted)")
|
||||
if(!query_library_cache.Execute())
|
||||
return
|
||||
while(query_library_cache.NextRow())
|
||||
@@ -146,7 +146,7 @@ var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums
|
||||
newbook.author = query_library_cache.item[2]
|
||||
newbook.title = query_library_cache.item[3]
|
||||
newbook.category = query_library_cache.item[4]
|
||||
cachedbooks += newbook
|
||||
GLOB.cachedbooks += newbook
|
||||
|
||||
|
||||
|
||||
@@ -181,12 +181,12 @@ var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums
|
||||
if(libcomp_menu)
|
||||
return
|
||||
load_library_db_to_cache()
|
||||
if(!cachedbooks)
|
||||
if(!GLOB.cachedbooks)
|
||||
return
|
||||
libcomp_menu = list("")
|
||||
|
||||
for(var/i in 1 to cachedbooks.len)
|
||||
var/datum/cachedbook/C = cachedbooks[i]
|
||||
for(var/i in 1 to GLOB.cachedbooks.len)
|
||||
var/datum/cachedbook/C = GLOB.cachedbooks[i]
|
||||
var/page = round(i/250)+1
|
||||
if (libcomp_menu.len < page)
|
||||
libcomp_menu.len = page
|
||||
@@ -257,7 +257,7 @@ var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums
|
||||
dat += "<h3>External Archive</h3>"
|
||||
build_library_menu()
|
||||
|
||||
if(!cachedbooks)
|
||||
if(!GLOB.cachedbooks)
|
||||
dat += "<font color=red><b>ERROR</b>: Unable to contact External Archive. Please contact your system administrator for assistance.</font>"
|
||||
else
|
||||
dat += "<A href='?src=\ref[src];orderbyid=1'>(Order book by SS<sup>13</sup>BN)</A><BR><BR>"
|
||||
@@ -411,7 +411,7 @@ var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums
|
||||
if(scanner.cache)
|
||||
var/choice = input("Are you certain you wish to upload this title to the Archive?") in list("Confirm", "Abort")
|
||||
if(choice == "Confirm")
|
||||
if (!dbcon.Connect())
|
||||
if (!GLOB.dbcon.Connect())
|
||||
alert("Connection to Archive has been severed. Aborting.")
|
||||
else
|
||||
|
||||
@@ -419,7 +419,7 @@ var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums
|
||||
var/sqlauthor = sanitizeSQL(scanner.cache.author)
|
||||
var/sqlcontent = sanitizeSQL(scanner.cache.dat)
|
||||
var/sqlcategory = sanitizeSQL(upload_category)
|
||||
var/DBQuery/query_library_upload = dbcon.NewQuery("INSERT INTO [format_table_name("library")] (author, title, content, category, ckey, datetime) VALUES ('[sqlauthor]', '[sqltitle]', '[sqlcontent]', '[sqlcategory]', '[usr.ckey]', Now())")
|
||||
var/DBQuery/query_library_upload = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("library")] (author, title, content, category, ckey, datetime) VALUES ('[sqlauthor]', '[sqltitle]', '[sqlcontent]', '[sqlcategory]', '[usr.ckey]', Now())")
|
||||
if(!query_library_upload.Execute())
|
||||
alert("Database error encountered uploading to Archive")
|
||||
return
|
||||
@@ -427,16 +427,16 @@ var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums
|
||||
log_game("[usr.name]/[usr.key] has uploaded the book titled [scanner.cache.name], [length(scanner.cache.dat)] signs")
|
||||
alert("Upload Complete. Uploaded title will be unavailable for printing for a short period")
|
||||
if(href_list["newspost"])
|
||||
if(!news_network)
|
||||
if(!GLOB.news_network)
|
||||
alert("No news network found on station. Aborting.")
|
||||
var/channelexists = 0
|
||||
for(var/datum/newscaster/feed_channel/FC in news_network.network_channels)
|
||||
for(var/datum/newscaster/feed_channel/FC in GLOB.news_network.network_channels)
|
||||
if(FC.channel_name == "Nanotrasen Book Club")
|
||||
channelexists = 1
|
||||
break
|
||||
if(!channelexists)
|
||||
news_network.CreateFeedChannel("Nanotrasen Book Club", "Library", null)
|
||||
news_network.SubmitArticle(scanner.cache.dat, "[scanner.cache.name]", "Nanotrasen Book Club", null)
|
||||
GLOB.news_network.CreateFeedChannel("Nanotrasen Book Club", "Library", null)
|
||||
GLOB.news_network.SubmitArticle(scanner.cache.dat, "[scanner.cache.name]", "Nanotrasen Book Club", null)
|
||||
alert("Upload complete. Your uploaded title is now available on station newscasters.")
|
||||
if(href_list["orderbyid"])
|
||||
if(cooldown > world.time)
|
||||
@@ -449,13 +449,13 @@ var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums
|
||||
|
||||
if(href_list["targetid"])
|
||||
var/sqlid = sanitizeSQL(href_list["targetid"])
|
||||
if (!dbcon.Connect())
|
||||
if (!GLOB.dbcon.Connect())
|
||||
alert("Connection to Archive has been severed. Aborting.")
|
||||
if(cooldown > world.time)
|
||||
say("Printer unavailable. Please allow a short time before attempting to print.")
|
||||
else
|
||||
cooldown = world.time + PRINTER_COOLDOWN
|
||||
var/DBQuery/query_library_print = dbcon.NewQuery("SELECT * FROM [format_table_name("library")] WHERE id=[sqlid] AND isnull(deleted)")
|
||||
var/DBQuery/query_library_print = GLOB.dbcon.NewQuery("SELECT * FROM [format_table_name("library")] WHERE id=[sqlid] AND isnull(deleted)")
|
||||
if(!query_library_print.Execute())
|
||||
say("PRINTER ERROR! Failed to print document (0x0000000F)")
|
||||
return
|
||||
@@ -474,11 +474,11 @@ var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums
|
||||
if(href_list["printbible"])
|
||||
if(cooldown < world.time)
|
||||
var/obj/item/weapon/storage/book/bible/B = new /obj/item/weapon/storage/book/bible(src.loc)
|
||||
if(SSreligion.Bible_icon_state && SSreligion.Bible_item_state)
|
||||
B.icon_state = SSreligion.Bible_icon_state
|
||||
B.item_state = SSreligion.Bible_item_state
|
||||
B.name = SSreligion.Bible_name
|
||||
B.deity_name = SSreligion.Bible_deity_name
|
||||
if(SSreligion.bible_icon_state && SSreligion.bible_item_state)
|
||||
B.icon_state = SSreligion.bible_icon_state
|
||||
B.item_state = SSreligion.bible_item_state
|
||||
B.name = SSreligion.bible_name
|
||||
B.deity_name = SSreligion.deity
|
||||
cooldown = world.time + PRINTER_COOLDOWN
|
||||
else
|
||||
say("Printer currently unavailable, please wait a moment.")
|
||||
|
||||
Reference in New Issue
Block a user