feat(Core/GameEvent): Allow unspecified end_time for game events (#2368)

This commit is contained in:
Stoabrogga
2019-11-09 16:12:48 +01:00
committed by Francesco Borzì
parent e83169d715
commit 42a53837c6
2 changed files with 15 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1571672933681916812');
ALTER TABLE `game_event` ALTER COLUMN `start_time` SET DEFAULT '1970-01-01 08:00:00',
ALTER COLUMN `end_time` SET DEFAULT '1970-01-01 08:00:00';
UPDATE `game_event` SET `start_time` = '1970-01-01 08:00:00', `end_time` = '1970-01-01 08:00:00' WHERE `eventEntry` IN
(13, 17, 22, 31, 48, 49, 55, 56, 57, 58, 59, 60, 65, 66);
UPDATE `game_event` SET `end_time` = NULL WHERE `eventEntry` IN
(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 18,
19, 20, 21, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36,
37, 38, 39, 40, 41, 42, 43, 44, 45, 50, 51, 52, 53, 54, 62, 63,
64, 67, 68, 69, 70, 71);

View File

@@ -235,6 +235,8 @@ void GameEventMgr::LoadFromDB()
uint64 starttime = fields[1].GetUInt64();
pGameEvent.start = time_t(starttime);
uint64 endtime = fields[2].GetUInt64();
if (fields[2].IsNull())
endtime = time(nullptr) + 63072000; // add 2 years to current date
pGameEvent.end = time_t(endtime);
pGameEvent.occurence = fields[3].GetUInt64();
pGameEvent.length = fields[4].GetUInt64();