-Added a new button to NTSL's IDE which will clear the server's memory.

-Changed the broadcast function using a precreated human. The human would still be existing and a new one was created for every use of the broadcast. Garbage collecting it was almost impossible and deleting it everytime a broadcast is made would be laggy so I modified the broadcast code to not need a mob reference.
-Added some checks in the events.


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5477 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
giacomand@gmail.com
2013-01-06 06:55:52 +00:00
parent bc56419710
commit f614122778
6 changed files with 100 additions and 28 deletions

View File

@@ -183,4 +183,29 @@ client/verb/tcsrevert()
src << output("<font color = red>Failed to revert: Unable to locate machine.</font color>", "tcserror")
client/verb/tcsclearmem()
set hidden = 1
if(mob.machine || issilicon(mob))
if((istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && mob.machine in view(1, mob)) || (issilicon(mob) && istype(mob.machine, /obj/machinery/computer/telecomms/traffic) ))
var/obj/machinery/computer/telecomms/traffic/Machine = mob.machine
if(Machine.editingcode != mob)
return
if(Machine.SelectedServer)
var/obj/machinery/telecomms/server/Server = Machine.SelectedServer
Server.memory = list() // clear the memory
// Show results
src << output(null, "tcserror")
src << output("<font color = blue>Server memory cleared!</font color>", "tcserror")
for(var/mob/M in Machine.viewingcode)
if(M.client)
M << output("<font color = blue>Server memory cleared!</font color>", "tcserror")
else
src << output(null, "tcserror")
src << output("<font color = red>Failed to clear memory: Unable to locate server machine.</font color>", "tcserror")
else
src << output(null, "tcserror")
src << output("<font color = red>Failed to clear memory: Unable to locate machine.</font color>", "tcserror")
else
src << output(null, "tcserror")
src << output("<font color = red>Failed to clear memory: Unable to locate machine.</font color>", "tcserror")