IMPORTANT: Rev 1529 - RespawnInterval

A place to submit .patch fixes for the DOL SVN

Moderator: Developer Team

IMPORTANT: Rev 1529 - RespawnInterval

Postby Kakuri » Sat Feb 14, 2009 2:27 am

RespawnInterval appears to have been designed to operate as follows:
value < 0: don't respawn at all
value = 0: calculate respawn time based on mob level
value > 0: use specified value to determine respawn time

However, the accessor for RespawnInterval was not handling the <0 case. Now it is. So if you have any mobs in your database with RespawnInterval < 0, you might want to change them to 0. With revisions prior to 1529, any mob with RespawnInterval <= 0 would use a respawn time based on the mob's level. With 1529+, if the value is <0 the mob will never respawn.

The following should do the trick:
UPDATE mob SET RespawnInterval = 0 WHERE RespawnInterval < 0;

On Storm there are about 15,000 mobs that will not respawn after being killed if the database isn't updated first.
User avatar
Kakuri
Developer
 
Posts: 803
Joined: Tue Oct 28, 2008 10:40 pm
Website: http://enlight.hostrator.com/

Re: IMPORTANT: Rev 1529 - RespawnInterval

Postby Tired » Sat Feb 14, 2009 3:07 am

mob @livedol (Storm DOL)

Affected rows: 146,295 of 150,494
Time: 3.688ms
Unaffected rows: 4,199
Database problem? Yea I can fix that.
User avatar
Tired
Server Team
 
Posts: 518
Joined: Thu Apr 20, 2006 5:29 am
Location: United States

Re: IMPORTANT: Rev 1529 - RespawnInterval

Postby Kakuri » Sat Feb 14, 2009 3:35 am

Right, I meant 150k... lost a zero. :P

Also, just in case anyone's concerned about "losing" their no-respawn mobs, it wasn't working before. So if you change all your mobs with -1 to 0, you'll see no change in behavior (regardless of whether you update to 1529 or not). But if you leave them at -1 and update to 1529, then all mobs with -1 will not respawn after being killed. They'll only come back after a server restart.
User avatar
Kakuri
Developer
 
Posts: 803
Joined: Tue Oct 28, 2008 10:40 pm
Website: http://enlight.hostrator.com/

Re: IMPORTANT: Rev 1529 - RespawnInterval

Postby Dinberg » Sat Feb 14, 2009 9:20 am

Hmmm this is very nice - it means for instances now we can just set the respawn interval to -1, rather than attempting to make a new classtype that would not respawn :D

Just out of interest, what happens to non respawn mobs? Do they remain in limbo, or get collected by the GC?
The Marvelous Contraption begins to stir...
User avatar
Dinberg
Inactive Staff Member
 
Posts: 4695
Joined: Sat Mar 10, 2007 9:47 am
Yahoo Messenger: dinberg_darktouch
Location: Jordheim

Re: IMPORTANT: Rev 1529 - RespawnInterval

Postby Kakuri » Sat Feb 14, 2009 9:42 am

I was wondering the same myself... it looks to me like the same in-memory object is used for all incarnations of a mob, with the object just switching state between alive and kicking in the game world and dead & not visible in the game world. I didn't really investigate the issue in detail, but I didn't see anything that led me to believe a mob object is freed to be collected once the mob is killed and won't be respawned.
User avatar
Kakuri
Developer
 
Posts: 803
Joined: Tue Oct 28, 2008 10:40 pm
Website: http://enlight.hostrator.com/

Re: IMPORTANT: Rev 1529 - RespawnInterval

Postby Dinberg » Sat Feb 14, 2009 9:44 am

Hmm, perhaps on StartRespawn, if the respawn time is less than one you could call 'Delete()' on the object? It will persist in the db but should be removed from the Server.
The Marvelous Contraption begins to stir...
User avatar
Dinberg
Inactive Staff Member
 
Posts: 4695
Joined: Sat Mar 10, 2007 9:47 am
Yahoo Messenger: dinberg_darktouch
Location: Jordheim


Return to “%s” DOL Code Contributions

Who is online

Users browsing this forum: No registered users and 0 guests