Core/Misc: Added the possibility to configure the hour at which the server will be return old mails or delete them.

Port From (https://github.com/TrinityCore/TrinityCore/commit/3b36278d0227d241643a618fdc0e8cce5133d78c)
This commit is contained in:
hondacrx
2021-01-08 20:38:58 -05:00
parent 90f8029fe1
commit 3e9b4d0cef
4 changed files with 18 additions and 2 deletions
+2 -1
View File
@@ -963,7 +963,8 @@ namespace Game
//one second is 1000 -(tested on win system)
// @todo Get rid of magic numbers
var localTime = Time.UnixTimeToDateTime(GameTime.GetGameTime()).ToLocalTime();
mail_timer = ((((localTime.Hour + 20) % 24) * Time.Hour * Time.InMilliseconds) / m_timers[WorldTimers.Auctions].GetInterval());
byte CleanOldMailsTime = WorldConfig.GetIntValue(WorldCfg.CleanOldMailTime);
mail_timer = ((((localTime.Hour + (24 - CleanOldMailsTime)) % 24) * Time.Hour * Time.InMilliseconds) / m_timers[WorldTimers.Auctions].GetInterval());
//1440
mail_timer_expires = ((Time.Day * Time.InMilliseconds) / (m_timers[(int)WorldTimers.Auctions].GetInterval()));
Log.outInfo(LogFilter.ServerLoading, "Mail timer set to: {0}, mail return is called every {1} minutes", mail_timer, mail_timer_expires);