diff --git a/.github/workflows/cd-discover-ids.yml b/.github/workflows/cd-discover-ids.yml index e63c6b4bf..6cb5e86b5 100644 --- a/.github/workflows/cd-discover-ids.yml +++ b/.github/workflows/cd-discover-ids.yml @@ -5,7 +5,7 @@ on: branches: main workflow_dispatch: schedule: - - cron: '0 8 * * *' + - cron: '0 */6 * * *' concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.vscode/settings.json b/.vscode/settings.json index ec47aeb32..2e258f686 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -95,6 +95,7 @@ "Minotauro", "MIPMAPCOUNT", "miĊĦek", + "mmnow", "modeltransform", "MURICA", "NEGATIVEX", diff --git a/scripts/discoverIds.ts b/scripts/discoverIds.ts index 9fadaf829..5d575deef 100644 --- a/scripts/discoverIds.ts +++ b/scripts/discoverIds.ts @@ -1,4 +1,4 @@ -import { chunk, times } from 'lodash'; +import { chunk, times, uniq } from 'lodash'; import { compress, decompress } from 'lz4js'; import { argv } from 'process'; import { REGIONS, Region } from '../src/constants/regions'; @@ -136,10 +136,10 @@ function post() { clearInterval(interval); console.log(`Uploading ${ids.length} ids...`); - const idsSorted = ids.sort((a, b) => a - b); + const idsSorted = uniq(ids).sort((a, b) => a - b); const idsChunked = chunk(idsSorted, CHUNK_SIZE); const files = idsChunked.map((ids, chunk) => { - const didsWriteStream = new DidsWriteStream().dids(idsSorted); + const didsWriteStream = new DidsWriteStream().dids(ids); const compressed = compress(didsWriteStream.uint8Array); const content = Buffer.from(compressed).toString('base64'); diff --git a/src/app/tools/tankopedia/map/page.tsx b/src/app/tools/tankopedia/map/page.tsx index 4ba249137..0f55246cb 100644 --- a/src/app/tools/tankopedia/map/page.tsx +++ b/src/app/tools/tankopedia/map/page.tsx @@ -2,7 +2,6 @@ import { Flex, Link } from '@radix-ui/themes'; import { use } from 'react'; -import { AdHorizontal } from '../../../../components/Ads/Horizontal'; import PageWrapper from '../../../../components/PageWrapper'; import { tankDefinitions } from '../../../../core/blitzkit/tankDefinitions'; @@ -13,8 +12,6 @@ export default function Page() { Super duper secret map for SEO - - {Object.values(awaitedTankDefinitions) .sort((a, b) => b.tier - a.tier) diff --git a/src/app/tools/tankopedia/page.tsx b/src/app/tools/tankopedia/page.tsx index a2cb744af..a6b4a70b2 100644 --- a/src/app/tools/tankopedia/page.tsx +++ b/src/app/tools/tankopedia/page.tsx @@ -1,8 +1,10 @@ 'use client'; import { Flex } from '@radix-ui/themes'; +import { times } from 'lodash'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; +import { Ad, AdType } from '../../../components/Ad'; import PageWrapper from '../../../components/PageWrapper'; import { TankSearch } from './components/TankSearch'; @@ -17,6 +19,12 @@ export default function Page() { }} /> + + {times(2, () => ( + + ))} + + Super duper secret map diff --git a/src/components/Ad.tsx b/src/components/Ad.tsx new file mode 100644 index 000000000..d303ee603 --- /dev/null +++ b/src/components/Ad.tsx @@ -0,0 +1,21 @@ +'use client'; + +import { ComponentProps, useEffect } from 'react'; + +export enum AdType { + TankopediaHorizontal800 = 738182777, +} + +interface AdProps extends ComponentProps<'div'> { + type: AdType; +} + +export function Ad({ type, ...props }: AdProps) { + useEffect(() => { + (window as any).msAdsQueue.push(function () { + (window as any).mmnow.render({ adUnitId: type, elementId: type }); + }); + }); + + return
; +} diff --git a/src/components/Ads/Horizontal.tsx b/src/components/Ads/Horizontal.tsx deleted file mode 100644 index 4a66a4dcb..000000000 --- a/src/components/Ads/Horizontal.tsx +++ /dev/null @@ -1,24 +0,0 @@ -export function AdHorizontal() { - return ( - <> -