mirror of
https://github.com/minescope/mineping.git
synced 2025-07-13 10:14:35 +03:00
refactoring and comments
fix(cli.js): refactor help and error handling logic for better readability and maintainability feat(cli.js): add support for custom port and timeout options fix(parallel.js): update list of hosts to ping fix(bedrock.js): add comments and improve error handling in ping function fix(java.js): add comments and improve error handling in ping function fix(varint.js): add comments to functions and improve readability fix(index.d.ts): export all functions from java.js and bedrock.js fix(lib/bedrock.d.ts): update source link fix(lib/java.d.ts): update source link
This commit is contained in:
@ -1,10 +1,19 @@
|
||||
import { pingBedrock } from '../index.js';
|
||||
|
||||
const [thehive, oasys, frizmine, breadix] = await Promise.allSettled([
|
||||
pingBedrock('geo.hivebedrock.network'),
|
||||
pingBedrock('oasys-pe.com'),
|
||||
pingBedrock('frizmine.ru'),
|
||||
pingBedrock('play.breadixpe.ru')
|
||||
]);
|
||||
const hosts = [
|
||||
'play.timecrack.net',
|
||||
'geo.hivebedrock.network',
|
||||
'oasys-pe.com',
|
||||
'play.galaxite.net',
|
||||
];
|
||||
|
||||
console.dir({ thehive, oasys, frizmine, breadix }, { depth: 3 });
|
||||
const pingPromises = hosts.map(host => pingBedrock(host));
|
||||
const results = await Promise.allSettled(pingPromises);
|
||||
|
||||
for (let result of results) {
|
||||
if (result.status === 'rejected') {
|
||||
console.error(result.reason);
|
||||
}
|
||||
|
||||
console.log(result.value);
|
||||
}
|
Reference in New Issue
Block a user