mirror of
https://github.com/billsonnn/nitro-converter.git
synced 2024-11-26 17:30:52 +01:00
Fix bugs
This commit is contained in:
parent
066a2c5ac3
commit
b45890d589
@ -3,12 +3,9 @@ import { container } from 'tsyringe';
|
|||||||
import { Configuration } from './common/config/Configuration';
|
import { Configuration } from './common/config/Configuration';
|
||||||
import { IConverter } from './common/converters/IConverter';
|
import { IConverter } from './common/converters/IConverter';
|
||||||
import { EffectConverter } from './converters/effect/EffectConverter';
|
import { EffectConverter } from './converters/effect/EffectConverter';
|
||||||
import { EffectMapConverter } from './converters/effectmap/EffectMapConverter';
|
|
||||||
import { ExternalTextsConverter } from './converters/externaltexts/ExternalTextsConverter';
|
import { ExternalTextsConverter } from './converters/externaltexts/ExternalTextsConverter';
|
||||||
import { FigureConverter } from './converters/figure/FigureConverter';
|
import { FigureConverter } from './converters/figure/FigureConverter';
|
||||||
import { FigureMapConverter } from './converters/figuremap/FigureMapConverter';
|
|
||||||
import { FurnitureConverter } from './converters/furniture/FurnitureConverter';
|
import { FurnitureConverter } from './converters/furniture/FurnitureConverter';
|
||||||
import { FurnitureDataConverter } from './converters/furnituredata/FurnitureDataConverter';
|
|
||||||
import { PetConverter } from './converters/pet/PetConverter';
|
import { PetConverter } from './converters/pet/PetConverter';
|
||||||
import { ProductDataConverter } from './converters/productdata/ProductDataConverter';
|
import { ProductDataConverter } from './converters/productdata/ProductDataConverter';
|
||||||
|
|
||||||
@ -18,9 +15,6 @@ import { ProductDataConverter } from './converters/productdata/ProductDataConver
|
|||||||
await config.init();
|
await config.init();
|
||||||
|
|
||||||
const converters = [
|
const converters = [
|
||||||
FigureMapConverter,
|
|
||||||
EffectMapConverter,
|
|
||||||
FurnitureDataConverter,
|
|
||||||
ProductDataConverter,
|
ProductDataConverter,
|
||||||
ExternalTextsConverter,
|
ExternalTextsConverter,
|
||||||
FigureConverter,
|
FigureConverter,
|
||||||
|
@ -12,13 +12,10 @@
|
|||||||
"dynamic.download.furniture.url": "${flash.dynamic.download.url}%revision%/%className%.swf",
|
"dynamic.download.furniture.url": "${flash.dynamic.download.url}%revision%/%className%.swf",
|
||||||
"external.variables.url": "https://www.habbo.com/gamedata/external_variables/1",
|
"external.variables.url": "https://www.habbo.com/gamedata/external_variables/1",
|
||||||
"external.texts.url": "${external.texts.txt}",
|
"external.texts.url": "${external.texts.txt}",
|
||||||
"convert.furnituredata": "1",
|
"convert.productdata": "0",
|
||||||
"convert.productdata": "1",
|
"convert.externaltexts": "0",
|
||||||
"convert.figuremap": "1",
|
"convert.figure": "0",
|
||||||
"convert.effectmap": "1",
|
"convert.effect": "0",
|
||||||
"convert.externaltexts": "1",
|
"convert.furniture": "0",
|
||||||
"convert.figure": "1",
|
"convert.pet": "0"
|
||||||
"convert.effect": "1",
|
|
||||||
"convert.furniture": "1",
|
|
||||||
"convert.pet": "1"
|
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import { HabboAssetSWF } from '../../swf/HabboAssetSWF';
|
|||||||
import File from '../../utils/File';
|
import File from '../../utils/File';
|
||||||
import { FileUtilities } from '../../utils/FileUtilities';
|
import { FileUtilities } from '../../utils/FileUtilities';
|
||||||
import { Logger } from '../../utils/Logger';
|
import { Logger } from '../../utils/Logger';
|
||||||
|
import { EffectConverter } from './EffectConverter';
|
||||||
|
|
||||||
@singleton()
|
@singleton()
|
||||||
export class EffectDownloader
|
export class EffectDownloader
|
||||||
@ -12,12 +13,15 @@ export class EffectDownloader
|
|||||||
public static EFFECT_TYPES: Map<string, string> = new Map();
|
public static EFFECT_TYPES: Map<string, string> = new Map();
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
private readonly _effectConverter: EffectConverter,
|
||||||
private readonly _configuration: Configuration,
|
private readonly _configuration: Configuration,
|
||||||
private readonly _logger: Logger)
|
private readonly _logger: Logger)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
public async download(directory: File, callback: (habboAssetSwf: HabboAssetSWF, className: string) => Promise<void>): Promise<void>
|
public async download(directory: File, callback: (habboAssetSwf: HabboAssetSWF, className: string) => Promise<void>): Promise<void>
|
||||||
{
|
{
|
||||||
|
await this._effectConverter.convertAsync();
|
||||||
|
|
||||||
const effectMap = await this.parseEffectMap();
|
const effectMap = await this.parseEffectMap();
|
||||||
const classNames: string[] = [];
|
const classNames: string[] = [];
|
||||||
|
|
||||||
|
@ -23,8 +23,6 @@ export class EffectMapConverter extends Converter
|
|||||||
|
|
||||||
public async convertAsync(): Promise<void>
|
public async convertAsync(): Promise<void>
|
||||||
{
|
{
|
||||||
if(!this._configuration.getBoolean('convert.effectmap')) return;
|
|
||||||
|
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
|
|
||||||
const spinner = ora('Preparing EffectMap').start();
|
const spinner = ora('Preparing EffectMap').start();
|
||||||
|
@ -5,6 +5,7 @@ import { HabboAssetSWF } from '../../swf/HabboAssetSWF';
|
|||||||
import File from '../../utils/File';
|
import File from '../../utils/File';
|
||||||
import { FileUtilities } from '../../utils/FileUtilities';
|
import { FileUtilities } from '../../utils/FileUtilities';
|
||||||
import { Logger } from '../../utils/Logger';
|
import { Logger } from '../../utils/Logger';
|
||||||
|
import { FigureConverter } from './FigureConverter';
|
||||||
|
|
||||||
@singleton()
|
@singleton()
|
||||||
export class FigureDownloader
|
export class FigureDownloader
|
||||||
@ -12,12 +13,15 @@ export class FigureDownloader
|
|||||||
public static FIGURE_TYPES: Map<string, string> = new Map();
|
public static FIGURE_TYPES: Map<string, string> = new Map();
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
private readonly _figureConverter: FigureConverter,
|
||||||
private readonly _configuration: Configuration,
|
private readonly _configuration: Configuration,
|
||||||
private readonly _logger: Logger)
|
private readonly _logger: Logger)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
public async download(directory: File, callback: (habboAssetSwf: HabboAssetSWF, className: string) => Promise<void>): Promise<void>
|
public async download(directory: File, callback: (habboAssetSwf: HabboAssetSWF, className: string) => Promise<void>): Promise<void>
|
||||||
{
|
{
|
||||||
|
await this._figureConverter.convertAsync();
|
||||||
|
|
||||||
const figureMap = await this.parseFigureMap();
|
const figureMap = await this.parseFigureMap();
|
||||||
const classNames: string[] = [];
|
const classNames: string[] = [];
|
||||||
|
|
||||||
|
@ -23,8 +23,6 @@ export class FigureMapConverter extends Converter
|
|||||||
|
|
||||||
public async convertAsync(): Promise<void>
|
public async convertAsync(): Promise<void>
|
||||||
{
|
{
|
||||||
if(!this._configuration.getBoolean('convert.figuremap')) return;
|
|
||||||
|
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
|
|
||||||
const spinner = ora('Preparing FigureMap').start();
|
const spinner = ora('Preparing FigureMap').start();
|
||||||
|
@ -5,17 +5,21 @@ import { HabboAssetSWF } from '../../swf/HabboAssetSWF';
|
|||||||
import File from '../../utils/File';
|
import File from '../../utils/File';
|
||||||
import { FileUtilities } from '../../utils/FileUtilities';
|
import { FileUtilities } from '../../utils/FileUtilities';
|
||||||
import { Logger } from '../../utils/Logger';
|
import { Logger } from '../../utils/Logger';
|
||||||
|
import { FurnitureDataConverter } from '../furnituredata/FurnitureDataConverter';
|
||||||
|
|
||||||
@singleton()
|
@singleton()
|
||||||
export class FurnitureDownloader
|
export class FurnitureDownloader
|
||||||
{
|
{
|
||||||
constructor(
|
constructor(
|
||||||
|
private readonly _furnitureDataConverter: FurnitureDataConverter,
|
||||||
private readonly _configuration: Configuration,
|
private readonly _configuration: Configuration,
|
||||||
private readonly _logger: Logger)
|
private readonly _logger: Logger)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
public async download(directory: File, callback: (habboAssetSwf: HabboAssetSWF, className: string) => Promise<void>): Promise<void>
|
public async download(directory: File, callback: (habboAssetSwf: HabboAssetSWF, className: string) => Promise<void>): Promise<void>
|
||||||
{
|
{
|
||||||
|
this._furnitureDataConverter.convertAsync();
|
||||||
|
|
||||||
const furniData = await this.parseFurniData();
|
const furniData = await this.parseFurniData();
|
||||||
|
|
||||||
if(!furniData) throw new Error('invalid_furnidata');
|
if(!furniData) throw new Error('invalid_furnidata');
|
||||||
|
@ -23,8 +23,6 @@ export class FurnitureDataConverter extends Converter
|
|||||||
|
|
||||||
public async convertAsync(): Promise<void>
|
public async convertAsync(): Promise<void>
|
||||||
{
|
{
|
||||||
if(!this._configuration.getBoolean('convert.furnituredata')) return;
|
|
||||||
|
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
|
|
||||||
const spinner = ora('Preparing FurnitureData').start();
|
const spinner = ora('Preparing FurnitureData').start();
|
||||||
|
@ -34,7 +34,7 @@ export class FurnitureDataXML
|
|||||||
|
|
||||||
if(furniTypes !== undefined)
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user