mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: rename to cdon
This commit is contained in:
1 parent
901f1bfe42
commit
9cfa2357b0
12 files changed
+49
-49
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { asset } from './asset';
|
||||
import { fetchBkonLz4 } from './fetchBkonLz4';
|
||||
import { fetchCdonLz4 } from './fetchCdonLz4';
|
||||
|
||||
export type TankFilterDefinitionCategory = 'clip';
|
||||
|
||||
@@ -34,6 +34,6 @@ export interface ConsumableDefinitions {
|
||||
[key: string]: ConsumableEntry;
|
||||
}
|
||||
|
||||
export const consumableDefinitions = fetchBkonLz4<ConsumableDefinitions>(
|
||||
asset('definitions/consumables.bkon.lz4'),
|
||||
export const consumableDefinitions = fetchCdonLz4<ConsumableDefinitions>(
|
||||
asset('definitions/consumables.cdon.lz4'),
|
||||
);
|
||||
@@ -1,5 +1,5 @@
|
||||
import { asset } from './asset';
|
||||
import { fetchBkonLz4 } from './fetchBkonLz4';
|
||||
import { fetchCdonLz4 } from './fetchCdonLz4';
|
||||
|
||||
type EquipmentOptions = [number, number];
|
||||
|
||||
@@ -22,6 +22,6 @@ export interface EquipmentDefinitions {
|
||||
};
|
||||
}
|
||||
|
||||
export const equipmentDefinitions = fetchBkonLz4<EquipmentDefinitions>(
|
||||
asset('definitions/equipment.bkon.lz4'),
|
||||
export const equipmentDefinitions = fetchCdonLz4<EquipmentDefinitions>(
|
||||
asset('definitions/equipment.cdon.lz4'),
|
||||
);
|
||||
@@ -1,6 +1,6 @@
|
||||
import { superDecompress } from './superDecompress';
|
||||
|
||||
export async function fetchBkonLz4<Type>(url: string) {
|
||||
export async function fetchCdonLz4<Type>(url: string) {
|
||||
return await fetch(url, {
|
||||
cache: 'no-cache',
|
||||
}).then(async (response) => {
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Vector3Tuple } from 'three';
|
||||
import { asset } from './asset';
|
||||
import { fetchBkonLz4 } from './fetchBkonLz4';
|
||||
import { fetchCdonLz4 } from './fetchCdonLz4';
|
||||
|
||||
export type ModelDefinitions = Record<number, ModelDefinition>;
|
||||
|
||||
@@ -54,6 +54,6 @@ export interface PitchLimits {
|
||||
transition?: number;
|
||||
}
|
||||
|
||||
export const modelDefinitions = fetchBkonLz4<ModelDefinitions>(
|
||||
asset('definitions/models.bkon.lz4'),
|
||||
export const modelDefinitions = fetchCdonLz4<ModelDefinitions>(
|
||||
asset('definitions/models.cdon.lz4'),
|
||||
);
|
||||
@@ -1,6 +1,6 @@
|
||||
import { asset } from './asset';
|
||||
import { TankFilterDefinition } from './consumableDefinitions';
|
||||
import { fetchBkonLz4 } from './fetchBkonLz4';
|
||||
import { fetchCdonLz4 } from './fetchCdonLz4';
|
||||
|
||||
export interface ProvisionEntry {
|
||||
id: number;
|
||||
@@ -14,6 +14,6 @@ export interface ProvisionDefinitions {
|
||||
[key: string]: ProvisionEntry;
|
||||
}
|
||||
|
||||
export const provisionDefinitions = fetchBkonLz4<ProvisionDefinitions>(
|
||||
asset('definitions/provisions.bkon.lz4'),
|
||||
export const provisionDefinitions = fetchCdonLz4<ProvisionDefinitions>(
|
||||
asset('definitions/provisions.cdon.lz4'),
|
||||
);
|
||||
@@ -1,8 +1,8 @@
|
||||
import { compress } from 'lz4js';
|
||||
import { BkonWriteStream } from '../streams/bkon';
|
||||
import { CdonWriteStream } from '../streams/cdon';
|
||||
|
||||
export function superCompress(object: any) {
|
||||
const write = new BkonWriteStream().bkon(object);
|
||||
const write = new CdonWriteStream().cdon(object);
|
||||
const compressed = compress(write.buffer);
|
||||
return Buffer.from(compressed).toString('base64');
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
import { decompress } from 'lz4js';
|
||||
import { BkonReadStream } from '../streams/bkon';
|
||||
import { CdonReadStream } from '../streams/cdon';
|
||||
|
||||
export function superDecompress<Type>(buffer: Buffer) {
|
||||
const decompressed = Buffer.from(decompress(buffer));
|
||||
const read = new BkonReadStream(decompressed);
|
||||
return read.bkon() as Type;
|
||||
const read = new CdonReadStream(decompressed);
|
||||
return read.cdon() as Type;
|
||||
}
|
||||
@@ -2,7 +2,7 @@ import { deburr } from 'lodash';
|
||||
import { Vector2Tuple } from 'three';
|
||||
import { TankType, TreeType } from '../../components/Tanks';
|
||||
import { asset } from './asset';
|
||||
import { fetchBkonLz4 } from './fetchBkonLz4';
|
||||
import { fetchCdonLz4 } from './fetchCdonLz4';
|
||||
|
||||
export type ShellType = 'ap' | 'ap_cr' | 'hc' | 'he';
|
||||
|
||||
@@ -118,8 +118,8 @@ export const GUN_TYPE_NAMES: Record<GunDefinition['type'], string> = {
|
||||
autoReloader: 'Auto reloader',
|
||||
};
|
||||
|
||||
export const tankDefinitions = fetchBkonLz4<TankDefinitions>(
|
||||
asset('definitions/tanks.bkon.lz4'),
|
||||
export const tankDefinitions = fetchCdonLz4<TankDefinitions>(
|
||||
asset('definitions/tanks.cdon.lz4'),
|
||||
);
|
||||
|
||||
const entries = new Promise<TankDefinition[]>(async (resolve) => {
|
||||
|
||||
Reference in new issue
Block a user