This commit is contained in:
Bill 2021-02-23 13:58:56 -05:00
parent 066a2c5ac3
commit b45890d589
9 changed files with 19 additions and 22 deletions

View File

@ -3,12 +3,9 @@ import { container } from 'tsyringe';
import { Configuration } from './common/config/Configuration';
import { IConverter } from './common/converters/IConverter';
import { EffectConverter } from './converters/effect/EffectConverter';
import { EffectMapConverter } from './converters/effectmap/EffectMapConverter';
import { ExternalTextsConverter } from './converters/externaltexts/ExternalTextsConverter';
import { FigureConverter } from './converters/figure/FigureConverter';
import { FigureMapConverter } from './converters/figuremap/FigureMapConverter';
import { FurnitureConverter } from './converters/furniture/FurnitureConverter';
import { FurnitureDataConverter } from './converters/furnituredata/FurnitureDataConverter';
import { PetConverter } from './converters/pet/PetConverter';
import { ProductDataConverter } from './converters/productdata/ProductDataConverter';
@ -18,9 +15,6 @@ import { ProductDataConverter } from './converters/productdata/ProductDataConver
await config.init();
const converters = [
FigureMapConverter,
EffectMapConverter,
FurnitureDataConverter,
ProductDataConverter,
ExternalTextsConverter,
FigureConverter,

View File

@ -12,13 +12,10 @@
"dynamic.download.furniture.url": "${flash.dynamic.download.url}%revision%/%className%.swf",
"external.variables.url": "https://www.habbo.com/gamedata/external_variables/1",
"external.texts.url": "${external.texts.txt}",
"convert.furnituredata": "1",
"convert.productdata": "1",
"convert.figuremap": "1",
"convert.effectmap": "1",
"convert.externaltexts": "1",
"convert.figure": "1",
"convert.effect": "1",
"convert.furniture": "1",
"convert.pet": "1"
"convert.productdata": "0",
"convert.externaltexts": "0",
"convert.figure": "0",
"convert.effect": "0",
"convert.furniture": "0",
"convert.pet": "0"
}

View File

@ -5,6 +5,7 @@ import { HabboAssetSWF } from '../../swf/HabboAssetSWF';
import File from '../../utils/File';
import { FileUtilities } from '../../utils/FileUtilities';
import { Logger } from '../../utils/Logger';
import { EffectConverter } from './EffectConverter';
@singleton()
export class EffectDownloader
@ -12,12 +13,15 @@ export class EffectDownloader
public static EFFECT_TYPES: Map<string, string> = new Map();
constructor(
private readonly _effectConverter: EffectConverter,
private readonly _configuration: Configuration,
private readonly _logger: Logger)
{}
public async download(directory: File, callback: (habboAssetSwf: HabboAssetSWF, className: string) => Promise<void>): Promise<void>
{
await this._effectConverter.convertAsync();
const effectMap = await this.parseEffectMap();
const classNames: string[] = [];

View File

@ -23,8 +23,6 @@ export class EffectMapConverter extends Converter
public async convertAsync(): Promise<void>
{
if(!this._configuration.getBoolean('convert.effectmap')) return;
const now = Date.now();
const spinner = ora('Preparing EffectMap').start();

View File

@ -5,6 +5,7 @@ import { HabboAssetSWF } from '../../swf/HabboAssetSWF';
import File from '../../utils/File';
import { FileUtilities } from '../../utils/FileUtilities';
import { Logger } from '../../utils/Logger';
import { FigureConverter } from './FigureConverter';
@singleton()
export class FigureDownloader
@ -12,12 +13,15 @@ export class FigureDownloader
public static FIGURE_TYPES: Map<string, string> = new Map();
constructor(
private readonly _figureConverter: FigureConverter,
private readonly _configuration: Configuration,
private readonly _logger: Logger)
{}
public async download(directory: File, callback: (habboAssetSwf: HabboAssetSWF, className: string) => Promise<void>): Promise<void>
{
await this._figureConverter.convertAsync();
const figureMap = await this.parseFigureMap();
const classNames: string[] = [];

View File

@ -23,8 +23,6 @@ export class FigureMapConverter extends Converter
public async convertAsync(): Promise<void>
{
if(!this._configuration.getBoolean('convert.figuremap')) return;
const now = Date.now();
const spinner = ora('Preparing FigureMap').start();

View File

@ -5,17 +5,21 @@ import { HabboAssetSWF } from '../../swf/HabboAssetSWF';
import File from '../../utils/File';
import { FileUtilities } from '../../utils/FileUtilities';
import { Logger } from '../../utils/Logger';
import { FurnitureDataConverter } from '../furnituredata/FurnitureDataConverter';
@singleton()
export class FurnitureDownloader
{
constructor(
private readonly _furnitureDataConverter: FurnitureDataConverter,
private readonly _configuration: Configuration,
private readonly _logger: Logger)
{}
public async download(directory: File, callback: (habboAssetSwf: HabboAssetSWF, className: string) => Promise<void>): Promise<void>
{
this._furnitureDataConverter.convertAsync();
const furniData = await this.parseFurniData();
if(!furniData) throw new Error('invalid_furnidata');

View File

@ -23,8 +23,6 @@ export class FurnitureDataConverter extends Converter
public async convertAsync(): Promise<void>
{
if(!this._configuration.getBoolean('convert.furnituredata')) return;
const now = Date.now();
const spinner = ora('Preparing FurnitureData').start();

View File

@ -34,7 +34,7 @@ export class FurnitureDataXML
if(furniTypes !== undefined)
{
if(Array.isArray(furniTypes)) for(const furniType in furniTypes) this._wallItems.push(new FurnitureTypeXML('wall', furniType));
if(Array.isArray(furniTypes)) for(const furniType of furniTypes) this._wallItems.push(new FurnitureTypeXML('wall', furniType));
}
}
}