ID:1430448
 
(See the best response by Ss4toby.)
Problem description:
I would like to know the exact and full string of commands called and their order; ie: mob/Logout() is called before client/Del(), where does a window's on-close come in to this? I did a search in developer help for on-close, but after five pages I couldn't find anything relating to what I need.
Best response
I ran a little test.
var/F
mob/Login()
fdel("File.txt")
F=file("File.txt")
winset(src,"mainwindow","on-close=WindowClose")//Default skin.
..()

mob/Logout()
F<<"Logout"
..()


mob/Del()
F<<"Mob Del"
..()

client/Del()
F<<"Client Del"

mob/verb/WindowClose()
set hidden = 1
F<<"Window Close"


And it turns out the order is:

Window Close
Client Del
Logout

Also, if they don't close the window but click options->quit, then window close isn't ran out all:
Client Del
Logout

Additionally, if you place a del(src) in the mob/Logout() proc, then mob del will be the last thing ran.

Window Close
Client Del
Logout
Mob Del

Elsewise mob/del isn't ran at all (I assumed placing ..() would do this for me, but I must had been mistaken. Live and learn).
It's probably not a good idea to rely on this order anyways. Just run it all at once in one proc to keep the order straight.
In response to Ss4toby
It makes sense that client/Del() would call mob/Logout(), since the DM Reference says so in client/Del().

Also in the DM Reference is the fact that mob/Logout() doesn't do anything by default, including deleting the mob, and it explicitly states client/Del() doesn't delete the mob.

That much is obvious from the DM Reference.

Clarifying the behavior of on-close is nice, and it makes sense. The on-close command is run when the window is closed by the player, while the .quit command just disconnects the player; closing the window is just a side-effect that happens afterwards (but apparently isn't called afterwards).
In response to Ss4toby
Ah, thanks. I would've run the test myself, but I was rather tired. I was meaning that mob.Logout() was called inside client.Del(), so mob.Logout() should finish before the client.Del() instead of called before.