ID:270397
 
I'm having problems with rebooting my game, and I believe it's because reboot's trying to do something I don't want it to (ie reconnect players with their mob that was there before the reboot). So can someone tell me what reboot actually does?

If it DOES do that, how can I stop it? It's causing a lot of problems with my title screen...
From the reference:

"Reboot proc (world)

Format:
Reboot(reason)

Args:
reason: the reason Reboot() was called:
0 or null: Called by game code
1: By host (Ctrl+R in Dream Seeker)
2: By world.Topic()
3: By SIGUSR1 in UNIX

Default action:
Reload the world from scratch. Any connected players will automatically relogin. This would be useful if you needed to recompile the world after changing some code.


In a UNIX environment, you can cause a running server to reboot by sending it the signal SIGUSR1.

If you override this proc, you must call ..() if you want the reboot to complete normally.
"
In response to Jp
Holy crap that was FAST!
Ok so it's as I feared. Do you know of a way that I can use reboot to log people out of their current mobs but not kep them logged out entirely?

Anyway, thanks!
Not keep them logged out entirely? What do you mean?

You could edit the current Reboot() proc so that the world just shut down, like so:

Reboot()
del world


But restoring the game to the exact state it was in before would require extensive use of savefiles. Possible, but certainly not trivial.
In response to Jp
Not exactly what I meant. Let me outline what my problem is:

I have a title screen which people end up at when they log in. EXCEPT, occasionally during reboot, it skips the title screen and puts their char back where it was before reboot, even though the player remains at the title screen. This causes duplication and all sorts of screwy errors. I want to know if there's a way to delete those empty mobs without kicking everyone out of the world.
Probably, there's a problem with your saving system. Unless you're experiencing a Reboot() bug - I know there's a few of them.

If you have usr in Login()'s or client.New()'s, that may be causing the problems - usr in Logins() and so forth generally doesn't cause any problems, but just to be sure.
In response to Jp
Well I probably AM experiencing a Reboot bug but I was HOPING that it was just me so I could fix it :(
Show us what your login or saving code looks like. Maybe then we can look into this deeper.

~Tikey
In response to PlasmaDragon0123
Heh, that's kind of huge. The saving code isn't but the login code itself is massive. It's also kinda tangly @_@

However, I think I know the real problem but I need to post it in a different thread.
It is not as you've feared. Reboot() reinnitializes the world, deleting all data objects in the process. No mobs, clients, or even the old world itself, are reused in the process. The clients' mobs are deleted, the clients themselves are deleted, but DS makes sure to reconnect the player to the game, giving them a brand new client object, and a brand new mob.

Any problems you're having with seemingly persistant mobs may be, as has been noted, part of some saving system you have. What I think is more likely is that you've saved the map with a reference to a mob. Consider this:
obj/sign
var
mob/writer as mob
written_stuff as text
verb
write(var/what as text)
set src in view()
writer = usr
written_stuff = what proc
save()
var/savefile/S = new savefile("map.sav")
S << src

Besides a great many other things wrong with this code, the write verb is saving a reference to the actual mob that wrote on it, which means that it is saving that mob as well. When the sign is loaded back into the world, it'll load the mob, who's key is set to a certain value, which will connect to a client with a key of the same value.

Disable your map loading system and see if the problem goes away. If it does, download one of the savefile editors available, and correct where the problem is in that file.
In response to IainPeregrine
Actually, you've hit on what I decided was the problem (See other thread). However, in my case it's not the saving system exactly but rather a function of the saving system which I'm not sure I can disable. What I mean is, I'm saving mobs which somehow contain references to other mobs, which causes them to be recreated when the mob logs in again. Big problem, not sure how to fix.