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:
Sarjuuk
2018-05-26 13:21:30 +02:00
parent 7dc283f649
commit c5d28a9bbc
4 changed files with 17 additions and 2 deletions

View File

@@ -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 */

View File

@@ -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;
}

View File

@@ -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;

View 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`);