Merge branch 'development' of https://github.com/Aurorastation/Aurora into master_languages

Conflicts:
	code/controllers/verbs.dm
	html/changelog.html

Signed-off-by: Jamini <mobiousjami@gmail.com>
This commit is contained in:
Jamini
2015-03-29 11:04:35 -04:00
19 changed files with 470 additions and 14 deletions
+10 -2
View File
@@ -131,6 +131,7 @@ var/list/forbidden_varedit_object_types = list(
if(!istype(L,/list)) src << "Not a List."
var/list/locked = list("vars", "key", "ckey", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "viruses", "cuffed", "ka", "last_eaten", "urine", "poo", "icon", "icon_state")
var/list/forbidden = list("holder") //Why this way, fuck knows.
var/list/names = sortList(L)
var/variable = input("Which var?","Var") as null|anything in names + "(ADD VAR)"
@@ -149,6 +150,9 @@ var/list/forbidden_varedit_object_types = list(
if(variable in locked)
if(!check_rights(R_DEBUG|R_DEV|R_FUN)) return
if(variable in forbidden)
if(!check_rights(R_SERVER)) return
if(isnull(variable))
usr << "Unable to determine variable type."
@@ -290,8 +294,10 @@ var/list/forbidden_varedit_object_types = list(
src << "A variable with this name ([param_var_name]) doesn't exist in this atom ([O])"
return
if(param_var_name == "holder" || (param_var_name in locked))
if(param_var_name in locked)
if(!check_rights(R_DEBUG|R_DEV|R_FUN)) return
if(param_var_name == "holder")
if(!check_rights(R_SERVER)) return
variable = param_var_name
@@ -348,8 +354,10 @@ var/list/forbidden_varedit_object_types = list(
if(!variable) return
var_value = O.vars[variable]
if(variable == "holder" || (variable in locked))
if(param_var_name in locked)
if(!check_rights(R_DEBUG|R_DEV|R_FUN)) return
if(param_var_name == "holder")
if(!check_rights(R_SERVER)) return
if(!autodetect_class)
+8
View File
@@ -124,6 +124,14 @@
M.equip_if_possible(new /obj/item/weapon/melee/telebaton(M), slot_l_store)
M.equip_if_possible(new /obj/item/device/taperecorder(M), slot_r_store)
var /obj/item/weapon/storage/lockbox/lockbox = new(M)
lockbox.req_access = list(access_cent_captain)
lockbox.name = "A Duty Officer briefcase"
lockbox.desc = "A smart looking briefcase with a NT logo on the side"
lockbox.storage_slots = 8
lockbox.max_combined_w_class = 16
M.equip_if_possible(lockbox, slot_l_hand)
var/obj/item/device/pda/central/pda = new(M)
pda.owner = M.real_name
pda.ownjob = "Central Command Duty Officer"
+96
View File
@@ -0,0 +1,96 @@
/*
*
*For housing code that's related to bringing news over at preset times from an SQL database into the game and publish them
*
*The basic premise is:
*This gets created in the master controller.
*It then starts checking and crawling down an organized SQL list.
*Releases news articles one after another, based on when they're meant to be released.
*It's recursive and kills itself once it runs to the end of it's list.
*
*TO DO:
*Make it create a new feed channel if specified.
*
*/
var/global/datum/sqlnews/sqlnews_controller
datum/sqlnews
var/count = 0 //arbitrary count variable, increased every time an article is pulled, for sorting SQL data.
var/time //publishtime, time in gametime
var/id //id, primary-key, of the news article that's destined for pulling.
var/running = 1 //whenever no results are found, this ticks over to a 0, and thus, no more updates.
datum/sqlnews/proc/process()
if(!running == 1) //No more news, immediate kill and return.
return
if(!id && !time) //No entry loaded, update and load one.
update()
return
else if(time < world.time) //Running late! Time to publish the stored article!
publish()
return
datum/sqlnews/proc/update() //Updates the stored variables and preppes it for a new run of publish()
establish_db_connection()
if(!dbcon.IsConnected())
error("SQL database connection failed. Attempted to fetch news information.")
return
var/DBQuery/query = dbcon.NewQuery("SELECT id, publishtime FROM aurora_news WHERE isnull(notpublishing) ORDER BY publishtime ASC LIMIT [count],1")
query.Execute()
if(!query.RowCount())
running = 0
return
while(query.NextRow())
id = query.item[1]
time = text2num(query.item[2]) * 600
count++
datum/sqlnews/proc/publish() //Uses data stored from the update() proc and: pulls further information required to publish an article, publishes it.
if(!id)
return
establish_db_connection()
if(!dbcon.IsConnected())
error("SQL database connection failed. Attempted to fetch news information.")
return
var/DBQuery/fetchquery = dbcon.NewQuery("SELECT channel, author, body FROM aurora_news WHERE id=[id]")
fetchquery.Execute()
while(fetchquery.NextRow())
var/channel = fetchquery.item[1]
var/author = fetchquery.item[2]
var/body = fetchquery.item[3]
var/datum/feed_message/newMsg = new /datum/feed_message
newMsg.author = author
newMsg.body = body
var/found //Do we need a new channel or not?
for(var/datum/feed_channel/FC in news_network.network_channels)
if(FC.channel_name == channel)
FC.messages += newMsg
found = 1
if(!found)
var/datum/feed_channel/NC = new /datum/feed_channel
NC.channel_name = channel
NC.author = author
NC.locked = 1
NC.is_admin_channel = 1
news_network.network_channels += NC
NC.messages += newMsg
for(var/obj/machinery/newscaster/NEWSCASTER in allCasters)
NEWSCASTER.newsAlert("[channel]")
id = null
time = null
+62
View File
@@ -0,0 +1,62 @@
/*
*
*For housing procs and things related to the viewing of Station Directives.
*Later iterations may get bound through other DMs
*
*/
/*
*Proc for fetching and displaying the Station Directives
*/
/client/proc/directiveslookup(var/screen = 1, var/queryid="")
var/dat = "<div align='center'><b>Station Directives<br>NanoTrasen<br>NSS Aurora</b></div><br>"
dat += "<div align='center'><b>OOC Information:</b><br>These directives mock the Standard Operating Procedure which would otherwise be in place aboard the station. They are not enforced out of character wise, however, you may find your character penalized in-game for not following them.</div><br>"
establish_db_connection()
if(!dbcon.IsConnected())
dat += text("<div align='center'><font color=red><b>ERROR</b>: Unable to contact external database.</div></font>")
error("SQL database connection failed. Attempted to fetch form information.")
switch(screen)
if(1)
var/DBQuery/query = dbcon.NewQuery("SELECT id, name FROM aurora_directives")
query.Execute()
dat += "<div align='center'><table width='90%' cellpadding='2' cellspacing='0'>"
dat += "<tr><td colspan='3' bgcolor='white' align='center'><a href='?src=\ref[src];directivescreen=3'>Regarding Station Directives</a><br></td></tr>"
while(query.NextRow())
var/id = text2num(query.item[1])
var/name = query.item[2]
var/bgcolor = "#e3e3e3"
if(id%2 == 0)
bgcolor = "white"
dat += "<tr bgcolor='[bgcolor]'><td>Directive #[id]</td><td>[name]</td><td><a href='?src=\ref[src];directiveview=[id]'>Review</a></td></tr>"
dat += "</table></div>"
if(2)
if(!queryid)
return //this should never happen
var/DBQuery/searchquery = dbcon.NewQuery("SELECT id, name, data FROM aurora_directives WHERE id=[queryid]")
searchquery.Execute()
while(searchquery.NextRow())
var/id = searchquery.item[1]
var/name = searchquery.item[2]
var/data = searchquery.item[3]
dat += "<div align='center'><b>Directive #[id]<br>'[name]'</b></div><hr>"
dat += "<div align='justify'>[data]</div>"
dat += "<div align='center'><a href='?src=\ref[src];directivescreen=1'>Return to Index</a></div>"
if(3)
dat += "<div align='center'><b>Regarding Station Directives</b></div><hr>"
dat += "<div align='justify'>The Station Directives are a set of specific orders and directives issued and enforced aboard a specific NanoTrasen Corporation installation. This terminal provides access to orders and directives enforced aboard the <i>NSS Aurora.</i> Note that these are only enforced upon NanoTrasen Employees, and not civilians or visitors, unless ruled otherwise by sector specific Central Command.<br><br>"
dat += "Overwriting power of general NanoTrasen Corporate Regulation is given to the Station Directives. Should a conflict emerge, the Station Directives active aboard the specific installation are to be adhered to, over Corporate Regulation.<br><br>"
dat += "Punishment for a violation of Station Directives should be escalated in the following fashion:<br><ul><li>Verbal warning, and citation. Ensure that the Employee is familiar with the Station Directives.</li><li>Charge of violating article i111 - Failure to Execute an Order - of NanoTrasen Corporate Regulation</li><li>Subsequent charge of violating article i206 - Neglect of Duty - of NanoTrasen Corporate Regulation, and review of Employee by the Employee's Head of Staff.</li><li>Subsequent failure to follow Station Directives should result in suspension of contract, if not imprisonment until transfer to Central Command station.</li></ul>"
dat += "Dependant on the violation and actual crimes concerned, punishment may be escalated faster, with intent to ensure in the safety of station, equipment and crew.<br>"
dat += "During non-standard operation, and highly abnormal circumstances, Station Directives may be overlooked, for the sake of a less costly solution to the given emergency. Note that should a follow-on review find this solution to have been more detrimental, and the breach of Directives and Regulation be unwarranted, then such an act will be punished.</div>"
dat += "<br><div align='center'><a href='?src=\ref[src];directivescreen=1'>Return to Index</a></div>"
usr << browse("[dat]", "window=station_directives;size=400x400")
+13
View File
@@ -66,6 +66,19 @@
if("prefs") return prefs.process_link(usr,href_list)
if("vars") return view_var_Topic(href,href_list,hsrc)
//Station Directives screen switch
switch(text2num(href_list["directivescreen"]))
if(null)
if(1)
directiveslookup(1)
if(3)
directiveslookup(3)
//2 should not be reachable through here.
if(href_list["directiveview"])
var/queryid = sanitizeSQL(href_list["directiveview"])
directiveslookup(2, queryid)
..() //redirect to hsrc.Topic()
/client/proc/handle_spam_prevention(var/message, var/mute_type)
+9 -1
View File
@@ -38,10 +38,15 @@
output += "<p><a href='byond://?src=\ref[src];observe=1'>Observe</A></p>"
//Station Directives
if(config.invasive_directives)
output += "<p><a href='byond://?src=\ref[src];showdirectives=1'>Station Directives</a></p>"
if(!IsGuestKey(src.key))
establish_db_connection()
if(dbcon.IsConnected())
var/isadmin = 0
if(src.client && src.client.holder)
isadmin = 1
@@ -59,7 +64,7 @@
output += "</div>"
src << browse(output,"window=playersetup;size=210x240;can_close=0")
src << browse(output,"window=playersetup;size=210x260;can_close=0")
return
Stat()
@@ -275,6 +280,9 @@
if(!isnull(href_list["option_[optionid]"])) //Test if this optionid was selected
vote_on_poll(pollid, optionid, 1)
if(href_list["showdirectives"])
client.directiveslookup()
proc/IsJobAvailable(rank)
var/datum/job/job = job_master.GetJob(rank)
if(!job) return 0