Shutdown timer rule/zone basis
This code allows zone shutdown timers to be set on a per zone basis.
Should help some servers from booting up the same zone 30 times in 10 minutes Should also help with zones that have graveyards in other zones (I am assuming the timer on corpses stops while a zone is shutdown) Short explanation of how this works. If you want to make blackburrow wait 10 minutes after it is empty to shutdown Find blackburrow in the zone table and change its shutdowndelay to 600000 Let me know if I missed something. Required SQL Code:
ALTER TABLE `zone` ADD column `shutdowndelay` bigint (16) unsigned NOT NULL default '5000'; Near line 181 Insert Code:
int getZoneShutDownDelay(int32 zoneID); At end insert Code:
int ZoneDatabase::getZoneShutDownDelay(int32 zoneID) near line 128 CHANGE Code:
void StartShutdownTimer(int32 set_time = ZONE_AUTOSHUTDOWN_DELAY); Code:
void StartShutdownTimer(int32 set_time = (RuleI(Zone, AutoShutdownDelay))); near line 32 INSERT Code:
#include "../common/rulesys.h" Line 654 CHANGE Code:
autoshutdown_timer(ZONE_AUTOSHUTDOWN_DELAY), Code:
autoshutdown_timer((RuleI(Zone, AutoShutdownDelay))), FIND (was line 1113 on mine) Code:
void Zone::StartShutdownTimer(int32 set_time) { Code:
void Zone::StartShutdownTimer(int32 set_time) { Near line 91 INSERT Code:
RULE_INT ( Zone, AutoShutdownDelay, 5000 ) //How long a dynamic zone stays loaded while empty Find and DELETE (line 38 for me) Code:
#define ZONE_AUTOSHUTDOWN_DELAY 5000 Find and DELETE (line 21 for me) Code:
//#define ZONE_AUTOSHUTDOWN_DELAY 5000 |
It compiled good, I am putting this into action ASAP. We have had a lot of trouble with people that use the zone shutdown with 0 players as an exploit to get items that is rare.
Something like this is just what I was looking for. Thanks a bunch |
Might want to grab SVN, which has this already in it. It also has additional changes to this system that prevents a zone crash.
|
The code above crashes the zone? We have special code that we choose to enter into our source code and do not always use the SVN, usually if I need changes I have to sort through the SVN code and determine what is what.
|
If you replace the following functions with the code out of the SVN you should be good. I am fairly certain the two changes were made in these functions. I recall one of them dealing with the return value.
Zone\zonedb.cpp int ZoneDatabase::getZoneShutDownDelay(int32 zoneID) and zone\zone.cpp void Zone::StartShutdownTimer(int32 set_time) If I get time I will try to pull them and repost here. |
All times are GMT -4. The time now is 08:40 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.