Tg port 2 15 (#230)
* defines/helpers * globalvars, onclick, controllers * datums and game * woooooooooorld. Uh. dm * modules sans mobs client admin * modules/admin * pref shit * modules/mob * icon updates * extra things * Cherrypicked fixes from open PRs * metastation.tgm fix * a better meta fix * reverts async breakings
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
//print a warning message to world.log
|
||||
#define WARNING(MSG) warning("[MSG] in [__FILE__] at line [__LINE__] src: [src] usr: [usr].")
|
||||
/proc/warning(msg)
|
||||
world.log << "## WARNING: [msg]"
|
||||
msg = "## WARNING: [msg]"
|
||||
log_world(msg)
|
||||
|
||||
//not an error or a warning, but worth to mention on the world log, just in case.
|
||||
#define NOTICE(MSG) notice(MSG)
|
||||
/proc/notice(msg)
|
||||
world.log << "## NOTICE: [msg]"
|
||||
msg = "## NOTICE: [msg]"
|
||||
log_world(msg)
|
||||
|
||||
//print a testing-mode debug message to world.log and world
|
||||
#ifdef TESTING
|
||||
#define testing(msg) world.log << "## TESTING: [msg]"; world << "## TESTING: [msg]"
|
||||
#define testing(msg) log_world("## TESTING: [msg]"); world << "## TESTING: [msg]"
|
||||
#else
|
||||
#define testing(msg)
|
||||
#endif
|
||||
@@ -79,4 +81,31 @@
|
||||
|
||||
/proc/log_chat(text)
|
||||
if (config.log_pda)
|
||||
diary << "\[[time_stamp()]]CHAT: [text]"
|
||||
diary << "\[[time_stamp()]]CHAT: [text]"
|
||||
|
||||
//This replaces world.log so it displays both in DD and the file
|
||||
/proc/log_world(text)
|
||||
if(config && config.log_runtimes)
|
||||
world.log = runtime_diary
|
||||
world.log << text
|
||||
world.log = null
|
||||
world.log << text
|
||||
|
||||
// Helper procs for building detailed log lines
|
||||
|
||||
/proc/datum_info_line(datum/D)
|
||||
if(!istype(D))
|
||||
return
|
||||
if(!istype(D, /mob))
|
||||
return "[D] ([D.type])"
|
||||
var/mob/M = D
|
||||
return "[M] ([M.ckey]) ([M.type])"
|
||||
|
||||
/proc/atom_loc_line(atom/A)
|
||||
if(!istype(A))
|
||||
return
|
||||
var/turf/T = get_turf(A)
|
||||
if(istype(T))
|
||||
return "[A.loc] [COORD(T)] ([A.loc.type])"
|
||||
else if(A.loc)
|
||||
return "[A.loc] (0, 0, 0) ([A.loc.type])"
|
||||
@@ -5,7 +5,7 @@
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT DATEDIFF(Now(),'[y]-[m]-[d]')")
|
||||
|
||||
if(!query.Execute())
|
||||
world.log << "SQL ERROR doing datediff. Error : \[[query.ErrorMsg()]\]\n"
|
||||
log_world("SQL ERROR doing datediff. Error : \[[query.ErrorMsg()]\]\n")
|
||||
return FALSE
|
||||
|
||||
if(query.NextRow())
|
||||
@@ -24,7 +24,7 @@
|
||||
/client/proc/findJoinDate()
|
||||
var/http[] = world.Export("http://byond.com/members/[src.ckey]?format=text")
|
||||
if(!http)
|
||||
world.log << "Failed to connect to byond age check for [src.ckey]"
|
||||
log_world("Failed to connect to byond age check for [src.ckey]")
|
||||
return FALSE
|
||||
|
||||
var/F = file2text(http["CONTENT"])
|
||||
|
||||
+12
-6
@@ -420,10 +420,12 @@
|
||||
|
||||
return new /datum/projectile_data(src_x, src_y, time, distance, power_x, power_y, dest_x, dest_y)
|
||||
|
||||
/proc/showCandidatePollWindow(mob/dead/observer/G, poll_time, Question, list/candidates, ignore_category, time_passed)
|
||||
/proc/showCandidatePollWindow(mob/dead/observer/G, poll_time, Question, list/candidates, ignore_category, time_passed, flashwindow = TRUE)
|
||||
set waitfor = 0
|
||||
|
||||
G << 'sound/misc/notice2.ogg' //Alerting them to their consideration
|
||||
if(flashwindow)
|
||||
window_flash(G.client)
|
||||
switch(ignore_category ? askuser(G,Question,"Please answer in [poll_time/10] seconds!","Yes","No","Never for this round", StealFocus=0, Timeout=poll_time) : askuser(G,Question,"Please answer in [poll_time/10] seconds!","Yes","No", StealFocus=0, Timeout=poll_time))
|
||||
if(1)
|
||||
G << "<span class='notice'>Choice registered: Yes.</span>"
|
||||
@@ -441,7 +443,7 @@
|
||||
poll_ignore[ignore_category] += G.ckey
|
||||
G << "<span class='danger'>Choice registered: Never for this round.</span>"
|
||||
|
||||
/proc/pollCandidates(var/Question, var/jobbanType, var/datum/game_mode/gametypeCheck, var/be_special_flag = 0, var/poll_time = 300, var/ignore_category = null)
|
||||
/proc/pollCandidates(var/Question, var/jobbanType, var/datum/game_mode/gametypeCheck, var/be_special_flag = 0, var/poll_time = 300, var/ignore_category = null, flashwindow = TRUE)
|
||||
var/list/mob/dead/observer/candidates = list()
|
||||
var/time_passed = world.time
|
||||
if (!Question)
|
||||
@@ -460,7 +462,7 @@
|
||||
if(jobban_isbanned(G, jobbanType) || jobban_isbanned(G, "Syndicate"))
|
||||
continue
|
||||
|
||||
showCandidatePollWindow(G, poll_time, Question, candidates, ignore_category, time_passed)
|
||||
showCandidatePollWindow(G, poll_time, Question, candidates, ignore_category, time_passed, flashwindow)
|
||||
sleep(poll_time)
|
||||
|
||||
//Check all our candidates, to make sure they didn't log off during the wait period.
|
||||
@@ -507,7 +509,11 @@
|
||||
if(M && !isnewplayer(M))
|
||||
M << thing
|
||||
|
||||
/proc/window_flash(var/client_or_usr)
|
||||
if (!client_or_usr)
|
||||
/proc/window_flash(client/C, ignorepref = FALSE)
|
||||
if(ismob(C))
|
||||
var/mob/M = C
|
||||
if(M.client)
|
||||
C = M.client
|
||||
if(!C || (!C.prefs.windowflashing && !ignorepref))
|
||||
return
|
||||
winset(client_or_usr, "mainwindow", "flash=5")
|
||||
winset(C, "mainwindow", "flash=5")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//Returns the world time in english
|
||||
/proc/worldtime2text()
|
||||
return gameTimestamp("hh:mm")
|
||||
return gameTimestamp("hh:mm:ss")
|
||||
|
||||
/proc/time_stamp(format = "hh:mm:ss")
|
||||
return time2text(world.timeofday, format)
|
||||
|
||||
Reference in New Issue
Block a user