Core/Misc: Various dynspawn cleanup and refactors split off from pooling rewrite:

- Map::RemoveRespawnTime(SpawnObjectType, LowType, doRespawn) split into Map::Respawn and Map::RemoveRespawnTime, without the extra boolean
- Map::RemoveRespawnTime(RespawnInfo*) merged into Map::DeleteRespawnInfo(RespawnInfo*) and is now private
- Map::DeleteRespawnInfo(void) renamed to Map::UnloadAllRespawnInfos to properly describe what it does
- Map::ProcessRespawns now actually saves the delayed respawn time to DB if the respawn was delayed
- Map::AddRespawnInfo now takes const reference, and returns success as a boolean
- Map::AddRespawnInfo no longer offers an unused "replace" parameter
- Map::DeleteRespawnInfo no longer offers a variety of unused private overloads
- Map::SaveRespawnTime no longer offers a tantalizing writeDB parameter. Parameter is now called "startup" to properly describe what it does.
- Map::SaveRespawnInfoDB now takes RespawnInfo reference instead of all the various fields. Still public because compatibility mode. QQ.
- Map::GetWorldObjectBySpawnId sanitized
- Map::GetXRespawnTime methods sanitized to all go through Map::GetRespawnTime

----------

Core/DB: Unify `creature_respawn` and `gameobject_respawn` into a single `respawn` table
This commit is contained in:
Treeston
2019-08-18 12:47:10 +02:00
committed by Ovahlord
parent f9184f026b
commit 90540d684b
15 changed files with 184 additions and 236 deletions

View File

@@ -1659,32 +1659,26 @@ LOCK TABLES `corpse_phases` WRITE;
/*!40000 ALTER TABLE `corpse_phases` DISABLE KEYS */;
/*!40000 ALTER TABLE `corpse_phases` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `creature_respawn`
-- Table structure for table `respawn`
--
DROP TABLE IF EXISTS `creature_respawn`;
DROP TABLE IF EXISTS `respawn`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `creature_respawn` (
`guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier',
`respawnTime` bigint(20) unsigned NOT NULL DEFAULT '0',
`mapId` smallint(10) unsigned NOT NULL DEFAULT '0',
`instanceId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Instance Identifier',
PRIMARY KEY (`guid`,`instanceId`),
CREATE TABLE `respawn` (
`type` smallint(10) unsigned NOT NULL,
`spawnId` int(10) unsigned NOT NULL,
`respawnTime` bigint(20) unsigned NOT NULL,
`mapId` smallint(10) unsigned NOT NULL,
`instanceId` int(10) unsigned NOT NULL,
PRIMARY KEY (`type`,`spawnId`,`instanceId`),
KEY `idx_instance` (`instanceId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Grid Loading System';
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Stored respawn times';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `creature_respawn`
--
LOCK TABLES `creature_respawn` WRITE;
/*!40000 ALTER TABLE `creature_respawn` DISABLE KEYS */;
/*!40000 ALTER TABLE `creature_respawn` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `game_event_condition_save`
--
@@ -1733,32 +1727,6 @@ LOCK TABLES `game_event_save` WRITE;
/*!40000 ALTER TABLE `game_event_save` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `gameobject_respawn`
--
DROP TABLE IF EXISTS `gameobject_respawn`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gameobject_respawn` (
`guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier',
`respawnTime` bigint(20) unsigned NOT NULL DEFAULT '0',
`mapId` smallint(10) unsigned NOT NULL DEFAULT '0',
`instanceId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Instance Identifier',
PRIMARY KEY (`guid`,`instanceId`),
KEY `idx_instance` (`instanceId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Grid Loading System';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `gameobject_respawn`
--
LOCK TABLES `gameobject_respawn` WRITE;
/*!40000 ALTER TABLE `gameobject_respawn` DISABLE KEYS */;
/*!40000 ALTER TABLE `gameobject_respawn` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `gm_subsurvey`
--
@@ -2999,7 +2967,8 @@ INSERT INTO `updates` VALUES
('2018_07_09_00_characters.sql','6F3EA22DD5E4CD9F9C60C4332B147E3DBF2E8A44','ARCHIVED','2018-07-09 18:19:18',0),
('2018_07_15_00_characters.sql','1EB34168BC396A8264C7467AACD1F0A3B036B22D','ARCHIVED','2018-07-15 00:00:00',0),
('2018_08_15_00_characters.sql','592D9F32E96E1A14C8F340E8D085F8F5105B063F','ARCHIVED','2018-08-15 00:00:00',0),
('2018_09_15_00_characters.sql','FDC0AF579D140BE377482B115EE07DC43F870C98','ARCHIVED','2018-08-15 00:00:00',0);
('2018_09_15_00_characters.sql','FDC0AF579D140BE377482B115EE07DC43F870C98','ARCHIVED','2018-08-15 00:00:00',0),
('2019_07_14_00_characters.sql','A141F4F15BDF0320483921429871D4C572BD7E2D','ARCHIVED','2019-07-04 00:00:00',0);
/*!40000 ALTER TABLE `updates` ENABLE KEYS */;
UNLOCK TABLES;