From 49485bb1e5634289125bba8139b8e6a322df51e1 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 26 Jul 2024 17:43:10 +0800 Subject: [PATCH] 1 --- .../controller/OutAppNftController.class.php | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/webapp/controller/OutAppNftController.class.php b/webapp/controller/OutAppNftController.class.php index 23edfbdc..7c1e5301 100644 --- a/webapp/controller/OutAppNftController.class.php +++ b/webapp/controller/OutAppNftController.class.php @@ -181,11 +181,17 @@ class OutAppNftController extends BaseController { $info['token_id'] = $tokenId; $info['name'] = $heroMeta['name']; $info['description'] = $NftMeta['desc']; - $info['image'] = "https://res2.counterfire.games/nft/meta/". - $heroDb['hero_id'].'_'.$this->getRealHeroQuality($heroDb).".gif"; + if ($nftDb['token_type'] == Nft::GCARD_HERO_TYPE) { + $info['image'] = 'https://res2.counterfire.games/nft/video/normal/' . $heroMeta['id'] . '_c' . $this->getRealHeroQuality($heroDb) . '.mp4'; + } else { + $info['image'] = 'https://res2.counterfire.games/nft/video/genesis/' . $heroMeta['id'] . '_' . $this->getRealHeroQuality($heroDb) . '.mp4'; + } + if ($this->isWingHero($nftDb['token_id'])) { + $info['image'] = 'https://res2.counterfire.games/nft/video/wing/' . $heroMeta['id'] . '_w' . $this->getRealHeroQuality($heroDb) . '.mp4'; + } $info['animation_url'] = "https://res.counterfire.games/nft/video/". $heroDb['hero_id'].'_'.$this->getRealHeroQuality($heroDb).".mp4"; - if ($info['token_id'] > 6240603010001668 && $info['token_id'] <= 6240603010002168){ + if ($this->isWingHero($nftDb['token_id'])) { $info['animation_url'] = "https://res.counterfire.games/nft/video/wing/". $heroDb['hero_id'].'_w'.$this->getRealHeroQuality($heroDb).".mp4"; } @@ -329,7 +335,15 @@ class OutAppNftController extends BaseController { $info['name'] = $heroMeta['name']; $info['item_id'] = $heroMeta['id']; $info['type'] = $nftDb['token_type']; - $info['image'] = 'https://res2.counterfire.games/nft/meta/' . $heroMeta['id'] . '_' . $this->getRealHeroQuality($heroDb) . '.gif'; + //$info['image'] = 'https://res2.counterfire.games/nft/meta/' . $heroMeta['id'] . '_' . $this->getRealHeroQuality($heroDb) . '.gif'; + if ($nftDb['token_type'] == Nft::GCARD_HERO_TYPE) { + $info['image'] = 'https://res2.counterfire.games/nft/video/normal/' . $heroMeta['id'] . '_c' . $this->getRealHeroQuality($heroDb) . '.mp4'; + } else { + $info['image'] = 'https://res2.counterfire.games/nft/video/genesis/' . $heroMeta['id'] . '_' . $this->getRealHeroQuality($heroDb) . '.mp4'; + } + if ($this->isWingHero($nftDb['token_id'])) { + $info['image'] = 'https://res2.counterfire.games/nft/video/wing/' . $heroMeta['id'] . '_w' . $this->getRealHeroQuality($heroDb) . '.mp4'; + } $info['detail']['quality'] = $this->getRealHeroQuality($heroDb); $info['detail']['max_mining_days'] = $heroAtteMeta['validTime']; $info['detail']['wealth'] = floor($wealth * (1+$wealth_rate)); @@ -528,7 +542,7 @@ class OutAppNftController extends BaseController { $info['name'] = $heroMeta['name']; $info['item_id'] = $heroMeta['id']; $info['type'] = Nft::HERO_TYPE; - $info['image'] = 'https://res2.counterfire.games/nft/meta/' . $heroMeta['id'] . '_' . $this->getRealHeroQuality($heroDb) . '.gif'; + $info['image'] = 'https://res2.counterfire.games/nft/video/normal/' . $heroMeta['id'] . '_c' . $this->getRealHeroQuality($heroDb) . '.mp4'; $info['detail']['quality'] = $this->getRealHeroQuality($heroDb); $info['detail']['max_mining_days'] = $heroAtteMeta['validTime']; $info['detail']['wealth'] = floor($wealth * (1+$wealth_rate)); @@ -544,4 +558,8 @@ class OutAppNftController extends BaseController { myself()->_rspData($rspData); } + private function isWingHero($tokenId) + { + return $tokenId > 6240603010001668 && $tokenId <= 6240603010002168 + } }