Makes goonchat robust.

This commit is contained in:
CitadelStationBot
2017-06-26 00:03:57 -05:00
parent 4293607509
commit 0178323fe1
2 changed files with 101 additions and 12 deletions
+18 -12
View File
@@ -90,8 +90,7 @@ GLOBAL_DATUM_INIT(iconCache, /savefile, new("data/iconCache.sav")) //Cache of ic
testing("Chat loaded for [owner.ckey]")
loaded = TRUE
winset(owner, "output", "is-disabled=true;is-visible=false")
winset(owner, "browseroutput", "is-disabled=false;is-visible=true")
showChat()
for(var/message in messageQueue)
@@ -99,9 +98,16 @@ GLOBAL_DATUM_INIT(iconCache, /savefile, new("data/iconCache.sav")) //Cache of ic
messageQueue = null
sendClientData()
//do not convert to to_chat()
owner << {"<span class="userdanger">If you can see this, update byond.</span>"}
pingLoop()
/datum/chatOutput/proc/showChat()
winset(owner, "output", "is-visible=false")
winset(owner, "browseroutput", "is-disabled=false;is-visible=true")
/datum/chatOutput/proc/pingLoop()
set waitfor = FALSE
@@ -237,24 +243,24 @@ GLOBAL_DATUM_INIT(iconCache, /savefile, new("data/iconCache.sav")) //Cache of ic
message = replacetext(message, "\proper", "")
message = replacetext(message, "\n", "<br>")
message = replacetext(message, "\t", "[GLOB.TAB][GLOB.TAB]")
for(var/I in targets)
//Grab us a client if possible
var/client/C = grab_client(I)
if (!C)
continue
//Send it to the old style output window.
C << original_message
if(!C.chatOutput || C.chatOutput.broken) // A player who hasn't updated his skin file.
C << original_message
return TRUE
continue
if(!C.chatOutput.loaded)
//Client sucks at loading things, put their messages in a queue
//Client still loading, put their messages in a queue
C.chatOutput.messageQueue += message
//But also send it to their output window since that shows until goonchat loads
C << original_message
return
continue
// url_encode it TWICE, this way any UTF-8 characters are able to be decoded by the Javascript.
C << output(url_encode(url_encode(message)), "browseroutput:output")