For a few months now, at random intervals, I have been having to deal with a very strange issue. I'm going to try and describe it as best as I can. The game in question uses savefiles and as far as I've seen only happens when they are loaded.
1) Someone logs in.
2) Due to some unknown issue, they will log in as a different mob type than they should. (I've had to remove a few monsters from the game because of it; usually, when the issue occurs, it seems to be one of the 'last' ones in the files. For example, if you had 'monsters - a.dm' to 'monsters - d.dm', it'd be from the 'd' file.)
3) After this, anyone logging in (save file or not) will have their mob created in the same type. The game begins to glitch out, too; things like spells being able to target turfs when the generated list of targets only adds mobs, etc.
The issue persists through reboots/new daemons and begins again if the person (or an affected person who had their file saved) logs in and the save file is loaded again.
I have done many, many tests and logged many events to see exactly where the problem stems from. The world.mob variable is kept in a statpanel and I've observed it never changing from /mob when the problem begins occurring.
Numbered Steps to Reproduce Problem:
I can't give you any more detail besides that it happens when people load their save files, and only when some unknown modifier comes into play.
Code Snippet (if applicable) to Reproduce Problem:
I'll include my save procedure and loading procedure.
dev_log(user,"<font color=green>[user] saved their character. ([user.type],[user.key])")
save["mob"] << user
save["lastlogin"] << world.realtime
dev_log(user,"<font color=green>[user]'s save began loading.<br>")
save["mob"] >> user
dev_log(user,"<font color=green>[user]'s save finished loading.<br>")
This is also part of a log from when the event occurs (note that Ren Brown is the default name for /mob, not a different character or anything):
08/21/11 19:16:44 - (Ardratz) Ren Brown's save began loading.
08/21/11 19:16:44 - (Ardratz) Donal Murch's save finished loading.
... - This is their initial log in for the day.
08/21/11 19:18:29 - (Ardratz) Donal Murch saved their character. (/mob,Ardratz)
... - This is when they logged out from the game.
08/21/11 19:44:14 - (Ardratz) Ren Brown's save began loading.
08/21/11 19:44:14 - () Cultist Spectre was created at 0,0,0 for: .
08/21/11 19:44:14 - (Ardratz) Donal Murch ( - 0,0,0 tried to login as a monster of type /mob/monsters/Inner_Demon3/agares3 ( - 0,0,0).
08/21/11 19:44:14 - (Ardratz) Donal Murch's save finished loading.
... - This is when they logged back in about 30 minutes later.
The 'Cultist Spectre' line originates from /mob/monster's New(), where it lists the location it was created at and for what purpose (most instances list 'respawn', etc).
The 'tried to login as a monster of type' line comes from mob/monster Login().
This doesn't happen.
It happens at random intervals with no clear reason.
I am stumped. It would be one thing if the mob loaded as an unexpected type (as in it just means there's some save nonsense, possibly the wrong mob getting passed); it's another when the game begins ignoring types in spell targeting, other people who weren't affected logging in to be affected, etc.
Does the problem occur:
Every time? Or how often? It seems to happen every so often. The only way I've managed to work around it is by removing the monster types being created from the game entirely; however, weeks later, this happens again with a different monster type (and always the same one until removed).
In other games? Never seen this before, in 10 years on BYOND. Ever.
In other user accounts? Indeed.
On other computers? Yes.
When does the problem NOT occur?
Most of the time, but when it happens, it doesn't tend to stop no matter what I do (restoring old save backups, etc) until the type in question is removed from the code.
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
If it didn't, it was quite a few versions ago...
See above. Nothing other than that.