ID:175814
 
I keep having this reaccuring bug, but I cannot isolate it because it does not leave an error in dream seeker. My friend calls them "Rollbacks" because it sometimes occurs and rolls the server back to a prior time, and people who aren't really logged in can reappear. It seems to mostly happen when someone logins in. Can someone help me here?
Ryuo
If you are talking about things such as someone logs in then someone that is already logged in logs in reverts back to what their savefile was, it is because you have a var that you defined something like usr.tellback = M (in this case M is in reference to another player)... When the savefile reads that when another player's savefile is loaded, it is the same as loading the other player (what was saved as M) again without saving.

To prevent this, make any player's variables that you set to another actual player, to a tmp var:

mob/var/tmp/tellback




Untill I figured out what the problem was myself a few months ago, this was my longest, worst, and most annoying bug I've ever had in making BYOND games.
In response to Kunark
Kunark, I mean that it doesn't just revert more than one person. It affects more than one it seems, cause I see them log out then back in, and I'm wondering whats going on.
In response to Ryuo
Then maybe you have a player saved list that is full of all the players in the world.


As in:


mob/var/list/groupies = list()

mob/verb/Doomsday()
for(var/mob/PC/P in world)
var/I = input(P,"Would you join me to be taken down when I login?") in list("Yes","No")
if(I == "Yes")
usr.groupies += P

//Afterwards, this could contain Danny, Jimmy, Gina, and Billy

//You logout, then back in...

//Billy, Jimmy, Gina, and Danny "Rollback"!!!





Fix it like this:


mob/var/tmp/list/groupies = list()
Kunark's got you on the right track here: Your mobs are being saved along with references to other mobs, which might include a direct reference like mob.party_leader or mob.arch_enemy, or it might also be a reference to an obj which keeps such references itself. Lists could be another culprit, as could any reference to a turf.

Skysaw discovered this problem last year with MLAAS. At the time he was keeping a reference to a turf as one of the mobs' vars, and sometimes that turf was saved with a mob in its contents list. And when another player's mob is reloaded from the savefile in this way, their key is loaded along with it. If a player is in the game they'll connect right to the new mob. If they're not in the game, their mob will magically reappear anyway.

So the solution is to be a lot more careful with references, and you should definitely look into editing savefiles to take out these extra mob references.

Also you should consider writing custom Write() procs for various atom types. You'll probably find turf.Write() won't work quite like you hope, because I had nothing but trouble overriding it for SwapMaps, but try something like this for starters:
turf
// a little modification of the Blue Book's code
Write(savefile/S)
for(var/V in vars)
if(issaved(vars[V]))
if(initial(vars[V])==vars[V])
S.dir.Remove(V)
else S[V] << vars[V]
// now, remove all mobs from contents
// even monsters--they can always be saved separately
var/list/L=contents
var/mob/M=locate() in contents
if(M)
L=contents.Copy()
for(M in contents) L-=M
if(!L.len)
S.Remove("contents")
else
S["contents"] << L
// this will trim off useless saving of overlay/underlay lists
if(!overlays.len)
S.Remove("overlays")
if(!underlays.len)
S.Remove("underlays")
I hope that helps.

Lummox JR