* added column bitIdx to ?_titles
 * actually don't use COLLATE as it ignores indizes. Just search with lowerCase and properCase simultaneously
This commit is contained in:
Sarjuuk
2015-08-15 00:09:48 +02:00
parent 23260c2366
commit 8394a3863f
7 changed files with 24 additions and 12 deletions

View File

@@ -169,9 +169,6 @@ abstract class BaseType
} }
else if (is_string($c[1])) else if (is_string($c[1]))
{ {
if (!empty($miscData['forceCiCollate']))
$field .= ' COLLATE utf8_general_ci';
$op = (isset($c[2]) && $c[2] == '!') ? 'NOT LIKE' : 'LIKE'; $op = (isset($c[2]) && $c[2] == '!') ? 'NOT LIKE' : 'LIKE';
$val = DB::Aowow()->escape($c[1]); $val = DB::Aowow()->escape($c[1]);
} }
@@ -1031,10 +1028,10 @@ abstract class Filter
private function genericString($field, $value, $localized) private function genericString($field, $value, $localized)
{ {
if (!$localized) if ($localized)
return [$field, (string)$value]; $field .= '_loc'.User::$localeId;
return $this->modularizeString([$field.'_loc'.User::$localeId], $value); return $this->modularizeString([$field], (string)$value);
} }
private function genericNumeric($field, &$value, $op, $castInt) private function genericNumeric($field, &$value, $op, $castInt)

View File

@@ -76,7 +76,8 @@ class CreatureList extends BaseType
if ($type) if ($type)
$row3[] = Lang::game('ct', $type); $row3[] = Lang::game('ct', $type);
$row3[] = '('.Lang::npc('rank', $this->curTpl['rank']).')'; if ($_ = Lang::npc('rank', $this->curTpl['rank']))
$row3[] = '('.$_.')';
$x = '<table>'; $x = '<table>';
$x .= '<tr><td><b class="q">'.$this->getField('name', true).'</b></td></tr>'; $x .= '<tr><td><b class="q">'.$this->getField('name', true).'</b></td></tr>';

View File

@@ -1112,6 +1112,11 @@ class Util
return mb_convert_case($str, MB_CASE_TITLE, 'UTF-8'); return mb_convert_case($str, MB_CASE_TITLE, 'UTF-8');
} }
public static function lower($str)
{
return mb_strtolower($str, 'UTF-8');
}
// note: valid integer > 32bit are returned as float // note: valid integer > 32bit are returned as float
public static function checkNumeric(&$data) public static function checkNumeric(&$data)
{ {
@@ -1592,7 +1597,7 @@ class Util
return false; return false;
} }
private static $realms; private static $realms = [];
public static function getRealms() public static function getRealms()
{ {
if (DB::isConnectable(DB_AUTH) && !self::$realms) if (DB::isConnectable(DB_AUTH) && !self::$realms)

View File

@@ -2278,6 +2278,7 @@ CREATE TABLE `aowow_titles` (
`expansion` tinyint(3) unsigned NOT NULL, `expansion` tinyint(3) unsigned NOT NULL,
`src12Ext` mediumint(9) unsigned NOT NULL, `src12Ext` mediumint(9) unsigned NOT NULL,
`eventId` smallint(5) unsigned NOT NULL, `eventId` smallint(5) unsigned NOT NULL,
`bitIdx` tinyint(3) unsigned NOT NULL,
`male_loc0` varchar(33) NOT NULL, `male_loc0` varchar(33) NOT NULL,
`male_loc2` varchar(35) NOT NULL, `male_loc2` varchar(35) NOT NULL,
`male_loc3` varchar(37) NOT NULL, `male_loc3` varchar(37) NOT NULL,
@@ -2288,7 +2289,8 @@ CREATE TABLE `aowow_titles` (
`female_loc3` varchar(39) NOT NULL, `female_loc3` varchar(39) NOT NULL,
`female_loc6` varchar(35) NOT NULL, `female_loc6` varchar(35) NOT NULL,
`female_loc8` varchar(41) NOT NULL, `female_loc8` varchar(41) NOT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`),
INDEX `bitIdx` (`bitIdx`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;

View File

@@ -48,7 +48,7 @@ class DBC
'battlemasterlist' => 'niixxxxxxixxxxxxxxxxxxxxxxxxixii', 'battlemasterlist' => 'niixxxxxxixxxxxxxxxxxxxxxxxxixii',
'charbaseinfo' => 'bb', 'charbaseinfo' => 'bb',
'charstartoutfit' => 'nbbbXiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'charstartoutfit' => 'nbbbXiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'chartitles' => 'nxsxssxxsxsxxxxxxxxsxssxxsxsxxxxxxxxx', 'chartitles' => 'nxsxssxxsxsxxxxxxxxsxssxxsxsxxxxxxxxi',
'chrclasses' => 'nxixsxssxxsxsxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsxixi', 'chrclasses' => 'nxixsxssxxsxsxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsxixi',
'chrraces' => 'niixxxxixxxsxisxssxxsxsxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi', 'chrraces' => 'niixxxxixxxsxisxssxxsxsxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi',
'creaturedisplayinfo' => 'nixixxssssxxxxxx', 'creaturedisplayinfo' => 'nixixxssssxxxxxx',
@@ -130,7 +130,7 @@ class DBC
'battlemasterlist' => 'Id,mapId,moreMapId,areaType,maxPlayers,minLevel,maxLevel', 'battlemasterlist' => 'Id,mapId,moreMapId,areaType,maxPlayers,minLevel,maxLevel',
'charbaseinfo' => 'raceId,classId', 'charbaseinfo' => 'raceId,classId',
'charstartoutfit' => 'Id,raceId,classId,gender,item1,item2,item3,item4,item5,item6,item7,item8,item9,item10,item11,item12,item13,item14,item15,item16,item17,item18,item19,item20', 'charstartoutfit' => 'Id,raceId,classId,gender,item1,item2,item3,item4,item5,item6,item7,item8,item9,item10,item11,item12,item13,item14,item15,item16,item17,item18,item19,item20',
'chartitles' => 'Id,male_loc0,male_loc2,male_loc3,male_loc6,male_loc8,female_loc0,female_loc2,female_loc3,female_loc6,female_loc8', 'chartitles' => 'Id,male_loc0,male_loc2,male_loc3,male_loc6,male_loc8,female_loc0,female_loc2,female_loc3,female_loc6,female_loc8,bitIdx',
'chrclasses' => 'Id,powerType,name_loc0,name_loc2,name_loc3,name_loc6,name_loc8,fileString,flags,expansion', 'chrclasses' => 'Id,powerType,name_loc0,name_loc2,name_loc3,name_loc6,name_loc8,fileString,flags,expansion',
'chrraces' => 'Id,flags,factionId,baseLanguage,fileString,side,name_loc0,name_loc2,name_loc3,name_loc6,name_loc8,expansion', 'chrraces' => 'Id,flags,factionId,baseLanguage,fileString,side,name_loc0,name_loc2,name_loc3,name_loc6,name_loc8,expansion',
'creaturedisplayinfo' => 'Id,modelid,extraInfoId,skin1,skin2,skin3,iconString', 'creaturedisplayinfo' => 'Id,modelid,extraInfoId,skin1,skin2,skin3,iconString',

View File

@@ -49,7 +49,7 @@ function titles()
WHERE WHERE
qt.RewardTitle <> 0'; qt.RewardTitle <> 0';
DB::Aowow()->query('REPLACE INTO ?_titles SELECT Id, 0, 0, 0, 0, 0, 0, 0, male_loc0, male_loc2, male_loc3, male_loc6, male_loc8, female_loc0, female_loc2, female_loc3, female_loc6, female_loc8 FROM dbc_chartitles'); DB::Aowow()->query('REPLACE INTO ?_titles SELECT Id, 0, 0, 0, 0, 0, 0, 0, bitIdx, male_loc0, male_loc2, male_loc3, male_loc6, male_loc8, female_loc0, female_loc2, female_loc3, female_loc6, female_loc8 FROM dbc_chartitles');
// hide unused titles // hide unused titles
DB::Aowow()->query('UPDATE ?_titles SET cuFlags = ?d WHERE id BETWEEN 85 AND 123 AND id NOT IN (113, 120, 121, 122)', CUSTOM_EXCLUDE_FOR_LISTVIEW); DB::Aowow()->query('UPDATE ?_titles SET cuFlags = ?d WHERE id BETWEEN 85 AND 123 AND id NOT IN (113, 120, 121, 122)', CUSTOM_EXCLUDE_FOR_LISTVIEW);

View File

@@ -0,0 +1,7 @@
ALTER TABLE `aowow_titles`
ADD COLUMN `bitIdx` tinyint(3) unsigned NOT NULL AFTER `eventId`,
ADD INDEX `bitIdx` (`bitIdx`);
DROP TABLE IF EXISTS `dbc_chartitles`;
UPDATE `aowow_dbversion` SET `sql` = CONCAT(`sql`, ' titles');