ID:265660
 
I had this issue with Swapmaps, when ever I deleted a /swapmap, and then shut down DS, then it would normally shut down, but several seconds later, I got the Windows-error message: "A problem has occured with dreamseeker.exe ..."(before the error shows it's still an active proces), I think most of you know it(and when I tried rebooting instead of shutting down, it didn't log me back in.) But this only occured when the map was deleted, and not in any other case(not even if the map wasn't deleted...) So I checked the part of my code where it deletes the map, and found an irrelevant issue, I was deleting the map in Enter() instead of Entered(), so I changed that... and a bit later I found out it wasn't as irrelevant as I thought, adding the two new letters fixed the problem...

My question, out of curiousity, is: Why does this happen when using Enter? What exactly is causing this?

O-matic
While the crash shouldn't be happening, it sounds like the problem is that DM is trying to reference a turf that was deleted when you unloaded the map. Likely that would be the turf used for Exited() or the second argument to Entered().

Doing the unloading in Enter() is definitely a design flaw. Enter() is where you check to see if a location is accessible, not where you handle the consequences if entering was successful. So changing this to Entered() was the right way to go regardless.

Typically unloading a map right away is not a great idea anyway. You're better off waiting a bit and then seeing if it's no longer in use, or likely to be in use again in the near future, before unloading it.

Lummox JR
In response to Lummox JR
Lummox JR wrote:
While the crash shouldn't be happening, it sounds like the problem is that DM is trying to reference a turf that was deleted when you unloaded the map. Likely that would be the turf used for Exited() or the second argument to Entered().

Ah, that makes sense... So putting a delay would fix that(not that I am going to use Enter(), though)?

Doing the unloading in Enter() is definitely a design flaw. Enter() is where you check to see if a location is accessible, not where you handle the consequences if entering was successful. So changing this to Entered() was the right way to go regardless.

Not sure what I was thinking at the time, I guess I either was extremely tired or just forgot the last two letters...

Typically unloading a map right away is not a great idea anyway. You're better off waiting a bit and then seeing if it's no longer in use, or likely to be in use again in the near future, before unloading it.

Would it be a good idea if a map, used as a private house, will be created/loaded when the user logs in and deleted when he logs out?

O-matic
In response to O-matic
O-matic wrote:
Would it be a good idea if a map, used as a private house, will be created/loaded when the user logs in and deleted when he logs out?

If the user loads in the house, then yes, load it when they load; otherwise best to wait for them to enter or at least get near it. As far as deleting on logout, I'd unload the map once the user had logged out for a certain period of time, or were located nowhere near it (e.g., 4 screens away); that should also apply to anyone with access to that house.

Lummox JR
In response to Lummox JR
Bingo. Thanks for the advice.

O-matic