mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Misc
* 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:
@@ -169,9 +169,6 @@ abstract class BaseType
|
||||
}
|
||||
else if (is_string($c[1]))
|
||||
{
|
||||
if (!empty($miscData['forceCiCollate']))
|
||||
$field .= ' COLLATE utf8_general_ci';
|
||||
|
||||
$op = (isset($c[2]) && $c[2] == '!') ? 'NOT LIKE' : 'LIKE';
|
||||
$val = DB::Aowow()->escape($c[1]);
|
||||
}
|
||||
@@ -1031,10 +1028,10 @@ abstract class Filter
|
||||
|
||||
private function genericString($field, $value, $localized)
|
||||
{
|
||||
if (!$localized)
|
||||
return [$field, (string)$value];
|
||||
if ($localized)
|
||||
$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)
|
||||
|
||||
@@ -76,7 +76,8 @@ class CreatureList extends BaseType
|
||||
if ($type)
|
||||
$row3[] = Lang::game('ct', $type);
|
||||
|
||||
$row3[] = '('.Lang::npc('rank', $this->curTpl['rank']).')';
|
||||
if ($_ = Lang::npc('rank', $this->curTpl['rank']))
|
||||
$row3[] = '('.$_.')';
|
||||
|
||||
$x = '<table>';
|
||||
$x .= '<tr><td><b class="q">'.$this->getField('name', true).'</b></td></tr>';
|
||||
|
||||
@@ -1112,6 +1112,11 @@ class Util
|
||||
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
|
||||
public static function checkNumeric(&$data)
|
||||
{
|
||||
@@ -1592,7 +1597,7 @@ class Util
|
||||
return false;
|
||||
}
|
||||
|
||||
private static $realms;
|
||||
private static $realms = [];
|
||||
public static function getRealms()
|
||||
{
|
||||
if (DB::isConnectable(DB_AUTH) && !self::$realms)
|
||||
|
||||
@@ -2278,6 +2278,7 @@ CREATE TABLE `aowow_titles` (
|
||||
`expansion` tinyint(3) unsigned NOT NULL,
|
||||
`src12Ext` mediumint(9) unsigned NOT NULL,
|
||||
`eventId` smallint(5) unsigned NOT NULL,
|
||||
`bitIdx` tinyint(3) unsigned NOT NULL,
|
||||
`male_loc0` varchar(33) NOT NULL,
|
||||
`male_loc2` varchar(35) NOT NULL,
|
||||
`male_loc3` varchar(37) NOT NULL,
|
||||
@@ -2288,7 +2289,8 @@ CREATE TABLE `aowow_titles` (
|
||||
`female_loc3` varchar(39) NOT NULL,
|
||||
`female_loc6` varchar(35) NOT NULL,
|
||||
`female_loc8` varchar(41) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `bitIdx` (`bitIdx`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ class DBC
|
||||
'battlemasterlist' => 'niixxxxxxixxxxxxxxxxxxxxxxxxixii',
|
||||
'charbaseinfo' => 'bb',
|
||||
'charstartoutfit' => 'nbbbXiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
|
||||
'chartitles' => 'nxsxssxxsxsxxxxxxxxsxssxxsxsxxxxxxxxx',
|
||||
'chartitles' => 'nxsxssxxsxsxxxxxxxxsxssxxsxsxxxxxxxxi',
|
||||
'chrclasses' => 'nxixsxssxxsxsxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsxixi',
|
||||
'chrraces' => 'niixxxxixxxsxisxssxxsxsxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi',
|
||||
'creaturedisplayinfo' => 'nixixxssssxxxxxx',
|
||||
@@ -130,7 +130,7 @@ class DBC
|
||||
'battlemasterlist' => 'Id,mapId,moreMapId,areaType,maxPlayers,minLevel,maxLevel',
|
||||
'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',
|
||||
'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',
|
||||
'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',
|
||||
|
||||
@@ -49,7 +49,7 @@ function titles()
|
||||
WHERE
|
||||
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
|
||||
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);
|
||||
|
||||
7
setup/updates/1439590146_01.sql
Normal file
7
setup/updates/1439590146_01.sql
Normal 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');
|
||||
Reference in New Issue
Block a user