ID:154960
 
mob/verb/test()
var/Addr = startup(file("./Sectors/Sectors.dmb"), 4444, "-once")
shutdown(Addr,1)


[EDIT]
Further digging has lead me to this post: ID:597782 which makes me think this bug was never fixed.
[/EDIT]

How do I make Dream Daemon terminate after it has stopped being hosted? Also, how do I check to see if a port is open or not so I can't host a new project on the same port causing it to fail to host.

I've figured out how to close a window when it's open but not when it's minimized the the tray. This is the code for closing it when it's open but I need to to work for when it's minimized to the tray as well.

    shell({"taskkill /FI "WINDOWTITLE eq Dream Daemon" /F"})
I'm unsure of your initial question, but I'm pretty sure the OpenPort() proc returns null/0 if it was unable to host the world, so via using that you could simply check if the world was successfully hosted or not.
In response to El Wookie
OpenPort() doesn't open up Dream Daemon and it doesn't have any of the features that startup() has.
In response to Zaltron
No, it doesn't, but you can make a little system with OpenPort(), to change the port to one able, example:

world
New()
var/newport=3000 //Initial Port to check...
while( !(OpenPort(newport)) )
newport++
sleep(10) //This will keep checking ports until it finds one that's host-able.
startup(null,newport) //It should work fine, altough i did not test it, but I bet it would help. Just make the adjustments you want.


I hope it helps :/