ID:117476
 
BYOND Version:489
Operating System:Windows Vista Home Basic
Web Browser:Chrome 13.0.782.112
Applies to:Dream Seeker
Status: Unverified

Thus far we've been unable to verify or reproduce this bug. Or, it has been observed but it cannot be triggered with a reliable test case. You can help us out by editing your report or adding a comment with more information.
Descriptive Problem Summary:
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.
proc
DCM_Save(mob/user)
if(user)
dev_log(user,"<font color=green>[user] saved their character. ([user.type],[user.key])")
var/savefile/save=new("players/[copytext(ckey(user.key),1,2)]/[ckey(user.key)].sav")
save["mob"] << user
save["lastlogin"] << world.realtime
DCM_Load(mob/user)
dev_log(user,"<font color=green>[user]'s save began loading.<br>")
var/savefile/save=new("players/[copytext(ckey(user.key),1,2)]/[ckey(user.key)].sav")
if(save)
save["mob"] >> user
.=save["lastlogin"]
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().

Expected Results:
This doesn't happen.

Actual Results:
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...

Workarounds:
See above. Nothing other than that.
Copies of several of the affected savefiles, converted to text so they can be examined, would be helpful.
http://neus-projects.net/etc/ardratz.txt
http://neus-projects.net/etc/blackchaosx.txt

There are two samples, converted to text, as you asked.

I've had someone PM me on my forum and say that it might also be related to someone using some sort of .dll injector, but I can't verify this and thought I would just include the idea in case.

Let me know if you need anything else.
Having looked at the savefiles, I'm not sure what's really going on except that they do seem to be corrupted. The mob's savefile information is unfortunately just too vast.

I wouldn't rule out a problem in the code itself. In particular, I'd look out for any vars that store mobs that should probably be /tmp. Being able to look through the code myself might shed some light on it, but for now this will have to go into Unverified.