2025-06-21 00:41:45 +03:00

87 lines
4.8 KiB
JavaScript

const BrawlClient = require("./Client/BrawlClient")
const Logger = require("./Utils/Logger")
const config = require("./Config/config")
const asciiArt = `
╔═══════════════════════════════════════════════════════════════╗
║ ║
║ ██████╗ ██████╗ ███████╗███╗ ██╗██████╗ ██████╗ █████╗ ║
║ ██╔═══██╗██╔══██╗██╔════╝████╗ ██║██╔══██╗██╔══██╗██╔══██╗ ║
║ ██║ ██║██████╔╝█████╗ ██╔██╗ ██║██████╔╝██████╔╝███████║ ║
║ ██║ ██║██╔═══╝ ██╔══╝ ██║╚██╗██║██╔══██╗██╔══██╗██╔══██║ ║
║ ╚██████╔╝██║ ███████╗██║ ╚████║██████╔╝██║ ██║██║ ██║ ║
║ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ║
║ ║
║ ██████╗ ██████╗ █████╗ ██╗ ██╗██╗ ██████╗ ║
║ ██╔══██╗██╔══██╗██╔══██╗██║ ██║██║ ██╔══██╗ ║
║ ██████╔╝██████╔╝███████║██║ █╗ ██║██║ ██████╔╝ ║
║ ██╔══██╗██╔══██╗██╔══██║██║███╗██║██║ ██╔═══╝ ║
║ ██████╔╝██║ ██║██║ ██║╚███╔███╔╝███████╗ ██║ ║
║ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚══╝╚══╝ ╚══════╝ ╚═╝ ║
║ ║
║ ██████╗ ██████╗ ██████╗ ██╗███████╗ ██████╗████████╗ ║
║ ██╔══██╗██╔══██╗██╔═══██╗ ██║██╔════╝██╔════╝╚══██╔══╝ ║
║ ██████╔╝██████╔╝██║ ██║ ██║█████╗ ██║ ██║ ║
║ ██╔═══╝ ██╔══██╗██║ ██║██ ██║██╔══╝ ██║ ██║ ║
║ ██║ ██║ ██║╚██████╔╝╚█████╔╝███████╗╚██████╗ ██║ ║
║ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚════╝ ╚══════╝ ╚═════╝ ╚═╝ ║
║ ║
╚═══════════════════════════════════════════════════════════════╝
`
async function main() {
console.log(asciiArt)
const logger = new Logger()
logger.info("🚀 Starting OpenBrawl Client...")
await sleep(500)
logger.info("📋 Loading configuration...")
await sleep(300)
logger.info("🔐 Initializing encryption...")
await sleep(400)
logger.info("🌐 Preparing network connection...")
await sleep(300)
logger.info("📦 Loading protocol handlers...")
await sleep(400)
logger.success("✅ All systems ready!")
await sleep(200)
const readline = require("readline")
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
})
rl.question("🔑 Enter password: ", (password) => {
if (password === "openproject") {
logger.success("🔓 Password correct! Starting client...")
rl.close()
const client = new BrawlClient(config, logger)
client.connect()
process.on("SIGINT", () => {
logger.info("\n👋 Shutting down client...")
client.disconnect()
process.exit(0)
})
} else {
logger.error("❌ Invalid password!")
rl.close()
process.exit(1)
}
})
}
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms))
}
main().catch(console.error)