From d88a77e92f8b7b73169963b779f602055cb48696 Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Thu, 21 Dec 2023 17:02:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/gamedb.sql | 47 +- sql/gamedb2006_migrate_231219_01.sql | 49 ++ .../controller/ActivityController.class.php | 102 +++ .../controller/BaseAuthedController.class.php | 9 +- webapp/models/ExchangeCode.php | 92 +++ webapp/models/Map.php | 42 ++ webapp/mt/Item.php | 703 +++++++++--------- 7 files changed, 691 insertions(+), 353 deletions(-) create mode 100644 sql/gamedb2006_migrate_231219_01.sql create mode 100644 webapp/controller/ActivityController.class.php create mode 100644 webapp/models/ExchangeCode.php create mode 100644 webapp/models/Map.php diff --git a/sql/gamedb.sql b/sql/gamedb.sql index 59d04cdc..999c145d 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -1693,4 +1693,49 @@ CREATE TABLE `t_avatar` ( PRIMARY KEY (`idx`), UNIQUE KEY `hero_idx_type` (`hero_idx`, `item_type`) ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -/*!40101 SET character_set_client = @saved_cs_client */; \ No newline at end of file +/*!40101 SET character_set_client = @saved_cs_client */; + + +CREATE TABLE `t_unlocked_map` ( + `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', + `account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)', + `map_id` int(11) NOT NULL COMMENT '地图ID', + `unlockedtime` int(11) NOT NULL DEFAULT '0' COMMENT '激活时间', + `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', + PRIMARY KEY (`idx`), + UNIQUE KEY `account_map_id` (`account_id`, `map_id`) +) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + + +CREATE TABLE `t_exchange_code` ( + `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', + `exchangecode` varchar(16) NOT NULL COMMENT '兑换码', + `packageno` varchar(32) NOT NULL COMMENT '礼包id', + `codetype` int(11) NOT NULL COMMENT '兑换码类型', + `memo` varchar(40) NOT NULL DEFAULT '0' COMMENT '备注', + `channellist` varchar(255) NOT NULL DEFAULT '' COMMENT '绑定渠道列表', + `batchid` int(11) NOT NULL DEFAULT '0' COMMENT '兑换码批次号', + `usetimes` int(11) NOT NULL DEFAULT '0' COMMENT '使用次数', + `last_usetime` int(11) NOT NULL DEFAULT '0' COMMENT '最后使用时间', + `last_useuser` varchar(64) NOT NULL DEFAULT '' COMMENT '最后使用者', + `begindate` int(11) NOT NULL DEFAULT '0' COMMENT '开始时间', + `enddate` int(11) NOT NULL DEFAULT '0' COMMENT '结束时间', + `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', + PRIMARY KEY (`idx`), + UNIQUE KEY `exchangecode` (`exchangecode`) +) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + + +CREATE TABLE `t_exchange_record` ( + `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', + `account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)', + `exchangecode` varchar(16) NOT NULL COMMENT '兑换码', + `packageno` varchar(32) NOT NULL COMMENT '礼包id', + `codetype` int(11) NOT NULL COMMENT '兑换码类型', + `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', + PRIMARY KEY (`idx`), + UNIQUE KEY `exchangecode_account` (`exchangecode`,`account_id`) +) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; \ No newline at end of file diff --git a/sql/gamedb2006_migrate_231219_01.sql b/sql/gamedb2006_migrate_231219_01.sql new file mode 100644 index 00000000..35d8247c --- /dev/null +++ b/sql/gamedb2006_migrate_231219_01.sql @@ -0,0 +1,49 @@ +begin; + +CREATE TABLE `t_unlocked_map` ( + `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', + `account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)', + `map_id` int(11) NOT NULL COMMENT '地图ID', + `unlockedtime` int(11) NOT NULL DEFAULT '0' COMMENT '激活时间', + `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', + PRIMARY KEY (`idx`), + UNIQUE KEY `account_map_id` (`account_id`, `map_id`) +) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + + +CREATE TABLE `t_exchange_code` ( + `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', + `exchangecode` varchar(16) NOT NULL COMMENT '兑换码', + `packageno` varchar(32) NOT NULL COMMENT '礼包id', + `codetype` int(11) NOT NULL COMMENT '兑换码类型', + `memo` varchar(40) NOT NULL DEFAULT '0' COMMENT '备注', + `channellist` varchar(255) NOT NULL DEFAULT '' COMMENT '绑定渠道列表', + `batchid` int(11) NOT NULL DEFAULT '0' COMMENT '兑换码批次号', + `usetimes` int(11) NOT NULL DEFAULT '0' COMMENT '使用次数', + `last_usetime` int(11) NOT NULL DEFAULT '0' COMMENT '最后使用时间', + `last_useuser` varchar(64) NOT NULL DEFAULT '' COMMENT '最后使用者', + `begindate` int(11) NOT NULL DEFAULT '0' COMMENT '开始时间', + `enddate` int(11) NOT NULL DEFAULT '0' COMMENT '结束时间', + `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', + PRIMARY KEY (`idx`), + UNIQUE KEY `exchangecode` (`exchangecode`) +) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + + +CREATE TABLE `t_exchange_record` ( + `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', + `account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)', + `exchangecode` varchar(16) NOT NULL COMMENT '兑换码', + `packageno` varchar(32) NOT NULL COMMENT '礼包id', + `codetype` int(11) NOT NULL COMMENT '兑换码类型', + `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', + PRIMARY KEY (`idx`), + UNIQUE KEY `exchangecode_account` (`exchangecode`,`account_id`) +) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + +insert into version (version) values(2023092001); + +commit; diff --git a/webapp/controller/ActivityController.class.php b/webapp/controller/ActivityController.class.php new file mode 100644 index 00000000..632a711b --- /dev/null +++ b/webapp/controller/ActivityController.class.php @@ -0,0 +1,102 @@ +_rspErr(1, 'invalid code'); + return; + } + if ($result['begindate'] > myself()->_getNowTime() || $result['enddate'] < myself()->_getNowTime()){ + myself()->_rspErr(1, 'invalid code'); + return; + } + switch ($result['codetype']){ + //一对一(一码只能兑换一次,并且该类道具一人也只能兑换一次) + case 1 :{ + $recordDb = ExchangeCode::getRecordByCode($code); + if ($recordDb){ + myself()->_rspErr(1, 'been used code'); + return; + } + $recordDb2 = ExchangeCode::findRecordByPackage($result['packageno']); + if ($recordDb2){ + myself()->_rspErr(1, 'In exchange for rewards'); + return; + } + } + break; + //一对多(一码可被多人使用,仅一人一次,并且该类道具一人也只能兑换一次) + case 2 :{ + $recordDb = ExchangeCode::findRecordByCode($code); + if ($recordDb){ + myself()->_rspErr(1, 'been used code'); + return; + } + $recordDb2 = ExchangeCode::findRecordByPackage($result['packageno']); + if ($recordDb2){ + myself()->_rspErr(1, 'In exchange for rewards'); + return; + } + } + break; + //多对一 + case 3:{ + $recordDb = ExchangeCode::getRecordByCode($code); + if ($recordDb){ + myself()->_rspErr(1, 'been used code'); + return; + } + } + break; + default :{ + myself()->_rspErr(1, 'invalid'); + return; + } + } + + $itemMt = \mt\Item::get($result['packageno']); + if (!$itemMt){ + myself()->_rspErr(1, "Props that don't exist"); + return; + } + $items = array( + array( + 'item_id' => $itemMt['id'], + 'item_num' => 1 + ) + ); + $propertyChgService = new services\PropertyChgService(); + $awardService = new services\AwardService(); + $this->_addItems($items, $awardService, $propertyChgService); + $fieldKv = array( + 'account_id' => myself()->_getAccountId(), + 'exchangecode' => $code, + 'packageno' => $itemMt['id'], + 'codetype' => $result['codetype'], + 'createtime' => myself()->_getNowTime(), + 'modifytime' => myself()->_getNowTime(), + ); + ExchangeCode::insetRecord($fieldKv); + ExchangeCode::updateExchangeCode($code); + $this->_rspOk(); + } + + public function getMap(){ + $mapDb = Map::findMap(); + $this->_rspData(array("data"=>$mapDb)); + } + + +} + diff --git a/webapp/controller/BaseAuthedController.class.php b/webapp/controller/BaseAuthedController.class.php index c84bea3a..bef999c1 100644 --- a/webapp/controller/BaseAuthedController.class.php +++ b/webapp/controller/BaseAuthedController.class.php @@ -16,6 +16,7 @@ require_once('models/Parachute.php'); require_once('models/Chip.php'); require_once('models/Pass.php'); require_once('models/Avatar.php'); +require_once('models/Map.php'); require_once('mt/Parameter.php'); require_once('mt/RankSeason.php'); require_once('mt/LevelUp.php'); @@ -38,6 +39,7 @@ use models\UserSeasonRing; use models\Chip; use models\Pass; use models\Avatar; +use models\Map; use services\LogService; class BaseAuthedController extends BaseController { @@ -467,7 +469,7 @@ class BaseAuthedController extends BaseController { $headFrames = array(); foreach ($items as $item) { //道具产出埋点 - LogService::productItem($item); +// LogService::productItem($item); if ($awardService){ $awardService->addItem($item['item_id'], $item['item_num']); } @@ -562,6 +564,11 @@ class BaseAuthedController extends BaseController { Avatar::addAvatar($itemMeta); } break; + case mt\Item::UNLOCKED_MAP_TYPE: + { + Map::upsertMap($itemMeta); + } + break; default: { $this->_addLog('additems', 'invalid_item', array( diff --git a/webapp/models/ExchangeCode.php b/webapp/models/ExchangeCode.php new file mode 100644 index 00000000..8bb659f6 --- /dev/null +++ b/webapp/models/ExchangeCode.php @@ -0,0 +1,92 @@ +_getSelfMysql(), + 't_exchange_code', + array( + 'exchangecode'=> $code + ) + ); + if (!$row){ + return null; + } + return $row; + } + + public static function updateExchangeCode($code){ + SqlHelper::update + (myself()->_getSelfMysql(), + 't_exchange_code', + array( + 'exchangecode'=> $code + ), + array( + 'usetimes' => function(){ + return "usetimes + 1"; + }, + "last_usetime" => myself()->_getNowTime(), + "last_useuser" => myself()->_getAccountId(), + ) + ); + } + + public static function getRecordByCode($code){ + $row = SqlHelper::ormSelectOne( + myself()->_getSelfMysql(), + 't_exchange_record', + array( + 'exchangecode'=> $code + ) + ); + if (!$row){ + return null; + } + return $row; + } + + public static function findRecordByCode($code){ + $row = SqlHelper::ormSelectOne( + myself()->_getSelfMysql(), + 't_exchange_record', + array( + 'account_id'=> myself()->_getAccountId(), + 'exchangecode'=> $code, + ) + ); + if (!$row){ + return null; + } + return $row; + } + + public static function findRecordByPackage($package){ + $row = SqlHelper::ormSelectOne( + myself()->_getSelfMysql(), + 't_exchange_record', + array( + 'account_id'=> myself()->_getAccountId(), + 'packageno'=> $package, + ) + ); + if (!$row){ + return null; + } + return $row; + } + + public static function insetRecord($fieldKv){ + SqlHelper::insert + (myself()->_getSelfMysql(), + 't_exchange_record', + $fieldKv + ); + } +} \ No newline at end of file diff --git a/webapp/models/Map.php b/webapp/models/Map.php new file mode 100644 index 00000000..b50bada0 --- /dev/null +++ b/webapp/models/Map.php @@ -0,0 +1,42 @@ +_getSelfMysql(), + 't_unlocked_map', + array( + 'account_id'=> myself()->_getAccountId() + ) + ); + return $rows; + } + + public static function upsertMap($itemMeta){ + SqlHelper::upsert + (myself()->_getSelfMysql(), + 't_unlocked_map', + array( + 'account_id' => myself()->_getAccountId(), + 'map_id' => $itemMeta['param1'], + ), + array( + 'unlockedtime' => myself()->_getNowTime(), + ), + array( + 'account_id' => myself()->_getAccountId(), + 'map_id' => $itemMeta['param1'], + 'unlockedtime' => myself()->_getNowTime(), + 'createtime' => myself()->_getNowTime(), + 'modifytime' => myself()->_getNowTime(), + ) + ); + } + +} \ No newline at end of file diff --git a/webapp/mt/Item.php b/webapp/mt/Item.php index 9151fade..ccf8c87f 100644 --- a/webapp/mt/Item.php +++ b/webapp/mt/Item.php @@ -1,351 +1,352 @@ - $meta['id'], - 'price_info' => array( - 'cost_list' => array(), - 'discount_begin_time' => phpcommon\datetimeToTimestamp($meta['discount_begin']), - 'discount_end_time' => phpcommon\datetimeToTimestamp($meta['discount_end']) - ) - ); - $discount = splitStr1($meta['discount']); - if ($meta['gold'] > 0) { - array_push($info['price_info']['cost_list'], - array( - array( - 'item_id' => V_ITEM_GOLD, - 'item_num' => $meta['gold'], - 'discount' => count($discount) > 0 ? (int)$discount[0] : 0 - ))); - } - if ($meta['diamond'] > 0) { - array_push($info['price_info']['cost_list'], - array( - array( - 'item_id' => V_ITEM_DIAMOND, - 'item_num' => $meta['diamond'], - 'discount' => count($discount) > 1 ? (int)$discount[1] : 0 - ) - )); - } - return $info; - } - - public static function getCostItems($priceInfo, $costItemId) - { - $costGroup = null; - array_walk($priceInfo['cost_list'], function ($val) use(&$costGroup, $costItemId) { - if ($costGroup) { - return; - } - if (count($val) > 0 && $val[0]['item_id'] == $costItemId) { - $costGroup = $val; - return; - } - }); - if (!$costGroup) { - return null; - } - $costItems = array(); - array_walk($costGroup, function ($val) use (&$costItems, $priceInfo) { - if ($val['discount'] > 0 && - myself()->_getNowTime() >= $priceInfo['discount_begin_time'] && - myself()->_getNowTime() <= $priceInfo['discount_end_time'] - ) { - array_push($costItems, array( - 'item_id' => $val['item_id'], - 'item_num' => (int)($val['item_num'] * ($priceInfo['discount'] / 100)), - )); - } else { - array_push($costItems, array( - 'item_id' => $val['item_id'], - 'item_num' => $val['item_num'], - )); - } - }); - return $costItems; - } - - public static function getUseCostItems($itemMeta) - { - $costItems = array(); - foreach (splitStr2($itemMeta['use_cost']) as $arr) { - if (count($arr) >= 2) { - array_push($costItems, array( - 'item_id' => $arr[0], - 'item_num' => $arr[1] - )); - } - } - return $costItems; - } - - public static function isRandAttrItem($itemMeta) - { - return $itemMeta['type'] == self::MATERIAL_TYPE && - $itemMeta['sub_type'] == self::MATERIAL_CHIP_SUBTYPE; - } - - public static function isRoleChipItem($itemMeta) - { - return $itemMeta['type'] == self::CHIP_TYPE && - $itemMeta['sub_type'] == self::ROLE_CHIP_SUBTYPE; - } - - public static function isGunChipItem($itemMeta) - { - return $itemMeta['type'] == self::CHIP_TYPE && - $itemMeta['sub_type'] == self::GUN_CHIP_SUBTYPE; - } - - public static function getBaseAttrs($meta) - { - $cfgAttrs = StrHelper::parseList($meta['attrs'], array('|', ':')); - $attrs = array(); - foreach ($cfgAttrs as $cfgAttr) { - array_push($attrs, array( - 'attr_id' => $cfgAttr[0], - 'type' => $cfgAttr[1], - 'val' => $cfgAttr[2], - )); - } - return $attrs; - } - - public static function isBagItem($type, $subType) - { - return in_array($type, array( - self::GIFT_PACKAGE_TYPE, - self::FUNC_TYPE, - self::MATERIAL_TYPE, - self::FRAGMENT_TYPE, - 14, - self::FRAGMENT_BOX_TYPE, - self::CHEST_BOX_TYPE, - self::CRYSTAL_TYPE, - )); - } - - public static function getMetaListByType($type) - { - $metaList = array(); - foreach (self::getMetaList() as $meta){ - if ($meta['type'] == $type){ - array_push($metaList,$meta); - } - } - return $metaList; - } - - public static function isFragment($itemMeta) - { - return $itemMeta['type'] == self::FRAGMENT_TYPE; - } - - public static function groupFragment($tokenIds, &$heros, &$guns, &$specHeros, &$specGuns) - { - $heroItemIds = array( - 110110, - 110120, - 110130, - 110140, - 110150, - 110160, - 110170, - 110180 - ); - $gunItemIds = array( - 110210, - 110220, - 110230, - 110240, - 110250, - 110260, - 110270, - 110280 - ); - foreach ($tokenIds as $tokenId) { - if (in_array($tokenId, $heroItemIds)) { - array_push($heros, $tokenId); - } - if (in_array($tokenId, $gunItemIds)) { - array_push($guns, $tokenId); - } - switch ($tokenId) { - case 110100: - { - array_push($specHeros, $tokenId); - } - break; - case 110200: - { - array_push($specGuns, $tokenId); - } - break; - default: - { - } - } - } - $heros = array_unique($heros); - $guns = array_unique($guns); - } - - protected static function getMetaList() - { - if (!self::$metaList) { - self::$metaList = getMetaTable('item@item.php'); - } - return self::$metaList; - } - - protected static $metaList; - -} + $meta['id'], + 'price_info' => array( + 'cost_list' => array(), + 'discount_begin_time' => phpcommon\datetimeToTimestamp($meta['discount_begin']), + 'discount_end_time' => phpcommon\datetimeToTimestamp($meta['discount_end']) + ) + ); + $discount = splitStr1($meta['discount']); + if ($meta['gold'] > 0) { + array_push($info['price_info']['cost_list'], + array( + array( + 'item_id' => V_ITEM_GOLD, + 'item_num' => $meta['gold'], + 'discount' => count($discount) > 0 ? (int)$discount[0] : 0 + ))); + } + if ($meta['diamond'] > 0) { + array_push($info['price_info']['cost_list'], + array( + array( + 'item_id' => V_ITEM_DIAMOND, + 'item_num' => $meta['diamond'], + 'discount' => count($discount) > 1 ? (int)$discount[1] : 0 + ) + )); + } + return $info; + } + + public static function getCostItems($priceInfo, $costItemId) + { + $costGroup = null; + array_walk($priceInfo['cost_list'], function ($val) use(&$costGroup, $costItemId) { + if ($costGroup) { + return; + } + if (count($val) > 0 && $val[0]['item_id'] == $costItemId) { + $costGroup = $val; + return; + } + }); + if (!$costGroup) { + return null; + } + $costItems = array(); + array_walk($costGroup, function ($val) use (&$costItems, $priceInfo) { + if ($val['discount'] > 0 && + myself()->_getNowTime() >= $priceInfo['discount_begin_time'] && + myself()->_getNowTime() <= $priceInfo['discount_end_time'] + ) { + array_push($costItems, array( + 'item_id' => $val['item_id'], + 'item_num' => (int)($val['item_num'] * ($priceInfo['discount'] / 100)), + )); + } else { + array_push($costItems, array( + 'item_id' => $val['item_id'], + 'item_num' => $val['item_num'], + )); + } + }); + return $costItems; + } + + public static function getUseCostItems($itemMeta) + { + $costItems = array(); + foreach (splitStr2($itemMeta['use_cost']) as $arr) { + if (count($arr) >= 2) { + array_push($costItems, array( + 'item_id' => $arr[0], + 'item_num' => $arr[1] + )); + } + } + return $costItems; + } + + public static function isRandAttrItem($itemMeta) + { + return $itemMeta['type'] == self::MATERIAL_TYPE && + $itemMeta['sub_type'] == self::MATERIAL_CHIP_SUBTYPE; + } + + public static function isRoleChipItem($itemMeta) + { + return $itemMeta['type'] == self::CHIP_TYPE && + $itemMeta['sub_type'] == self::ROLE_CHIP_SUBTYPE; + } + + public static function isGunChipItem($itemMeta) + { + return $itemMeta['type'] == self::CHIP_TYPE && + $itemMeta['sub_type'] == self::GUN_CHIP_SUBTYPE; + } + + public static function getBaseAttrs($meta) + { + $cfgAttrs = StrHelper::parseList($meta['attrs'], array('|', ':')); + $attrs = array(); + foreach ($cfgAttrs as $cfgAttr) { + array_push($attrs, array( + 'attr_id' => $cfgAttr[0], + 'type' => $cfgAttr[1], + 'val' => $cfgAttr[2], + )); + } + return $attrs; + } + + public static function isBagItem($type, $subType) + { + return in_array($type, array( + self::GIFT_PACKAGE_TYPE, + self::FUNC_TYPE, + self::MATERIAL_TYPE, + self::FRAGMENT_TYPE, + 14, + self::FRAGMENT_BOX_TYPE, + self::CHEST_BOX_TYPE, + self::CRYSTAL_TYPE, + )); + } + + public static function getMetaListByType($type) + { + $metaList = array(); + foreach (self::getMetaList() as $meta){ + if ($meta['type'] == $type){ + array_push($metaList,$meta); + } + } + return $metaList; + } + + public static function isFragment($itemMeta) + { + return $itemMeta['type'] == self::FRAGMENT_TYPE; + } + + public static function groupFragment($tokenIds, &$heros, &$guns, &$specHeros, &$specGuns) + { + $heroItemIds = array( + 110110, + 110120, + 110130, + 110140, + 110150, + 110160, + 110170, + 110180 + ); + $gunItemIds = array( + 110210, + 110220, + 110230, + 110240, + 110250, + 110260, + 110270, + 110280 + ); + foreach ($tokenIds as $tokenId) { + if (in_array($tokenId, $heroItemIds)) { + array_push($heros, $tokenId); + } + if (in_array($tokenId, $gunItemIds)) { + array_push($guns, $tokenId); + } + switch ($tokenId) { + case 110100: + { + array_push($specHeros, $tokenId); + } + break; + case 110200: + { + array_push($specGuns, $tokenId); + } + break; + default: + { + } + } + } + $heros = array_unique($heros); + $guns = array_unique($guns); + } + + protected static function getMetaList() + { + if (!self::$metaList) { + self::$metaList = getMetaTable('item@item.php'); + } + return self::$metaList; + } + + protected static $metaList; + +}