mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Profiler/Chars
* prefix characters flagged for rename to prevent collision with real char names (multiple chars flagged for rename will still collide, but what the hoo haa) * alter table index to prevent creation and subsequent conflict with duplicate entries of the same char (realm/guid pair)
This commit is contained in:
@@ -401,6 +401,9 @@ class Profiler
|
||||
'achievementpoints' => 0
|
||||
);
|
||||
|
||||
// char is flagged for rename
|
||||
if ($char['at_login'] & 0x1)
|
||||
$data['name'] = 'RENAME-'.$data['name'];
|
||||
|
||||
/********************/
|
||||
/* talents + glyphs */
|
||||
|
||||
@@ -589,6 +589,10 @@ class RemoteProfileList extends ProfileList
|
||||
$distrib[$curTpl['realm']]++;
|
||||
}
|
||||
|
||||
// char is pending rename
|
||||
if ($curTpl['at_login'] & 0x1)
|
||||
$curTpl['name'] = 'RENAME-'.$curTpl['name'];
|
||||
|
||||
$curTpl['cuFlags'] = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1886,7 +1886,7 @@ CREATE TABLE `aowow_profiler_profiles` (
|
||||
`glyphs2` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
`activespec` tinyint(1) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `realm_realmGUID_name` (`realm`,`realmGUID`,`name`),
|
||||
UNIQUE KEY `realm_realmGUID` (`realm`,`realmGUID`),
|
||||
KEY `user` (`user`),
|
||||
KEY `guild` (`guild`),
|
||||
CONSTRAINT `FK_aowow_profiler_profiles_aowow_profiler_guild` FOREIGN KEY (`guild`) REFERENCES `aowow_profiler_guild` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
|
||||
@@ -3090,7 +3090,7 @@ UNLOCK TABLES;
|
||||
|
||||
LOCK TABLES `aowow_dbversion` WRITE;
|
||||
/*!40000 ALTER TABLE `aowow_dbversion` DISABLE KEYS */;
|
||||
INSERT INTO `aowow_dbversion` VALUES (1525094405,0,NULL,NULL);
|
||||
INSERT INTO `aowow_dbversion` VALUES (1527333496,0,NULL,NULL);
|
||||
/*!40000 ALTER TABLE `aowow_dbversion` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
|
||||
8
setup/updates/1527333495_01.sql
Normal file
8
setup/updates/1527333495_01.sql
Normal file
@@ -0,0 +1,8 @@
|
||||
-- clear synced chars to prevent conflicts
|
||||
DELETE FROM `aowow_profiler_profiles` WHERE `realmGUID` IS NOT NULL;
|
||||
-- clear queue
|
||||
DELETE FROM `aowow_profiler_sync`;
|
||||
-- update unique index
|
||||
ALTER TABLE `aowow_profiler_profiles`
|
||||
DROP INDEX `realm_realmGUID_name`,
|
||||
ADD UNIQUE INDEX `realm_realmGUID` (`realm`, `realmGUID`);
|
||||
Reference in New Issue
Block a user