From dd00406fcd3e6b43297425f92bb0db7b1088910f Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 26 Jun 2024 16:44:23 +0800 Subject: [PATCH 1/5] 1 --- sql/gamedb.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/gamedb.sql b/sql/gamedb.sql index 5db510a2..bd34c2eb 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -171,6 +171,7 @@ CREATE TABLE `t_hero` ( `active_count` int(11) NOT NULL DEFAULT '0' COMMENT 'active_count', `activate` int(11) NOT NULL DEFAULT '0' COMMENT '是否激活 1:已初始激活', `activate_time` int(11) NOT NULL DEFAULT '0' COMMENT '激活时间', + `on_chain_time` int(11) NOT NULL DEFAULT '0' COMMENT '上链时间', `wealth_attr` mediumblob COMMENT '财富值属性', `seal_type` int(11) NOT NULL DEFAULT '0' COMMENT '0:未封存 1:已封存', `unseal_time` int(11) NOT NULL DEFAULT '0' COMMENT '解开封时间', From 5d72282d745c4f611e9ee18927b291baa8d60918 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 26 Jun 2024 17:43:17 +0800 Subject: [PATCH 2/5] 1 --- webapp/controller/BlockChainController.class.php | 4 ++++ webapp/controller/OutAppNftController.class.php | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/webapp/controller/BlockChainController.class.php b/webapp/controller/BlockChainController.class.php index 7ecb69d1..d87e09cd 100644 --- a/webapp/controller/BlockChainController.class.php +++ b/webapp/controller/BlockChainController.class.php @@ -129,6 +129,10 @@ class BlockChainController extends BaseAuthedController { myself()->_rspErr(1, 'hero not found'); return; } + if (!$heroDb['seal_type']) { + myself()->_rspErr(1, 'hero no seal'); + return; + } $isMint = true; $tokenId = $heroDb['token_id']; if ($heroDb['token_id'] && $heroDb['activate']) { diff --git a/webapp/controller/OutAppNftController.class.php b/webapp/controller/OutAppNftController.class.php index 1d393b09..e3ab0376 100644 --- a/webapp/controller/OutAppNftController.class.php +++ b/webapp/controller/OutAppNftController.class.php @@ -153,7 +153,7 @@ class OutAppNftController extends BaseController { $NftMeta = \mt\NftDesc::getByItemId($heroDb['hero_id']); $info['name'] = $heroMeta['name']; $info['description'] = $NftMeta['desc']; - $info['image'] = "https://res2.cebggame.com/nft/meta/".$heroDb['hero_id'].'_'.$heroDb['quality'].".gif"; + $info['image'] = "https://res2.counterfire.games/nft/meta/".$heroDb['hero_id'].'_'.$heroDb['quality'].".gif"; array_push($info['attributes'],array( "trait_type" => "level", "value" => intval($heroDb['hero_lv']), @@ -166,7 +166,7 @@ class OutAppNftController extends BaseController { $NftMeta = \mt\NftDesc::getByItemId($nftDb['item_id']); //$info['name'] = $heroMeta['name']; $info['description'] = $NftMeta['desc']; - $info['image'] = "https://res2.cebggame.com/nft/meta/".$nftDb['item_id'].".png"; + $info['image'] = "https://res2.counterfire.games/nft/meta/".$nftDb['item_id'].".png"; } break; } @@ -268,7 +268,7 @@ class OutAppNftController extends BaseController { $info['name'] = $heroMeta['name']; $info['item_id'] = $heroMeta['id']; $info['type'] = $nftDb['token_type']; - $info['image'] = 'https://res2.cebggame.com/nft/meta/' . $heroMeta['id'] . '_' . $heroDb['quality'] . '.gif'; + $info['image'] = 'https://res2.counterfire.games/nft/meta/' . $heroMeta['id'] . '_' . $heroDb['quality'] . '.gif'; $info['detail']['quality'] = $heroDb['quality']; $info['detail']['max_mining_days'] = $heroAtteMeta['validTime']; $info['detail']['wealth'] = floor($wealth * (1+$wealth_rate)); @@ -290,7 +290,7 @@ class OutAppNftController extends BaseController { $info['name'] = $itemMeta['name']; $info['item_id'] = $itemMeta['id']; $info['type'] = $nftDb['token_type']; - $info['image'] = 'https://res2.cebggame.com/nft/meta/' . $itemMeta['id'] . '.png'; + $info['image'] = 'https://res2.counterfire.games/nft/meta/' . $itemMeta['id'] . '.png'; $info['detail']['gold_coins'] = $this->getGoldBullionGoldNum($nftDb['item_id']); } } From 70a23fb4dcc89b8ba1318b522433b25ba48b5905 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 27 Jun 2024 11:00:44 +0800 Subject: [PATCH 3/5] 1 --- .../controller/OutAppNftController.class.php | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/webapp/controller/OutAppNftController.class.php b/webapp/controller/OutAppNftController.class.php index e3ab0376..b876dadd 100644 --- a/webapp/controller/OutAppNftController.class.php +++ b/webapp/controller/OutAppNftController.class.php @@ -159,6 +159,9 @@ class OutAppNftController extends BaseController { "value" => intval($heroDb['hero_lv']), "max_value" => 15, )); + if ($this->isCloseBox()) { + $this->fillBoxMeta($info); + } } break; case Nft::GOLD_BULLION_TYPE: @@ -167,6 +170,9 @@ class OutAppNftController extends BaseController { //$info['name'] = $heroMeta['name']; $info['description'] = $NftMeta['desc']; $info['image'] = "https://res2.counterfire.games/nft/meta/".$nftDb['item_id'].".png"; + if ($this->isCloseBox()) { + $this->fillBoxMeta($info); + } } break; } @@ -280,6 +286,9 @@ class OutAppNftController extends BaseController { $info['detail']['crit'] = $heroAbility['critical']; } } + if ($this->isCloseBox()) { + $this->fillBoxDetail($info); + } } break; case Nft::GOLD_BULLION_TYPE: @@ -293,6 +302,9 @@ class OutAppNftController extends BaseController { $info['image'] = 'https://res2.counterfire.games/nft/meta/' . $itemMeta['id'] . '.png'; $info['detail']['gold_coins'] = $this->getGoldBullionGoldNum($nftDb['item_id']); } + if ($this->isCloseBox()) { + $this->fillBoxDetail($info); + } } break; } @@ -318,4 +330,39 @@ class OutAppNftController extends BaseController { } } + private function isCloseBox() + { + $openTime = 1719828000; + if (myself()->_getNowTime() < $openTime) { + if (SERVER_ENV == _ONLINE) { + return true; + } + } + return false; + } + + private function fillBoxMeta(&$info) + { + $info['name'] = 'box'; + $info['description'] = 'box'; + $info['image'] = "https://res2.counterfire.games/nft/box/Gen2_raw.gif"; + $info['attributes'] = array(); + } + + private function fillBoxDetail(&$info) + { + $info = array( + 'net_id' => $info['net_id'], + 'contract_address' => $info['contract_address'], + 'token_id' => $info['token_id'], + 'owner_address' => $info['owner_address'], + 'meta_url' => $info['meta_url'], + 'name' => 'box', + 'item_id' => 0, + 'type' => $info['type'], + 'image' => "https://res2.counterfire.games/nft/box/Gen2_raw.gif", + 'detail' => array() + ); + } + } From 7c4272d681d8c4c0c07d442c33760d1bc4879a81 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 27 Jun 2024 11:52:55 +0800 Subject: [PATCH 4/5] 1 --- sql/bcnftdb.sql | 7 ++++++- sql/gamedb.sql | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/sql/bcnftdb.sql b/sql/bcnftdb.sql index cfd74f66..f897b0fb 100644 --- a/sql/bcnftdb.sql +++ b/sql/bcnftdb.sql @@ -157,11 +157,12 @@ CREATE TABLE `t_order` ( `token_id` varchar(60) NOT NULL DEFAULT '' COMMENT 'token_id', `contract_address` varchar(60) NOT NULL DEFAULT '' COMMENT 'contract_address', `item_id` int(11) NOT NULL DEFAULT '0' COMMENT 'item_id', + `hero_quality` int(11) NOT NULL DEFAULT '0' COMMENT 'hero_quality', `price` varchar(60) NOT NULL DEFAULT '' COMMENT 'price', `start_time` int(11) NOT NULL DEFAULT '0' COMMENT 'start_time', `end_time` int(11) NOT NULL DEFAULT '0' COMMENT 'end_time', `created_at` int(11) NOT NULL DEFAULT '0' COMMENT 'created_at', - `update_at` int(11) NOT NULL DEFAULT '0' COMMENT 'update_at', + `updated_at` int(11) NOT NULL DEFAULT '0' COMMENT 'updated_at', `event_id` varchar(60) NOT NULL DEFAULT '' COMMENT '事件id', `event_data` mediumblob COMMENT '事件内容', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', @@ -189,6 +190,10 @@ CREATE TABLE `t_sale` ( `contract_address` varchar(60) NOT NULL DEFAULT '' COMMENT 'contract_address', `buyer` varchar(60) NOT NULL DEFAULT '' COMMENT 'buyer', `seller` varchar(60) NOT NULL DEFAULT '' COMMENT 'seller', + `item_id` int(11) NOT NULL DEFAULT '0' COMMENT 'item_id', + `hero_quality` int(11) NOT NULL DEFAULT '0' COMMENT 'hero_quality', + `price` varchar(60) NOT NULL DEFAULT '' COMMENT 'price', + `indexed_at` int(11) NOT NULL DEFAULT '0' COMMENT 'indexed_at', `event_id` varchar(60) NOT NULL DEFAULT '' COMMENT '事件id', `event_data` mediumblob COMMENT '事件内容', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', diff --git a/sql/gamedb.sql b/sql/gamedb.sql index 5db510a2..8a19fed9 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -1795,11 +1795,12 @@ CREATE TABLE `t_gold_bullion` ( `item_id` int(11) NOT NULL DEFAULT '0' COMMENT '道具id', `gold` bigint NOT NULL DEFAULT '0' COMMENT '金币', `status` int(11) NOT NULL DEFAULT '0' COMMENT '状态 0:初始 1:已开', - `open_status` int(11) NOT NULL DEFAULT '0' COMMENT '1: 已发送 2:未发送 3:已领取', + `open_status` int(11) NOT NULL DEFAULT '0' COMMENT '1: 已发送 2:已领取', `open_address` varchar(60) COMMENT 'open_address', `open_time` int(11) NOT NULL DEFAULT '0' COMMENT 'open_time', `open_account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)', `open_uniqid` varchar(60) NOT NULL DEFAULT '' COMMENT '开启的本次唯一id', + `return_status` int(11) NOT NULL DEFAULT '0' COMMENT '1: 已发送 2:已领取', `returned` int(11) NOT NULL DEFAULT '0' COMMENT '是否已超时返还', `return_time` int(11) NOT NULL DEFAULT '0' COMMENT '返还时间', `activated` int(11) NOT NULL DEFAULT '0' COMMENT '是否已上连', From 74eaa601b8e078b10106bd5397d40bffce98764c Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 27 Jun 2024 19:35:55 +0800 Subject: [PATCH 5/5] 1 --- sql/bcnftdb.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sql/bcnftdb.sql b/sql/bcnftdb.sql index f897b0fb..0d002664 100644 --- a/sql/bcnftdb.sql +++ b/sql/bcnftdb.sql @@ -159,6 +159,10 @@ CREATE TABLE `t_order` ( `item_id` int(11) NOT NULL DEFAULT '0' COMMENT 'item_id', `hero_quality` int(11) NOT NULL DEFAULT '0' COMMENT 'hero_quality', `price` varchar(60) NOT NULL DEFAULT '' COMMENT 'price', + `src_price_exchange_rate` bigint(11) NOT NULL DEFAULT '0' COMMENT 'src_price_exchange_rate', + `src_price_amount` varchar(60) NOT NULL DEFAULT '' COMMENT 'src_price_amount', + `src_price_contract_address` varchar(60) NOT NULL DEFAULT '' COMMENT 'src_price_contract_address', + `src_price_item_type` varchar(60) NOT NULL DEFAULT '' COMMENT 'src_price_item_type', `start_time` int(11) NOT NULL DEFAULT '0' COMMENT 'start_time', `end_time` int(11) NOT NULL DEFAULT '0' COMMENT 'end_time', `created_at` int(11) NOT NULL DEFAULT '0' COMMENT 'created_at', @@ -170,6 +174,12 @@ CREATE TABLE `t_order` ( PRIMARY KEY (`idx`), UNIQUE KEY `idx_net_id_contract_address_token_id` (`net_id`, `contract_address`, `token_id`), KEY `idx_status` (`status`), + KEY `idx_item_id` (`item_id`), + KEY `idx_hero_quality` (`hero_quality`), + KEY `idx_price` (`price`), + KEY `idx_event_id` (`event_id`), + KEY `idx_contract_address` (`contract_address`), + KEY `idx_token_id` (`token_id`), KEY `idx_order_id` (`order_id`) ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; /*!40101 SET character_set_client = @saved_cs_client */;