mirror of
https://github.com/billsonnn/nitro-converter.git
synced 2024-11-22 23:50:52 +01:00
Fix various download issues
This commit is contained in:
parent
27c8aa6728
commit
8f78267712
@ -12,10 +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.productdata": "0",
|
||||
"convert.externaltexts": "0",
|
||||
"convert.figure": "0",
|
||||
"convert.effect": "0",
|
||||
"convert.furniture": "0",
|
||||
"convert.pet": "0"
|
||||
"convert.productdata": "1",
|
||||
"convert.externaltexts": "1",
|
||||
"convert.figure": "1",
|
||||
"convert.effect": "1",
|
||||
"convert.furniture": "1",
|
||||
"convert.pet": "1"
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ export class EffectDownloader
|
||||
|
||||
const existingFile = new File(directory.path + '/' + className + '.nitro');
|
||||
|
||||
if(existingFile.isDirectory()) continue;
|
||||
if(existingFile.exists()) continue;
|
||||
|
||||
if(classNames.indexOf(className) >= 0) continue;
|
||||
|
||||
|
@ -22,6 +22,8 @@ export class EffectMapConverter extends Converter
|
||||
}
|
||||
|
||||
public async convertAsync(): Promise<void>
|
||||
{
|
||||
return new Promise((resolve, reject) =>
|
||||
{
|
||||
const now = Date.now();
|
||||
|
||||
@ -31,7 +33,7 @@ export class EffectMapConverter extends Converter
|
||||
|
||||
try
|
||||
{
|
||||
await this._effectMapDownloader.download(async (content: string) =>
|
||||
this._effectMapDownloader.download(async (content: string) =>
|
||||
{
|
||||
spinner.text = 'Parsing EffectMap';
|
||||
|
||||
@ -53,15 +55,20 @@ export class EffectMapConverter extends Converter
|
||||
await writeFile(path, effectMapString, 'utf8');
|
||||
|
||||
this._configuration.setValue('effectmap.load.url', path);
|
||||
});
|
||||
|
||||
spinner.succeed(`EffectMap finished in ${ Date.now() - now }ms`);
|
||||
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
|
||||
catch (error)
|
||||
{
|
||||
spinner.fail('EffectMap failed: ' + error.message);
|
||||
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private getDirectory(): File
|
||||
|
@ -23,6 +23,8 @@ export class ExternalTextsConverter extends Converter
|
||||
{
|
||||
if(!this._configuration.getBoolean('convert.externaltexts')) return;
|
||||
|
||||
return new Promise((resolve, reject) =>
|
||||
{
|
||||
const now = Date.now();
|
||||
|
||||
const spinner = ora('Preparing ExternalTexts').start();
|
||||
@ -31,7 +33,7 @@ export class ExternalTextsConverter extends Converter
|
||||
|
||||
try
|
||||
{
|
||||
await this._externalTextsDownloader.download(async (content: string) =>
|
||||
this._externalTextsDownloader.download(async (content: string) =>
|
||||
{
|
||||
spinner.text = 'Parsing ExternalTexts';
|
||||
|
||||
@ -49,15 +51,20 @@ export class ExternalTextsConverter extends Converter
|
||||
const path = directory.path + '/ExternalTexts.json';
|
||||
|
||||
await writeFile(path, externalTextsString, 'utf8');
|
||||
});
|
||||
|
||||
spinner.succeed(`ExternalTexts finished in ${ Date.now() - now }ms`);
|
||||
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
|
||||
catch (error)
|
||||
{
|
||||
spinner.fail('ExternalTexts failed: ' + error.message);
|
||||
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private getDirectory(): File
|
||||
|
@ -33,7 +33,7 @@ export class FigureDownloader
|
||||
|
||||
const existingFile = new File(directory.path + '/' + className + '.nitro');
|
||||
|
||||
if(existingFile.isDirectory()) continue;
|
||||
if(existingFile.exists()) continue;
|
||||
|
||||
if(className === 'hh_human_fx' || className === 'hh_pets') continue;
|
||||
|
||||
|
@ -22,6 +22,8 @@ export class FigureMapConverter extends Converter
|
||||
}
|
||||
|
||||
public async convertAsync(): Promise<void>
|
||||
{
|
||||
return new Promise((resolve, reject) =>
|
||||
{
|
||||
const now = Date.now();
|
||||
|
||||
@ -31,7 +33,7 @@ export class FigureMapConverter extends Converter
|
||||
|
||||
try
|
||||
{
|
||||
await this._figureMapDownloader.download(async (content: string) =>
|
||||
this._figureMapDownloader.download(async (content: string) =>
|
||||
{
|
||||
spinner.text = 'Parsing FigureMap';
|
||||
|
||||
@ -53,15 +55,20 @@ export class FigureMapConverter extends Converter
|
||||
await writeFile(path, figureMapString, 'utf8');
|
||||
|
||||
this._configuration.setValue('figuremap.load.url', path);
|
||||
});
|
||||
|
||||
spinner.succeed(`FigureMap finished in ${ Date.now() - now }ms`);
|
||||
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
|
||||
catch (error)
|
||||
{
|
||||
spinner.fail('FigureMap failed: ' + error.message);
|
||||
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private getDirectory(): File
|
||||
|
@ -37,7 +37,7 @@ export class FurnitureDownloader
|
||||
|
||||
const existingFile = new File(directory.path + '/' + className + '.nitro');
|
||||
|
||||
if(existingFile.isDirectory()) continue;
|
||||
if(existingFile.exists()) continue;
|
||||
|
||||
if(classNames.indexOf(className) >= 0) continue;
|
||||
|
||||
@ -68,7 +68,7 @@ export class FurnitureDownloader
|
||||
|
||||
const existingFile = new File(directory.path + '/' + className + '.nitro');
|
||||
|
||||
if(existingFile.isDirectory()) continue;
|
||||
if(existingFile.exists()) continue;
|
||||
|
||||
if(classNames.indexOf(className) >= 0) continue;
|
||||
|
||||
|
@ -22,6 +22,8 @@ export class FurnitureDataConverter extends Converter
|
||||
}
|
||||
|
||||
public async convertAsync(): Promise<void>
|
||||
{
|
||||
return new Promise((resolve, reject) =>
|
||||
{
|
||||
const now = Date.now();
|
||||
|
||||
@ -31,7 +33,7 @@ export class FurnitureDataConverter extends Converter
|
||||
|
||||
try
|
||||
{
|
||||
await this._furnitureDataDownloader.download(async (content: string) =>
|
||||
this._furnitureDataDownloader.download(async (content: string) =>
|
||||
{
|
||||
spinner.text = 'Parsing FurnitureData';
|
||||
|
||||
@ -53,15 +55,20 @@ export class FurnitureDataConverter extends Converter
|
||||
await writeFile(path, furnitureDataString, 'utf8');
|
||||
|
||||
this._configuration.setValue('furnidata.load.url', path);
|
||||
});
|
||||
|
||||
spinner.succeed(`FurnitureData finished in ${ Date.now() - now }ms`);
|
||||
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
|
||||
catch (error)
|
||||
{
|
||||
spinner.fail('FurnitureData failed: ' + error.message);
|
||||
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private getDirectory(): File
|
||||
|
@ -25,7 +25,7 @@ export class PetDownloader
|
||||
{
|
||||
const existingFile = new File(directory.path + '/' + petType + '.nitro');
|
||||
|
||||
if(existingFile.isDirectory()) continue;
|
||||
if(existingFile.exists()) continue;
|
||||
|
||||
if(classNames.indexOf(petType) >= 0) continue;
|
||||
|
||||
|
@ -23,6 +23,8 @@ export class ProductDataConverter extends Converter
|
||||
{
|
||||
if(!this._configuration.getBoolean('convert.productdata')) return;
|
||||
|
||||
return new Promise((resolve, reject) =>
|
||||
{
|
||||
const now = Date.now();
|
||||
|
||||
const spinner = ora('Preparing ProductData').start();
|
||||
@ -31,7 +33,7 @@ export class ProductDataConverter extends Converter
|
||||
|
||||
try
|
||||
{
|
||||
await this._productDataDownloader.download(async (content: string) =>
|
||||
this._productDataDownloader.download(async (content: string) =>
|
||||
{
|
||||
spinner.text = 'Parsing FurnitureData';
|
||||
|
||||
@ -49,15 +51,20 @@ export class ProductDataConverter extends Converter
|
||||
const path = directory.path + '/ProductData.json';
|
||||
|
||||
await writeFile(path, productDataString, 'utf8');
|
||||
});
|
||||
|
||||
spinner.succeed(`ProductData finished in ${ Date.now() - now }ms`);
|
||||
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
|
||||
catch (error)
|
||||
{
|
||||
spinner.fail('ProductData failed: ' + error.message);
|
||||
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private getDirectory(): File
|
||||
|
Loading…
Reference in New Issue
Block a user