diff --git a/twe/func_converter.php b/twe/func_converter.php index 2bc83dbe..102e36a6 100644 --- a/twe/func_converter.php +++ b/twe/func_converter.php @@ -240,6 +240,7 @@ function SpecCall($call) { case '의술': $type = 73; break; case '격노': $type = 74; break; case '척사': $type = 75; break; + default: $type = 0; break; } return $type; } diff --git a/twe/sammo/CityHelper.php b/twe/sammo/CityHelper.php new file mode 100644 index 00000000..7f8d44a8 --- /dev/null +++ b/twe/sammo/CityHelper.php @@ -0,0 +1,74 @@ +query('SELECT `city` as `id`, `name`, `level`, `nation` from city') as $city) { + $list[$city['id']] = $city; + $listInv[$city['name']] = $city; + + if(!key_exists($id, $listByNation)){ + $listByNation[$id] = []; + } + $listByNation[$id][] = $city; + } + + self::$list = $list; + self::$listInv = $listInv; + self::$listByNation = $listByNation; + } + + public static function getAllCities(){ + if(self::$list === null){ + self::generateCache(); + } + + return self::$list; + } + + public static function getAllNationCities(int $nationID){ + if(self::$listByNation === null){ + self::generateCache(); + } + + return self::$listByNation[$nationID]; + } + + public static function getCity(int $cityID){ + if(self::$list === null){ + self::generateCache(); + } + + return self::$list[$cityID]; + } + + public static function getCityByName(string $cityName){ + if(self::$listInv === null){ + self::generateCache(); + } + + return self::$listInv[$cityName]; + } + + +} \ No newline at end of file