ID:141092
 
Code:
client
Del()
world<<"[src] has logged out!"
save()
..()
verb/save()
set hidden=1
var/savefile/F=new()
F<<mob
Export(F)


Problem description:
When i call the verb manually it saves, however when i log out (Client/Del()) it doesn't call save and my data gets destroyed. [this is being called at the same time as world/del, i haven't been tested client/del without world/del]
Since you are using client side saving, you need a client connected to send the data to. Del is called when the client disconnects. How is it going to export the savefile to the person when they aren't connected anymore?
In response to T3h P3ngu1n
There client info hasn't been deleted yet, and that's whats being saved.
In response to Tubutas
But there is no connection to the client's computer to send it to them.
In response to T3h P3ngu1n
When i host the game in DD client/Del still isn't being called.

In other games i have and client/Del gets called even in DS.

EDIT 1:
"Default action:
If the player is connected to a mob, call mob.Logout() to disconnect. If the player's connection to the world is still not dead, kill it."

it should keep the client until it finishes the del call then del the world.

EDIT 2:
Looking back in games where i used client side saving i had an autosave for some reason.

The reference guide on client.Export() is a little misleading then >.>

Thanks!
In response to Tubutas
Tubutas wrote:
When i host the game in DD client/Del still isn't being called.

In other games i have and client/Del gets called even in DS.

EDIT 1:
"Default action:
If the player is connected to a mob, call mob.Logout() to disconnect. If the player's connection to the world is still not dead, kill it."

it should keep the client until it finishes the del call then del the world.

There are two situations that might occur here:

1) You've shut down the world. Therefore, everything is deleted, including mobs. Once a mob is deleted, the client gets disconnected, calling client/Del(). It's too late to save the mob because it's gone.
2) The player has left your game. They closed the DS window and are no longer connected, at which point client/Del() is called. It's too late to save the mob because you can't send a message because the connection is closed.

If you want to save mobs when you close the game, you'll need to do it in world/Del(), before everything is deleted.

If you want to save mobs when a player closes the game... you MIGHT be able to do it by fuddling with the interface, like the on-close parameter. That might not live long enough to send data, but if you could trick them into keeping DS open for a little bit, you should be able to do it. Probably, this means making the actual game window not the default window, and hiding the default window to be closed after you've saved. I haven't fiddled around enough with skins to know if this would work out, though.