* Implement the ability to delete characters without them being removed from

* the DB, so they can be unerased
* Original patch by DasBlub
* Ported to Trinty by Az@zel

--HG--
branch : trunk
This commit is contained in:
Brian
2010-07-21 12:13:23 -06:00
parent 5995a8ec1d
commit 4320b10901
18 changed files with 677 additions and 146 deletions
+16
View File
@@ -1172,6 +1172,11 @@ void World::LoadConfigSettings(bool reload)
m_visibility_notify_periodInInstances = sConfig.GetIntDefault("Visibility.Notify.Period.InInstances", DEFAULT_VISIBILITY_NOTIFY_PERIOD);
m_visibility_notify_periodInBGArenas = sConfig.GetIntDefault("Visibility.Notify.Period.InBGArenas", DEFAULT_VISIBILITY_NOTIFY_PERIOD);
///- Load the CharDelete related config options
m_configs[CONFIG_CHARDELETE_METHOD] = sConfig.GetIntDefault("CharDelete.Method", 0);
m_configs[CONFIG_CHARDELETE_MIN_LEVEL] = sConfig.GetIntDefault("CharDelete.MinLevel", 0);
m_configs[CONFIG_CHARDELETE_KEEP_DAYS] = sConfig.GetIntDefault("CharDelete.KeepDays", 30);
///- Read the "Data" directory from the config file
std::string dataPath = sConfig.GetStringDefault("DataDir","./");
if (dataPath.at(dataPath.length()-1) != '/' && dataPath.at(dataPath.length()-1) != '\\')
@@ -1639,6 +1644,7 @@ void World::SetInitialWorldSettings()
m_timers[WUPDATE_CLEANDB].SetInterval(m_configs[CONFIG_LOGDB_CLEARINTERVAL]*MINUTE*IN_MILLISECONDS);
// clean logs table every 14 days by default
m_timers[WUPDATE_AUTOBROADCAST].SetInterval(abtimer);
m_timers[WUPDATE_DELETECHARS].SetInterval(DAY*IN_MILLISECONDS); // check for chars to delete every day
//to set mailtimer to return mails every day between 4 and 5 am
//mailtimer is increased when updating auctions
@@ -1660,6 +1666,9 @@ void World::SetInitialWorldSettings()
uint32 nextGameEvent = gameeventmgr.Initialize();
m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); //depend on next event
// Delete all characters which have been deleted X days before
Player::DeleteOldCharacters();
sLog.outString("Starting Arena Season...");
gameeventmgr.StartArenaSeason();
@@ -1958,6 +1967,13 @@ void World::Update(uint32 diff)
sOutdoorPvPMgr.Update(diff);
RecordTimeDiff("UpdateOutdoorPvPMgr");
///- Delete all characters which have been deleted X days before
if (m_timers[WUPDATE_DELETECHARS].Passed())
{
m_timers[WUPDATE_DELETECHARS].Reset();
Player::DeleteOldCharacters();
}
sLFGMgr.Update(diff);
RecordTimeDiff("UpdateLFGMgr");
+5 -1
View File
@@ -84,7 +84,8 @@ enum WorldTimers
WUPDATE_CLEANDB = 7,
WUPDATE_AUTOBROADCAST = 8,
WUPDATE_MAILBOXQUEUE = 9,
WUPDATE_COUNT = 10
WUPDATE_DELETECHARS = 10,
WUPDATE_COUNT = 11
};
/// Configuration elements
@@ -281,6 +282,9 @@ enum WorldConfigs
CONFIG_BG_XP_FOR_KILL,
CONFIG_RANDOM_BG_RESET_HOUR,
CONFIG_VMAP_INDOOR_CHECK,
CONFIG_CHARDELETE_KEEP_DAYS,
CONFIG_CHARDELETE_METHOD,
CONFIG_CHARDELETE_MIN_LEVEL,
CONFIG_VALUE_COUNT
};