Compare commits

..

24 Commits

Author SHA1 Message Date
55b9f063ba Обновлён README (В будущем планируется полностью его переписать убрав упоминания Helios)
Some checks failed
Build / release (macos-latest) (push) Has been cancelled
Build / release (ubuntu-latest) (push) Has been cancelled
Build / release (windows-latest) (push) Has been cancelled
2025-02-07 23:55:17 -08:00
SPAWNRYS
18e6fc67fb ЕБАЛ Я В РОТ АППЕЛ
Some checks failed
Build / release (macos-latest) (push) Has been cancelled
Build / release (ubuntu-latest) (push) Has been cancelled
Build / release (windows-latest) (push) Has been cancelled
2025-02-08 10:26:39 +03:00
SPAWNRYS
0d199038b6 Фикс иконки в папке build
Some checks are pending
Build / release (macos-latest) (push) Waiting to run
Build / release (ubuntu-latest) (push) Waiting to run
Build / release (windows-latest) (push) Waiting to run
2025-02-08 10:23:05 +03:00
SPAWNRYS
3f03fbc155 Подготовка для релиза
Some checks are pending
Build / release (macos-latest) (push) Waiting to run
Build / release (ubuntu-latest) (push) Waiting to run
Build / release (windows-latest) (push) Waiting to run
2025-02-08 10:17:55 +03:00
spawnrys
501addacbd Удалены некоторые упоминания HeliosLauncher, а так же изменена ссылка на distribution.json
Some checks are pending
Build / release (macos-latest) (push) Waiting to run
Build / release (ubuntu-latest) (push) Waiting to run
Build / release (windows-latest) (push) Waiting to run
2025-02-07 17:57:00 +03:00
Koshak_Mine
ec08d70b2b added translation for cracked login button
Some checks are pending
Build / release (macos-latest) (push) Waiting to run
Build / release (ubuntu-latest) (push) Waiting to run
Build / release (windows-latest) (push) Waiting to run
2025-02-07 00:54:52 +03:00
Koshak_Mine
b800af378d Added offline mode
Some checks are pending
Build / release (macos-latest) (push) Waiting to run
Build / release (ubuntu-latest) (push) Waiting to run
Build / release (windows-latest) (push) Waiting to run
2025-02-07 00:48:42 +03:00
SPAWNRYS
bc9db0247a Перевод лаунчера
Some checks are pending
Build / release (macos-latest) (push) Waiting to run
Build / release (ubuntu-latest) (push) Waiting to run
Build / release (windows-latest) (push) Waiting to run
2025-02-07 00:01:18 +03:00
Daniel Scalzi
e401608c33
Dependency upgrade. 2024-11-29 13:41:58 -05:00
Daniel Scalzi
6aaeeff9a4
Update comment. 2024-11-12 15:14:59 -05:00
Daniel Scalzi
9cca37ca8a
Fix issue with submodule library overrides. (#366) 2024-11-12 14:48:55 -05:00
Daniel Scalzi
03dac9ed6d
Electron 33, dependency upgrade. 2024-10-22 00:24:50 -04:00
Daniel Scalzi
eb683f89ec
Support 1.20.5, electron 30, dependency upgrade. 2024-04-28 17:35:19 -04:00
Daniel Scalzi
ae0e9e227d
2.2.1
CVE-2024-27303
2024-03-06 21:57:24 -05:00
Daniel Scalzi
dc15bbfde8
2.2.0 2024-02-22 11:50:18 -05:00
Daniel Scalzi
0d23f5c45b
Upgrade to Electron 29, Node.js 20. 2024-02-22 11:42:13 -05:00
Kamesuta
fc4823a01f
Localize Microsoft/Mojang authentication error messages (#331)
* Move Microsoft/Mojang error message to lang file.

* Add mstfLogin to language file
2024-02-22 11:23:23 -05:00
Daniel Scalzi
95eebc18a7
2.1.1 2024-01-04 19:09:30 -05:00
Daniel Scalzi
d03ff90f78
Remove mojang authserver as it has been permanently shut down. 2024-01-04 19:09:03 -05:00
Daniel Scalzi
258cd0d421
2.1.0 2023-12-03 18:06:25 -05:00
Daniel Scalzi
f65eb2f2d6
Dependency upgrade. 2023-12-03 18:05:47 -05:00
jebibot
fb1cb7b415
feat: support Fabric (#313)
* feat: support Fabric

* fix: GAME_LAUNCH_REGEX for Fabric

* Small refactor.

* Update documentation.

* Upgrade helios-distribution-types, helios-core.

---------

Co-authored-by: Daniel Scalzi <d_scalzi@yahoo.com>
2023-12-03 18:02:57 -05:00
Daniel Scalzi
9b898cc033
2.0.6 2023-11-25 19:09:40 -05:00
Daniel Scalzi
5a6217467a
Electron 27, dependency upgrade. 2023-11-25 18:58:34 -05:00
69 changed files with 6792 additions and 8813 deletions

View File

@ -52,15 +52,15 @@
}, },
"overrides": [ "overrides": [
{ {
"env": { "files": [ "app/assets/js/scripts/*.js" ],
"browser": true, "rules": {
"node": false, "no-unused-vars": [
"jquery": true 0
}, ],
"files": [ "no-undef": [
"app/assets/js/scripts/*.js", 0
"app/assets/js/renderer/*.js"
] ]
}
} }
] ]
} }

View File

@ -20,7 +20,7 @@ jobs:
- name: Set up Node - name: Set up Node
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: 20
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v4 uses: actions/setup-python@v4

2
.nvmrc
View File

@ -1 +1 @@
18 20

View File

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2017-2022 Daniel D. Scalzi Copyright (c) 2017-2024 Daniel D. Scalzi
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
<p align="center"><img src="./app/assets/images/SealCircle.png" width="150px" height="150px" alt="aventium softworks"></p> <p align="center"><img src="./app/assets/images/SealCircle.png" width="150px" height="150px" alt="aventium softworks"></p>
<h1 align="center">Helios Launcher</h1> <h1 align="center">ONIMAI.RU MC Launcher</h1>
<em><h5 align="center">(formerly Electron Launcher)</h5></em> <em><h5 align="center">(formerly Electron Launcher)</h5></em>
@ -84,7 +84,7 @@ This section details the setup of a basic developmentment environment.
**System Requirements** **System Requirements**
* [Node.js][nodejs] v18 * [Node.js][nodejs] v20
--- ---

View File

@ -2,10 +2,8 @@
<head> <head>
<meta charset="utf-8" http-equiv="Content-Security-Policy" content="script-src 'self' 'sha256-In6B8teKZQll5heMl9bS7CESTbGvuAt3VVV86BUQBDk='"/> <meta charset="utf-8" http-equiv="Content-Security-Policy" content="script-src 'self' 'sha256-In6B8teKZQll5heMl9bS7CESTbGvuAt3VVV86BUQBDk='"/>
<title><%= lang('app.title') %></title> <title><%= lang('app.title') %></title>
<!-- TODO FIXME --> <script src="./assets/js/scripts/uicore.js"></script>
<script src="../node_modules/jquery/dist/jquery.min.js"></script> <script src="./assets/js/scripts/uibinder.js"></script>
<!-- <script type="module" src="./assets/js/scripts/uicore.js"></script>
<script type="module" src="./assets/js/scripts/uibinder.js"></script> -->
<link type="text/css" rel="stylesheet" href="./assets/css/launcher.css"> <link type="text/css" rel="stylesheet" href="./assets/css/launcher.css">
<style> <style>
body { body {
@ -27,7 +25,6 @@
filter: blur(3px) contrast(0.9) brightness(1.0); filter: blur(3px) contrast(0.9) brightness(1.0);
} }
</style> </style>
<script type="module" src="./assets/js/renderer/megascript.js"></script>
</head> </head>
<body bkid="<%=bkid%>"> <body bkid="<%=bkid%>">
<%- include('frame') %> <%- include('frame') %>

View File

@ -1,9 +0,0 @@
import { api } from '../js/preloader.js'
declare global {
interface Window {
api: typeof api
}
}
export {};

View File

@ -388,6 +388,17 @@ body, button {
background: rgba(0, 0, 0, 0.50); background: rgba(0, 0, 0, 0.50);
} }
#loginOfflineContainer {
position: relative;
display: flex;
justify-content: center;
align-items: center;
height: 100%;
width: 100%;
transition: filter 0.25s ease;
background: rgba(0, 0, 0, 0.50);
}
/* Login cancel button styles. */ /* Login cancel button styles. */
#loginCancelContainer { #loginCancelContainer {
position: absolute; position: absolute;

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 KiB

After

Width:  |  Height:  |  Size: 604 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 KiB

After

Width:  |  Height:  |  Size: 781 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 502 KiB

After

Width:  |  Height:  |  Size: 311 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 268 KiB

After

Width:  |  Height:  |  Size: 343 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 456 KiB

After

Width:  |  Height:  |  Size: 500 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 MiB

After

Width:  |  Height:  |  Size: 580 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 MiB

After

Width:  |  Height:  |  Size: 312 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 30 KiB

View File

@ -12,12 +12,122 @@
const ConfigManager = require('./configmanager') const ConfigManager = require('./configmanager')
const { LoggerUtil } = require('helios-core') const { LoggerUtil } = require('helios-core')
const { RestResponseStatus } = require('helios-core/common') const { RestResponseStatus } = require('helios-core/common')
const { MojangRestAPI, mojangErrorDisplayable, MojangErrorCode } = require('helios-core/mojang') const { MojangRestAPI, MojangErrorCode } = require('helios-core/mojang')
const { MicrosoftAuth, microsoftErrorDisplayable, MicrosoftErrorCode } = require('helios-core/microsoft') const { MicrosoftAuth, MicrosoftErrorCode } = require('helios-core/microsoft')
const { AZURE_CLIENT_ID } = require('../ipcconstants') const { AZURE_CLIENT_ID } = require('./ipcconstants')
const Lang = require('./langloader')
const log = LoggerUtil.getLogger('AuthManager') const log = LoggerUtil.getLogger('AuthManager')
// Error messages
function microsoftErrorDisplayable(errorCode) {
switch (errorCode) {
case MicrosoftErrorCode.NO_PROFILE:
return {
title: Lang.queryJS('auth.microsoft.error.noProfileTitle'),
desc: Lang.queryJS('auth.microsoft.error.noProfileDesc')
}
case MicrosoftErrorCode.NO_XBOX_ACCOUNT:
return {
title: Lang.queryJS('auth.microsoft.error.noXboxAccountTitle'),
desc: Lang.queryJS('auth.microsoft.error.noXboxAccountDesc')
}
case MicrosoftErrorCode.XBL_BANNED:
return {
title: Lang.queryJS('auth.microsoft.error.xblBannedTitle'),
desc: Lang.queryJS('auth.microsoft.error.xblBannedDesc')
}
case MicrosoftErrorCode.UNDER_18:
return {
title: Lang.queryJS('auth.microsoft.error.under18Title'),
desc: Lang.queryJS('auth.microsoft.error.under18Desc')
}
case MicrosoftErrorCode.UNKNOWN:
return {
title: Lang.queryJS('auth.microsoft.error.unknownTitle'),
desc: Lang.queryJS('auth.microsoft.error.unknownDesc')
}
}
}
function mojangErrorDisplayable(errorCode) {
switch(errorCode) {
case MojangErrorCode.ERROR_METHOD_NOT_ALLOWED:
return {
title: Lang.queryJS('auth.mojang.error.methodNotAllowedTitle'),
desc: Lang.queryJS('auth.mojang.error.methodNotAllowedDesc')
}
case MojangErrorCode.ERROR_NOT_FOUND:
return {
title: Lang.queryJS('auth.mojang.error.notFoundTitle'),
desc: Lang.queryJS('auth.mojang.error.notFoundDesc')
}
case MojangErrorCode.ERROR_USER_MIGRATED:
return {
title: Lang.queryJS('auth.mojang.error.accountMigratedTitle'),
desc: Lang.queryJS('auth.mojang.error.accountMigratedDesc')
}
case MojangErrorCode.ERROR_INVALID_CREDENTIALS:
return {
title: Lang.queryJS('auth.mojang.error.invalidCredentialsTitle'),
desc: Lang.queryJS('auth.mojang.error.invalidCredentialsDesc')
}
case MojangErrorCode.ERROR_RATELIMIT:
return {
title: Lang.queryJS('auth.mojang.error.tooManyAttemptsTitle'),
desc: Lang.queryJS('auth.mojang.error.tooManyAttemptsDesc')
}
case MojangErrorCode.ERROR_INVALID_TOKEN:
return {
title: Lang.queryJS('auth.mojang.error.invalidTokenTitle'),
desc: Lang.queryJS('auth.mojang.error.invalidTokenDesc')
}
case MojangErrorCode.ERROR_ACCESS_TOKEN_HAS_PROFILE:
return {
title: Lang.queryJS('auth.mojang.error.tokenHasProfileTitle'),
desc: Lang.queryJS('auth.mojang.error.tokenHasProfileDesc')
}
case MojangErrorCode.ERROR_CREDENTIALS_MISSING:
return {
title: Lang.queryJS('auth.mojang.error.credentialsMissingTitle'),
desc: Lang.queryJS('auth.mojang.error.credentialsMissingDesc')
}
case MojangErrorCode.ERROR_INVALID_SALT_VERSION:
return {
title: Lang.queryJS('auth.mojang.error.invalidSaltVersionTitle'),
desc: Lang.queryJS('auth.mojang.error.invalidSaltVersionDesc')
}
case MojangErrorCode.ERROR_UNSUPPORTED_MEDIA_TYPE:
return {
title: Lang.queryJS('auth.mojang.error.unsupportedMediaTypeTitle'),
desc: Lang.queryJS('auth.mojang.error.unsupportedMediaTypeDesc')
}
case MojangErrorCode.ERROR_GONE:
return {
title: Lang.queryJS('auth.mojang.error.accountGoneTitle'),
desc: Lang.queryJS('auth.mojang.error.accountGoneDesc')
}
case MojangErrorCode.ERROR_UNREACHABLE:
return {
title: Lang.queryJS('auth.mojang.error.unreachableTitle'),
desc: Lang.queryJS('auth.mojang.error.unreachableDesc')
}
case MojangErrorCode.ERROR_NOT_PAID:
return {
title: Lang.queryJS('auth.mojang.error.gameNotPurchasedTitle'),
desc: Lang.queryJS('auth.mojang.error.gameNotPurchasedDesc')
}
case MojangErrorCode.UNKNOWN:
return {
title: Lang.queryJS('auth.mojang.error.unknownErrorTitle'),
desc: Lang.queryJS('auth.mojang.error.unknownErrorDesc')
}
default:
throw new Error(`Unknown error code: ${errorCode}`)
}
}
// Functions // Functions
/** /**
@ -57,6 +167,17 @@ exports.addMojangAccount = async function(username, password) {
} }
} }
exports.addOfflineAccount = async function(username) {
try {
const ret = ConfigManager.addOfflineAccount(username)
ConfigManager.save()
return ret
} catch (err){
log.error(err)
return Promise.reject(mojangErrorDisplayable(MojangErrorCode.UNKNOWN))
}
}
const AUTH_MODE = { FULL: 0, MS_REFRESH: 1, MC_REFRESH: 2 } const AUTH_MODE = { FULL: 0, MS_REFRESH: 1, MC_REFRESH: 2 }
/** /**
@ -199,6 +320,17 @@ exports.removeMicrosoftAccount = async function(uuid){
} }
} }
exports.removeOfflineAccount = async function(uuid){
try {
ConfigManager.removeAuthAccount(uuid)
ConfigManager.save()
return Promise.resolve()
} catch (err){
log.error('Error while removing account', err)
return Promise.reject(err)
}
}
/** /**
* Validate the selected account with Mojang's authserver. If the account is not valid, * Validate the selected account with Mojang's authserver. If the account is not valid,
* we will attempt to refresh the access token and update that value. If that fails, a * we will attempt to refresh the access token and update that value. If that fails, a

View File

@ -1,5 +1,6 @@
const fs = require('fs-extra') const fs = require('fs-extra')
const { LoggerUtil } = require('helios-core') const { LoggerUtil } = require('helios-core')
const { randomUUID } = require('crypto')
const os = require('os') const os = require('os')
const path = require('path') const path = require('path')
@ -9,9 +10,7 @@ const sysRoot = process.env.APPDATA || (process.platform == 'darwin' ? process.e
const dataPath = path.join(sysRoot, '.helioslauncher') const dataPath = path.join(sysRoot, '.helioslauncher')
const { app } = require('electron') const launcherDir = require('@electron/remote').app.getPath('userData')
const launcherDir = app.getPath('userData')
/** /**
* Retrieve the absolute path of the launcher directory. * Retrieve the absolute path of the launcher directory.
@ -351,6 +350,20 @@ exports.addMojangAuthAccount = function(uuid, accessToken, username, displayName
return config.authenticationDatabase[uuid] return config.authenticationDatabase[uuid]
} }
exports.addOfflineAccount = function(username){
console.log("Yeah I try to create new offline account")
uuid = randomUUID()
config.selectedAccount = uuid
config.authenticationDatabase[uuid] = {
type: 'offline',
password: '',
username: username.trim(),
uuid: uuid.trim(),
displayName: username.trim()
}
return config.authenticationDatabase[uuid]
}
/** /**
* Update the tokens of an authenticated microsoft account. * Update the tokens of an authenticated microsoft account.
* *

View File

@ -2,9 +2,7 @@ const { DistributionAPI } = require('helios-core/common')
const ConfigManager = require('./configmanager') const ConfigManager = require('./configmanager')
// Old WesterosCraft url. exports.REMOTE_DISTRO_URL = 'https://git.onimai.ru/ONIMAI-SMP/distribution/raw/branch/main/distribution.json'
// exports.REMOTE_DISTRO_URL = 'http://mc.westeroscraft.com/WesterosCraftLauncher/distribution.json'
exports.REMOTE_DISTRO_URL = 'https://helios-files.geekcorner.eu.org/distribution.json'
const api = new DistributionAPI( const api = new DistributionAPI(
ConfigManager.getLauncherDirectory(), ConfigManager.getLauncherDirectory(),

View File

@ -1,7 +1,7 @@
// NOTE FOR THIRD-PARTY // NOTE FOR THIRD-PARTY
// REPLACE THIS CLIENT ID WITH YOUR APPLICATION ID. // REPLACE THIS CLIENT ID WITH YOUR APPLICATION ID.
// SEE https://github.com/dscalzi/HeliosLauncher/blob/master/docs/MicrosoftAuth.md // SEE https://github.com/dscalzi/HeliosLauncher/blob/master/docs/MicrosoftAuth.md
exports.AZURE_CLIENT_ID = '1ce6e35a-126f-48fd-97fb-54d143ac6d45' exports.AZURE_CLIENT_ID = '58f2320b-3644-4194-9174-796e17617dd0'
// SEE NOTE ABOVE. // SEE NOTE ABOVE.
@ -25,4 +25,4 @@ exports.MSFT_ERROR = {
exports.SHELL_OPCODE = { exports.SHELL_OPCODE = {
TRASH_ITEM: 'TRASH_ITEM' TRASH_ITEM: 'TRASH_ITEM'
} }

View File

@ -6,7 +6,7 @@ const merge = require('lodash.merge')
let lang let lang
exports.loadLanguage = function(id){ exports.loadLanguage = function(id){
lang = merge(lang || {}, toml.parse(fs.readFileSync(path.join(__dirname, '..', '..', 'lang', `${id}.toml`))) || {}) lang = merge(lang || {}, toml.parse(fs.readFileSync(path.join(__dirname, '..', 'lang', `${id}.toml`))) || {})
} }
exports.query = function(id, placeHolders){ exports.query = function(id, placeHolders){
@ -40,8 +40,4 @@ exports.setupLanguage = function(){
// Load Custom Language File for Launcher Customizer // Load Custom Language File for Launcher Customizer
exports.loadLanguage('_custom') exports.loadLanguage('_custom')
}
exports.getLang = () => {
return lang
} }

View File

@ -1,58 +1,67 @@
const { contextBridge, ipcRenderer } = require('electron') const {ipcRenderer} = require('electron')
const fs = require('fs-extra')
const os = require('os')
const path = require('path')
module.exports.api = { const ConfigManager = require('./configmanager')
os: { const { DistroAPI } = require('./distromanager')
totalmem: () => ipcRenderer.invoke('os.totalmem'), const LangLoader = require('./langloader')
freemem: () => ipcRenderer.invoke('os.freemem') const { LoggerUtil } = require('helios-core')
}, // eslint-disable-next-line no-unused-vars
semver: { const { HeliosDistribution } = require('helios-core/common')
prerelease: (version) => ipcRenderer.invoke('semver.prerelease', version)
}, const logger = LoggerUtil.getLogger('Preloader')
path: {
join: (...args) => ipcRenderer.invoke('path.join', args) logger.info('Loading..')
},
app: { // Load ConfigManager
isDev: () => ipcRenderer.invoke('app.isDev'), ConfigManager.load()
getVersion: () => ipcRenderer.invoke('app.getVersion')
}, // Yuck!
shell: { // TODO Fix this
openExternal: (url) => ipcRenderer.invoke('shell.openExternal', url), DistroAPI['commonDir'] = ConfigManager.getCommonDirectory()
openPath: (path) => ipcRenderer.invoke('shell.openPath', path), DistroAPI['instanceDir'] = ConfigManager.getInstanceDirectory()
},
xwindow: { // Load Strings
close: () => ipcRenderer.invoke('xwindow.close'), LangLoader.setupLanguage()
setProgressBar: (progress) => ipcRenderer.invoke('xwindow.setProgressBar', progress),
toggleDevTools: () => { /**
console.log('%cThe console is dark and full of terrors.', 'color: white; -webkit-text-stroke: 4px #a02d2a; font-size: 60px; font-weight: bold') *
console.log('%cIf you\'ve been told to paste something here, you\'re being scammed.', 'font-size: 16px') * @param {HeliosDistribution} data
console.log('%cUnless you know exactly what you\'re doing, close this window.', 'font-size: 16px') */
return ipcRenderer.invoke('xwindow.toggleDevTools') function onDistroLoad(data){
}, if(data != null){
minimize: () => ipcRenderer.invoke('xwindow.minimize'),
maximize: () => ipcRenderer.invoke('xwindow.maximize'), // Resolve the selected server if its value has yet to be set.
unmaximize: () => ipcRenderer.invoke('xwindow.unmaximize'), if(ConfigManager.getSelectedServer() == null || data.getServerById(ConfigManager.getSelectedServer()) == null){
isMaximized: () => ipcRenderer.invoke('xwindow.isMaximized') logger.info('Determining default selected server..')
}, ConfigManager.setSelectedServer(data.getMainServer().rawServer.id)
process: { ConfigManager.save()
platform: () => ipcRenderer.invoke('process.platform'), }
arch: () => ipcRenderer.invoke('process.arch')
},
hc: {
type: () => ipcRenderer.invoke('hc.type')
},
AuthManager: {
addMojangAccount: (username, password) => ipcRenderer.invoke('AuthManager.addMojangAccount', username, password),
addMicrosoftAccount: (authCode) => ipcRenderer.invoke('AuthManager.addMicrosoftAccount', authCode),
removeMojangAccount: (uuid) => ipcRenderer.invoke('AuthManager.removeMojangAccount', uuid),
removeMicrosoftAccount: (uuid) => ipcRenderer.invoke('AuthManager.removeMicrosoftAccount', uuid),
validateSelected: () => ipcRenderer.invoke('AuthManager.validateSelected')
},
Lang: {
getLang: () => ipcRenderer.invoke('Lang.getLang')
},
AutoUpdater: {
port2: () => ipcRenderer.invoke('AutoUpdater.port2')
} }
ipcRenderer.send('distributionIndexDone', data != null)
} }
contextBridge.exposeInMainWorld('api', module.exports.api) // Ensure Distribution is downloaded and cached.
DistroAPI.getDistribution()
.then(heliosDistro => {
logger.info('Loaded distribution index.')
onDistroLoad(heliosDistro)
})
.catch(err => {
logger.info('Failed to load an older version of the distribution index.')
logger.info('Application cannot run.')
logger.error(err)
onDistroLoad(null)
})
// Clean up temp dir incase previous launches ended unexpectedly.
fs.remove(path.join(os.tmpdir(), ConfigManager.getTempNativeFolder()), (err) => {
if(err){
logger.warn('Error while cleaning natives directory', err)
} else {
logger.info('Cleaned natives directory.')
}
})

View File

@ -12,14 +12,23 @@ const ConfigManager = require('./configmanager')
const logger = LoggerUtil.getLogger('ProcessBuilder') const logger = LoggerUtil.getLogger('ProcessBuilder')
/**
* Only forge and fabric are top level mod loaders.
*
* Forge 1.13+ launch logic is similar to fabrics, for now using usingFabricLoader flag to
* change minor details when needed.
*
* Rewrite of this module may be needed in the future.
*/
class ProcessBuilder { class ProcessBuilder {
constructor(distroServer, versionData, forgeData, authUser, launcherVersion){ constructor(distroServer, vanillaManifest, modManifest, authUser, launcherVersion){
this.gameDir = path.join(ConfigManager.getInstanceDirectory(), distroServer.rawServer.id) this.gameDir = path.join(ConfigManager.getInstanceDirectory(), distroServer.rawServer.id)
this.commonDir = ConfigManager.getCommonDirectory() this.commonDir = ConfigManager.getCommonDirectory()
this.server = distroServer this.server = distroServer
this.versionData = versionData this.vanillaManifest = vanillaManifest
this.forgeData = forgeData this.modManifest = modManifest
this.authUser = authUser this.authUser = authUser
this.launcherVersion = launcherVersion this.launcherVersion = launcherVersion
this.forgeModListFile = path.join(this.gameDir, 'forgeMods.list') // 1.13+ this.forgeModListFile = path.join(this.gameDir, 'forgeMods.list') // 1.13+
@ -28,6 +37,7 @@ class ProcessBuilder {
this.libPath = path.join(this.commonDir, 'libraries') this.libPath = path.join(this.commonDir, 'libraries')
this.usingLiteLoader = false this.usingLiteLoader = false
this.usingFabricLoader = false
this.llPath = null this.llPath = null
} }
@ -40,9 +50,12 @@ class ProcessBuilder {
process.throwDeprecation = true process.throwDeprecation = true
this.setupLiteLoader() this.setupLiteLoader()
logger.info('Using liteloader:', this.usingLiteLoader) logger.info('Using liteloader:', this.usingLiteLoader)
this.usingFabricLoader = this.server.modules.some(mdl => mdl.rawModule.type === Type.Fabric)
logger.info('Using fabric loader:', this.usingFabricLoader)
const modObj = this.resolveModConfiguration(ConfigManager.getModConfiguration(this.server.rawServer.id).mods, this.server.modules) const modObj = this.resolveModConfiguration(ConfigManager.getModConfiguration(this.server.rawServer.id).mods, this.server.modules)
// Mod list below 1.13 // Mod list below 1.13
// Fabric only supports 1.14+
if(!mcVersionAtLeast('1.13', this.server.rawServer.minecraftVersion)){ if(!mcVersionAtLeast('1.13', this.server.rawServer.minecraftVersion)){
this.constructJSONModList('forge', modObj.fMods, true) this.constructJSONModList('forge', modObj.fMods, true)
if(this.usingLiteLoader){ if(this.usingLiteLoader){
@ -166,7 +179,7 @@ class ProcessBuilder {
for(let mdl of mdls){ for(let mdl of mdls){
const type = mdl.rawModule.type const type = mdl.rawModule.type
if(type === Type.ForgeMod || type === Type.LiteMod || type === Type.LiteLoader){ if(type === Type.ForgeMod || type === Type.LiteMod || type === Type.LiteLoader || type === Type.FabricMod){
const o = !mdl.getRequired().value const o = !mdl.getRequired().value
const e = ProcessBuilder.isModEnabled(modCfg[mdl.getVersionlessMavenIdentifier()], mdl.getRequired()) const e = ProcessBuilder.isModEnabled(modCfg[mdl.getVersionlessMavenIdentifier()], mdl.getRequired())
if(!o || (o && e)){ if(!o || (o && e)){
@ -178,7 +191,7 @@ class ProcessBuilder {
continue continue
} }
} }
if(type === Type.ForgeMod){ if(type === Type.ForgeMod || type === Type.FabricMod){
fMods.push(mdl) fMods.push(mdl)
} else { } else {
lMods.push(mdl) lMods.push(mdl)
@ -194,7 +207,7 @@ class ProcessBuilder {
} }
_lteMinorVersion(version) { _lteMinorVersion(version) {
return Number(this.forgeData.id.split('-')[0].split('.')[1]) <= Number(version) return Number(this.modManifest.id.split('-')[0].split('.')[1]) <= Number(version)
} }
/** /**
@ -206,7 +219,7 @@ class ProcessBuilder {
if(this._lteMinorVersion(9)) { if(this._lteMinorVersion(9)) {
return false return false
} }
const ver = this.forgeData.id.split('-')[2] const ver = this.modManifest.id.split('-')[2]
const pts = ver.split('.') const pts = ver.split('.')
const min = [14, 23, 3, 2655] const min = [14, 23, 3, 2655]
for(let i=0; i<pts.length; i++){ for(let i=0; i<pts.length; i++){
@ -282,18 +295,21 @@ class ProcessBuilder {
// } // }
/** /**
* Construct the mod argument list for forge 1.13 * Construct the mod argument list for forge 1.13 and Fabric
* *
* @param {Array.<Object>} mods An array of mods to add to the mod list. * @param {Array.<Object>} mods An array of mods to add to the mod list.
*/ */
constructModList(mods) { constructModList(mods) {
const writeBuffer = mods.map(mod => { const writeBuffer = mods.map(mod => {
return mod.getExtensionlessMavenIdentifier() return this.usingFabricLoader ? mod.getPath() : mod.getExtensionlessMavenIdentifier()
}).join('\n') }).join('\n')
if(writeBuffer) { if(writeBuffer) {
fs.writeFileSync(this.forgeModListFile, writeBuffer, 'UTF-8') fs.writeFileSync(this.forgeModListFile, writeBuffer, 'UTF-8')
return [ return this.usingFabricLoader ? [
'--fabric.addMods',
`@${this.forgeModListFile}`
] : [
'--fml.mavenRoots', '--fml.mavenRoots',
path.join('..', '..', 'common', 'modstore'), path.join('..', '..', 'common', 'modstore'),
'--fml.modLists', '--fml.modLists',
@ -352,7 +368,7 @@ class ProcessBuilder {
// Java Arguments // Java Arguments
if(process.platform === 'darwin'){ if(process.platform === 'darwin'){
args.push('-Xdock:name=HeliosLauncher') args.push('-Xdock:name=onimairu-mc_launcher')
args.push('-Xdock:icon=' + path.join(__dirname, '..', 'images', 'minecraft.icns')) args.push('-Xdock:icon=' + path.join(__dirname, '..', 'images', 'minecraft.icns'))
} }
args.push('-Xmx' + ConfigManager.getMaxRAM(this.server.rawServer.id)) args.push('-Xmx' + ConfigManager.getMaxRAM(this.server.rawServer.id))
@ -361,7 +377,7 @@ class ProcessBuilder {
args.push('-Djava.library.path=' + tempNativePath) args.push('-Djava.library.path=' + tempNativePath)
// Main Java Class // Main Java Class
args.push(this.forgeData.mainClass) args.push(this.modManifest.mainClass)
// Forge Arguments // Forge Arguments
args = args.concat(this._resolveForgeArgs()) args = args.concat(this._resolveForgeArgs())
@ -384,17 +400,17 @@ class ProcessBuilder {
const argDiscovery = /\${*(.*)}/ const argDiscovery = /\${*(.*)}/
// JVM Arguments First // JVM Arguments First
let args = this.versionData.arguments.jvm let args = this.vanillaManifest.arguments.jvm
// Debug securejarhandler // Debug securejarhandler
// args.push('-Dbsl.debug=true') // args.push('-Dbsl.debug=true')
if(this.forgeData.arguments.jvm != null) { if(this.modManifest.arguments.jvm != null) {
for(const argStr of this.forgeData.arguments.jvm) { for(const argStr of this.modManifest.arguments.jvm) {
args.push(argStr args.push(argStr
.replaceAll('${library_directory}', this.libPath) .replaceAll('${library_directory}', this.libPath)
.replaceAll('${classpath_separator}', ProcessBuilder.getClasspathSeparator()) .replaceAll('${classpath_separator}', ProcessBuilder.getClasspathSeparator())
.replaceAll('${version_name}', this.forgeData.id) .replaceAll('${version_name}', this.modManifest.id)
) )
} }
} }
@ -403,7 +419,7 @@ class ProcessBuilder {
// Java Arguments // Java Arguments
if(process.platform === 'darwin'){ if(process.platform === 'darwin'){
args.push('-Xdock:name=HeliosLauncher') args.push('-Xdock:name=onimairu-mc_launcher')
args.push('-Xdock:icon=' + path.join(__dirname, '..', 'images', 'minecraft.icns')) args.push('-Xdock:icon=' + path.join(__dirname, '..', 'images', 'minecraft.icns'))
} }
args.push('-Xmx' + ConfigManager.getMaxRAM(this.server.rawServer.id)) args.push('-Xmx' + ConfigManager.getMaxRAM(this.server.rawServer.id))
@ -411,10 +427,10 @@ class ProcessBuilder {
args = args.concat(ConfigManager.getJVMOptions(this.server.rawServer.id)) args = args.concat(ConfigManager.getJVMOptions(this.server.rawServer.id))
// Main Java Class // Main Java Class
args.push(this.forgeData.mainClass) args.push(this.modManifest.mainClass)
// Vanilla Arguments // Vanilla Arguments
args = args.concat(this.versionData.arguments.game) args = args.concat(this.vanillaManifest.arguments.game)
for(let i=0; i<args.length; i++){ for(let i=0; i<args.length; i++){
if(typeof args[i] === 'object' && args[i].rules != null){ if(typeof args[i] === 'object' && args[i].rules != null){
@ -471,7 +487,7 @@ class ProcessBuilder {
val = this.authUser.displayName.trim() val = this.authUser.displayName.trim()
break break
case 'version_name': case 'version_name':
//val = versionData.id //val = vanillaManifest.id
val = this.server.rawServer.id val = this.server.rawServer.id
break break
case 'game_directory': case 'game_directory':
@ -481,7 +497,7 @@ class ProcessBuilder {
val = path.join(this.commonDir, 'assets') val = path.join(this.commonDir, 'assets')
break break
case 'assets_index_name': case 'assets_index_name':
val = this.versionData.assets val = this.vanillaManifest.assets
break break
case 'auth_uuid': case 'auth_uuid':
val = this.authUser.uuid.trim() val = this.authUser.uuid.trim()
@ -493,7 +509,7 @@ class ProcessBuilder {
val = this.authUser.type === 'microsoft' ? 'msa' : 'mojang' val = this.authUser.type === 'microsoft' ? 'msa' : 'mojang'
break break
case 'version_type': case 'version_type':
val = this.versionData.type val = this.vanillaManifest.type
break break
case 'resolution_width': case 'resolution_width':
val = ConfigManager.getGameWidth() val = ConfigManager.getGameWidth()
@ -522,25 +538,11 @@ class ProcessBuilder {
} }
// Autoconnect // Autoconnect
let isAutoconnectBroken this._processAutoConnectArg(args)
try {
isAutoconnectBroken = ProcessBuilder.isAutoconnectBroken(this.forgeData.id.split('-')[2])
} catch(err) {
logger.error(err)
logger.error('Forge version format changed.. assuming autoconnect works.')
logger.debug('Forge version:', this.forgeData.id)
}
if(isAutoconnectBroken) {
logger.error('Server autoconnect disabled on Forge 1.15.2 for builds earlier than 31.2.15 due to OpenGL Stack Overflow issue.')
logger.error('Please upgrade your Forge version to at least 31.2.15!')
} else {
this._processAutoConnectArg(args)
}
// Forge Specific Arguments // Forge Specific Arguments
args = args.concat(this.forgeData.arguments.game) args = args.concat(this.modManifest.arguments.game)
// Filter null values // Filter null values
args = args.filter(arg => { args = args.filter(arg => {
@ -556,7 +558,7 @@ class ProcessBuilder {
* @returns {Array.<string>} An array containing the arguments required by forge. * @returns {Array.<string>} An array containing the arguments required by forge.
*/ */
_resolveForgeArgs(){ _resolveForgeArgs(){
const mcArgs = this.forgeData.minecraftArguments.split(' ') const mcArgs = this.modManifest.minecraftArguments.split(' ')
const argDiscovery = /\${*(.*)}/ const argDiscovery = /\${*(.*)}/
// Replace the declared variables with their proper values. // Replace the declared variables with their proper values.
@ -569,7 +571,7 @@ class ProcessBuilder {
val = this.authUser.displayName.trim() val = this.authUser.displayName.trim()
break break
case 'version_name': case 'version_name':
//val = versionData.id //val = vanillaManifest.id
val = this.server.rawServer.id val = this.server.rawServer.id
break break
case 'game_directory': case 'game_directory':
@ -579,7 +581,7 @@ class ProcessBuilder {
val = path.join(this.commonDir, 'assets') val = path.join(this.commonDir, 'assets')
break break
case 'assets_index_name': case 'assets_index_name':
val = this.versionData.assets val = this.vanillaManifest.assets
break break
case 'auth_uuid': case 'auth_uuid':
val = this.authUser.uuid.trim() val = this.authUser.uuid.trim()
@ -594,7 +596,7 @@ class ProcessBuilder {
val = '{}' val = '{}'
break break
case 'version_type': case 'version_type':
val = this.versionData.type val = this.vanillaManifest.type
break break
} }
if(val != null){ if(val != null){
@ -669,10 +671,10 @@ class ProcessBuilder {
classpathArg(mods, tempNativePath){ classpathArg(mods, tempNativePath){
let cpArgs = [] let cpArgs = []
if(!mcVersionAtLeast('1.17', this.server.rawServer.minecraftVersion)) { if(!mcVersionAtLeast('1.17', this.server.rawServer.minecraftVersion) || this.usingFabricLoader) {
// Add the version.jar to the classpath. // Add the version.jar to the classpath.
// Must not be added to the classpath for Forge 1.17+. // Must not be added to the classpath for Forge 1.17+.
const version = this.versionData.id const version = this.vanillaManifest.id
cpArgs.push(path.join(this.commonDir, 'versions', version, version + '.jar')) cpArgs.push(path.join(this.commonDir, 'versions', version, version + '.jar'))
} }
@ -711,7 +713,7 @@ class ProcessBuilder {
const nativesRegex = /.+:natives-([^-]+)(?:-(.+))?/ const nativesRegex = /.+:natives-([^-]+)(?:-(.+))?/
const libs = {} const libs = {}
const libArr = this.versionData.libraries const libArr = this.vanillaManifest.libraries
fs.ensureDirSync(tempNativePath) fs.ensureDirSync(tempNativePath)
for(let i=0; i<libArr.length; i++){ for(let i=0; i<libArr.length; i++){
const lib = libArr[i] const lib = libArr[i]
@ -830,16 +832,14 @@ class ProcessBuilder {
const mdls = this.server.modules const mdls = this.server.modules
let libs = {} let libs = {}
// Locate Forge/Libraries // Locate Forge/Fabric/Libraries
for(let mdl of mdls){ for(let mdl of mdls){
const type = mdl.rawModule.type const type = mdl.rawModule.type
if(type === Type.ForgeHosted || type === Type.Library){ if(type === Type.ForgeHosted || type === Type.Fabric || type === Type.Library){
libs[mdl.getVersionlessMavenIdentifier()] = mdl.getPath() libs[mdl.getVersionlessMavenIdentifier()] = mdl.getPath()
if(mdl.subModules.length > 0){ if(mdl.subModules.length > 0){
const res = this._resolveModuleLibraries(mdl) const res = this._resolveModuleLibraries(mdl)
if(res.length > 0){ libs = {...libs, ...res}
libs = {...libs, ...res}
}
} }
} }
} }
@ -848,9 +848,7 @@ class ProcessBuilder {
for(let i=0; i<mods.length; i++){ for(let i=0; i<mods.length; i++){
if(mods.sub_modules != null){ if(mods.sub_modules != null){
const res = this._resolveModuleLibraries(mods[i]) const res = this._resolveModuleLibraries(mods[i])
if(res.length > 0){ libs = {...libs, ...res}
libs = {...libs, ...res}
}
} }
} }
@ -861,50 +859,30 @@ class ProcessBuilder {
* Recursively resolve the path of each library required by this module. * Recursively resolve the path of each library required by this module.
* *
* @param {Object} mdl A module object from the server distro index. * @param {Object} mdl A module object from the server distro index.
* @returns {Array.<string>} An array containing the paths of each library this module requires. * @returns {{[id: string]: string}} An object containing the paths of each library this module requires.
*/ */
_resolveModuleLibraries(mdl){ _resolveModuleLibraries(mdl){
if(!mdl.subModules.length > 0){ if(!mdl.subModules.length > 0){
return [] return {}
} }
let libs = [] let libs = {}
for(let sm of mdl.subModules){ for(let sm of mdl.subModules){
if(sm.rawModule.type === Type.Library){ if(sm.rawModule.type === Type.Library){
if(sm.rawModule.classpath ?? true) { if(sm.rawModule.classpath ?? true) {
libs.push(sm.getPath()) libs[sm.getVersionlessMavenIdentifier()] = sm.getPath()
} }
} }
// If this module has submodules, we need to resolve the libraries for those. // If this module has submodules, we need to resolve the libraries for those.
// To avoid unnecessary recursive calls, base case is checked here. // To avoid unnecessary recursive calls, base case is checked here.
if(mdl.subModules.length > 0){ if(mdl.subModules.length > 0){
const res = this._resolveModuleLibraries(sm) const res = this._resolveModuleLibraries(sm)
if(res.length > 0){ libs = {...libs, ...res}
libs = libs.concat(res)
}
} }
} }
return libs return libs
} }
static isAutoconnectBroken(forgeVersion) {
const minWorking = [31, 2, 15]
const verSplit = forgeVersion.split('.').map(v => Number(v))
if(verSplit[0] === 31) {
for(let i=0; i<minWorking.length; i++) {
if(verSplit[i] > minWorking[i]) {
return false
} else if(verSplit[i] < minWorking[i]) {
return true
}
}
}
return false
}
} }
module.exports = ProcessBuilder module.exports = ProcessBuilder

View File

@ -1,30 +0,0 @@
// HACK FIXME
let lang
export async function loadLanguage() {
lang = await window.api.Lang.getLang()
}
export function query(id, placeHolders){
let query = id.split('.')
let res = lang
for(let q of query){
res = res[q]
}
let text = res === lang ? '' : res
if (placeHolders) {
Object.entries(placeHolders).forEach(([key, value]) => {
text = text.replace(`{${key}}`, value)
})
}
return text
}
export function queryJS(id, placeHolders){
return query(`js.${id}`, placeHolders)
}
export function queryEJS(id, placeHolders){
return query(`ejs.${id}`, placeHolders)
}

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +0,0 @@
// Mapping of each view to their container IDs.
export const VIEWS = {
landing: '#landingContainer',
loginOptions: '#loginOptionsContainer',
login: '#loginContainer',
settings: '#settingsContainer',
welcome: '#welcomeContainer',
waiting: '#waitingContainer'
}

View File

@ -1,10 +1,8 @@
/** /**
* Script for landing.ejs * Script for landing.ejs
*/ */
import { VIEWS } from './views.js'
// Requirements // Requirements
const { URL } = require('url')
const { const {
MojangRestAPI, MojangRestAPI,
getServerStatus getServerStatus
@ -87,7 +85,7 @@ function setLaunchPercentage(percent){
* @param {number} percent Percentage (0-100) * @param {number} percent Percentage (0-100)
*/ */
function setDownloadPercentage(percent){ function setDownloadPercentage(percent){
xwindow.setProgressBar(percent/100) remote.getCurrentWindow().setProgressBar(percent/100)
setLaunchPercentage(percent) setLaunchPercentage(percent)
} }
@ -404,7 +402,7 @@ async function downloadJava(effectiveJavaOptions, launchAfter = true) {
// Extract // Extract
// Show installing progress bar. // Show installing progress bar.
xwindow.setProgressBar(2) remote.getCurrentWindow().setProgressBar(2)
// Wait for extration to complete. // Wait for extration to complete.
const eLStr = Lang.queryJS('landing.downloadJava.extractingJava') const eLStr = Lang.queryJS('landing.downloadJava.extractingJava')
@ -422,7 +420,7 @@ async function downloadJava(effectiveJavaOptions, launchAfter = true) {
const newJavaExec = await extractJdk(asset.path) const newJavaExec = await extractJdk(asset.path)
// Extraction complete, remove the loading from the OS progress bar. // Extraction complete, remove the loading from the OS progress bar.
xwindow.setProgressBar(-1) remote.getCurrentWindow().setProgressBar(-1)
// Extraction completed successfully. // Extraction completed successfully.
ConfigManager.setJavaExecutable(ConfigManager.getSelectedServer(), newJavaExec) ConfigManager.setJavaExecutable(ConfigManager.getSelectedServer(), newJavaExec)
@ -444,7 +442,7 @@ let hasRPC = false
// Joined server regex // Joined server regex
// Change this if your server uses something different. // Change this if your server uses something different.
const GAME_JOINED_REGEX = /\[.+\]: Sound engine started/ const GAME_JOINED_REGEX = /\[.+\]: Sound engine started/
const GAME_LAUNCH_REGEX = /^\[.+\]: (?:MinecraftForge .+ Initialized|ModLauncher .+ starting: .+)$/ const GAME_LAUNCH_REGEX = /^\[.+\]: (?:MinecraftForge .+ Initialized|ModLauncher .+ starting: .+|Loading Minecraft .+ with Fabric Loader .+)$/
const MIN_LINGER = 5000 const MIN_LINGER = 5000
async function dlAsync(login = true) { async function dlAsync(login = true) {
@ -535,7 +533,7 @@ async function dlAsync(login = true) {
} }
// Remove download bar. // Remove download bar.
xwindow.setProgressBar(-1) remote.getCurrentWindow().setProgressBar(-1)
fullRepairModule.destroyReceiver() fullRepairModule.destroyReceiver()
@ -550,13 +548,13 @@ async function dlAsync(login = true) {
serv.rawServer.id serv.rawServer.id
) )
const forgeData = await distributionIndexProcessor.loadForgeVersionJson(serv) const modLoaderData = await distributionIndexProcessor.loadModLoaderVersionJson(serv)
const versionData = await mojangIndexProcessor.getVersionJson() const versionData = await mojangIndexProcessor.getVersionJson()
if(login) { if(login) {
const authUser = ConfigManager.getSelectedAccount() const authUser = ConfigManager.getSelectedAccount()
loggerLaunchSuite.info(`Sending selected account (${authUser.displayName}) to ProcessBuilder.`) loggerLaunchSuite.info(`Sending selected account (${authUser.displayName}) to ProcessBuilder.`)
let pb = new ProcessBuilder(serv, versionData, forgeData, authUser, app.getVersion()) let pb = new ProcessBuilder(serv, versionData, modLoaderData, authUser, remote.app.getVersion())
setLaunchDetails(Lang.queryJS('landing.dlAsync.launchingGame')) setLaunchDetails(Lang.queryJS('landing.dlAsync.launchingGame'))
// const SERVER_JOINED_REGEX = /\[.+\]: \[CHAT\] [a-zA-Z0-9_]{1,16} joined the game/ // const SERVER_JOINED_REGEX = /\[.+\]: \[CHAT\] [a-zA-Z0-9_]{1,16} joined the game/

View File

@ -1,9 +1,6 @@
/** /**
* Script for login.ejs * Script for login.ejs
*/ */
import { VIEWS } from './views.js'
// Validation Regexes. // Validation Regexes.
const validUsername = /^[a-zA-Z0-9_]{1,16}$/ const validUsername = /^[a-zA-Z0-9_]{1,16}$/
const basicEmail = /^\S+@\S+\.\S+$/ const basicEmail = /^\S+@\S+\.\S+$/
@ -14,8 +11,6 @@ const loginCancelContainer = document.getElementById('loginCancelContainer')
const loginCancelButton = document.getElementById('loginCancelButton') const loginCancelButton = document.getElementById('loginCancelButton')
const loginEmailError = document.getElementById('loginEmailError') const loginEmailError = document.getElementById('loginEmailError')
const loginUsername = document.getElementById('loginUsername') const loginUsername = document.getElementById('loginUsername')
const loginPasswordError = document.getElementById('loginPasswordError')
const loginPassword = document.getElementById('loginPassword')
const checkmarkContainer = document.getElementById('checkmarkContainer') const checkmarkContainer = document.getElementById('checkmarkContainer')
const loginRememberOption = document.getElementById('loginRememberOption') const loginRememberOption = document.getElementById('loginRememberOption')
const loginButton = document.getElementById('loginButton') const loginButton = document.getElementById('loginButton')
@ -80,17 +75,7 @@ function validateEmail(value){
* @param {string} value The password value. * @param {string} value The password value.
*/ */
function validatePassword(value){ function validatePassword(value){
if(value){ lp = true;
loginPasswordError.style.opacity = 0
lp = true
if(lu){
loginDisabled(false)
}
} else {
lp = false
showError(loginPasswordError, Lang.queryJS('login.error.invalidValue'))
loginDisabled(true)
}
} }
// Emphasize errors with shake when focus is lost. // Emphasize errors with shake when focus is lost.
@ -98,17 +83,10 @@ loginUsername.addEventListener('focusout', (e) => {
validateEmail(e.target.value) validateEmail(e.target.value)
shakeError(loginEmailError) shakeError(loginEmailError)
}) })
loginPassword.addEventListener('focusout', (e) => {
validatePassword(e.target.value)
shakeError(loginPasswordError)
})
// Validate input for each field. // Validate input for each field.
loginUsername.addEventListener('input', (e) => { loginUsername.addEventListener('input', (e) => {
validateEmail(e.target.value) loginDisabled(false)
})
loginPassword.addEventListener('input', (e) => {
validatePassword(e.target.value)
}) })
/** /**
@ -146,7 +124,6 @@ function formDisabled(v){
loginDisabled(v) loginDisabled(v)
loginCancelButton.disabled = v loginCancelButton.disabled = v
loginUsername.disabled = v loginUsername.disabled = v
loginPassword.disabled = v
if(v){ if(v){
checkmarkContainer.setAttribute('disabled', v) checkmarkContainer.setAttribute('disabled', v)
} else { } else {
@ -190,7 +167,7 @@ loginButton.addEventListener('click', () => {
// Show loading stuff. // Show loading stuff.
loginLoading(true) loginLoading(true)
AuthManager.addMojangAccount(loginUsername.value, loginPassword.value).then((value) => { AuthManager.addOfflineAccount(loginUsername.value).then((value) => {
updateSelectedAccount(value) updateSelectedAccount(value)
loginButton.innerHTML = loginButton.innerHTML.replace(Lang.queryJS('login.loggingIn'), Lang.queryJS('login.success')) loginButton.innerHTML = loginButton.innerHTML.replace(Lang.queryJS('login.loggingIn'), Lang.queryJS('login.success'))
$('.circle-loader').toggleClass('load-complete') $('.circle-loader').toggleClass('load-complete')
@ -205,7 +182,6 @@ loginButton.addEventListener('click', () => {
loginCancelEnabled(false) // Reset this for good measure. loginCancelEnabled(false) // Reset this for good measure.
loginViewCancelHandler = null // Reset this for good measure. loginViewCancelHandler = null // Reset this for good measure.
loginUsername.value = '' loginUsername.value = ''
loginPassword.value = ''
$('.circle-loader').toggleClass('load-complete') $('.circle-loader').toggleClass('load-complete')
$('.checkmark').toggle() $('.checkmark').toggle()
loginLoading(false) loginLoading(false)

View File

@ -1,8 +1,7 @@
import { VIEWS } from './views.js'
const loginOptionsCancelContainer = document.getElementById('loginOptionCancelContainer') const loginOptionsCancelContainer = document.getElementById('loginOptionCancelContainer')
const loginOptionMicrosoft = document.getElementById('loginOptionMicrosoft') const loginOptionMicrosoft = document.getElementById('loginOptionMicrosoft')
const loginOptionMojang = document.getElementById('loginOptionMojang') //const loginOptionMojang = document.getElementById('loginOptionMojang')
const loginOptionOffline = document.getElementById('loginOptionOffline')
const loginOptionsCancelButton = document.getElementById('loginOptionCancelButton') const loginOptionsCancelButton = document.getElementById('loginOptionCancelButton')
let loginOptionsCancellable = false let loginOptionsCancellable = false
@ -30,7 +29,7 @@ loginOptionMicrosoft.onclick = (e) => {
}) })
} }
loginOptionMojang.onclick = (e) => { loginOptionOffline.onclick = (e) => {
switchView(getCurrentView(), VIEWS.login, 500, 500, () => { switchView(getCurrentView(), VIEWS.login, 500, 500, () => {
loginViewOnSuccess = loginOptionsViewOnLoginSuccess loginViewOnSuccess = loginOptionsViewOnLoginSuccess
loginViewOnCancel = loginOptionsViewOnLoginCancel loginViewOnCancel = loginOptionsViewOnLoginCancel

View File

@ -2,8 +2,6 @@
* Script for overlay.ejs * Script for overlay.ejs
*/ */
import { VIEWS } from './views.js'
/* Overlay Wrapper Functions */ /* Overlay Wrapper Functions */
/** /**

View File

@ -1,8 +1,9 @@
// Requirements
const os = require('os')
const semver = require('semver')
import { VIEWS } from './views.js' const DropinModUtil = require('./assets/js/dropinmodutil')
const { MSFT_OPCODE, MSFT_REPLY_TYPE, MSFT_ERROR } = require('./assets/js/ipcconstants')
import DropinModUtil from './assets/js/dropinmodutil'
import { MSFT_OPCODE, MSFT_REPLY_TYPE, MSFT_ERROR } from './assets/js/ipcconstants'
const settingsState = { const settingsState = {
invalid: new Set() invalid: new Set()
@ -63,14 +64,13 @@ function bindFileSelectors(){
] ]
} }
// TODO FIXME const res = await remote.dialog.showOpenDialog(remote.getCurrentWindow(), options)
// const res = await remote.dialog.showOpenDialog(remote.getCurrentWindow(), options) if(!res.canceled) {
// if(!res.canceled) { ele.previousElementSibling.value = res.filePaths[0]
// ele.previousElementSibling.value = res.filePaths[0] if(isJavaExecSel) {
// if(isJavaExecSel) { await populateJavaExecDetails(ele.previousElementSibling.value)
// await populateJavaExecDetails(ele.previousElementSibling.value) }
// } }
// }
} }
} }
} }
@ -342,15 +342,6 @@ settingsNavDone.onclick = () => {
const msftLoginLogger = LoggerUtil.getLogger('Microsoft Login') const msftLoginLogger = LoggerUtil.getLogger('Microsoft Login')
const msftLogoutLogger = LoggerUtil.getLogger('Microsoft Logout') const msftLogoutLogger = LoggerUtil.getLogger('Microsoft Logout')
// Bind the add mojang account button.
document.getElementById('settingsAddMojangAccount').onclick = (e) => {
switchView(getCurrentView(), VIEWS.login, 500, 500, () => {
loginViewOnCancel = VIEWS.settings
loginViewOnSuccess = VIEWS.settings
loginCancelEnabled(true)
})
}
// Bind the add microsoft account button. // Bind the add microsoft account button.
document.getElementById('settingsAddMicrosoftAccount').onclick = (e) => { document.getElementById('settingsAddMicrosoftAccount').onclick = (e) => {
switchView(getCurrentView(), VIEWS.waiting, 500, 500, () => { switchView(getCurrentView(), VIEWS.waiting, 500, 500, () => {
@ -519,7 +510,7 @@ function processLogOut(val, isLastAccount){
ipcRenderer.send(MSFT_OPCODE.OPEN_LOGOUT, uuid, isLastAccount) ipcRenderer.send(MSFT_OPCODE.OPEN_LOGOUT, uuid, isLastAccount)
}) })
} else { } else {
AuthManager.removeMojangAccount(uuid).then(() => { AuthManager.removeOfflineAccount(uuid).then(() => {
if(!isLastAccount && uuid === prevSelAcc.uuid){ if(!isLastAccount && uuid === prevSelAcc.uuid){
const selAcc = ConfigManager.getSelectedAccount() const selAcc = ConfigManager.getSelectedAccount()
refreshAuthAccountSelected(selAcc.uuid) refreshAuthAccountSelected(selAcc.uuid)
@ -619,7 +610,8 @@ function refreshAuthAccountSelected(uuid){
} }
const settingsCurrentMicrosoftAccounts = document.getElementById('settingsCurrentMicrosoftAccounts') const settingsCurrentMicrosoftAccounts = document.getElementById('settingsCurrentMicrosoftAccounts')
const settingsCurrentMojangAccounts = document.getElementById('settingsCurrentMojangAccounts') //const settingsCurrentMojangAccounts = document.getElementById('settingsCurrentMojangAccounts')
const settingsCurrentOfflineAccounts = document.getElementById('settingsCurrentOfflineAccounts')
/** /**
* Add auth account elements for each one stored in the authentication database. * Add auth account elements for each one stored in the authentication database.
@ -634,6 +626,7 @@ function populateAuthAccounts(){
let microsoftAuthAccountStr = '' let microsoftAuthAccountStr = ''
let mojangAuthAccountStr = '' let mojangAuthAccountStr = ''
let offlineAuthAccountStr = ''
authKeys.forEach((val) => { authKeys.forEach((val) => {
const acc = authAccounts[val] const acc = authAccounts[val]
@ -665,13 +658,14 @@ function populateAuthAccounts(){
if(acc.type === 'microsoft') { if(acc.type === 'microsoft') {
microsoftAuthAccountStr += accHtml microsoftAuthAccountStr += accHtml
} else { } else {
mojangAuthAccountStr += accHtml offlineAuthAccountStr += accHtml
} }
}) })
settingsCurrentMicrosoftAccounts.innerHTML = microsoftAuthAccountStr settingsCurrentMicrosoftAccounts.innerHTML = microsoftAuthAccountStr
settingsCurrentMojangAccounts.innerHTML = mojangAuthAccountStr //settingsCurrentMojangAccounts.innerHTML = mojangAuthAccountStr
settingsCurrentOfflineAccounts.innerHTML = offlineAuthAccountStr
} }
/** /**
@ -716,7 +710,7 @@ async function resolveModsForUI(){
const distro = await DistroAPI.getDistribution() const distro = await DistroAPI.getDistribution()
const servConf = ConfigManager.getModConfiguration(serv) const servConf = ConfigManager.getModConfiguration(serv)
const modStr = await parseModulesForUI(distro.getServerById(serv).modules, false, servConf.mods) const modStr = parseModulesForUI(distro.getServerById(serv).modules, false, servConf.mods)
document.getElementById('settingsReqModsContent').innerHTML = modStr.reqMods document.getElementById('settingsReqModsContent').innerHTML = modStr.reqMods
document.getElementById('settingsOptModsContent').innerHTML = modStr.optMods document.getElementById('settingsOptModsContent').innerHTML = modStr.optMods
@ -729,16 +723,14 @@ async function resolveModsForUI(){
* @param {boolean} submodules Whether or not we are parsing submodules. * @param {boolean} submodules Whether or not we are parsing submodules.
* @param {Object} servConf The server configuration object for this module level. * @param {Object} servConf The server configuration object for this module level.
*/ */
async function parseModulesForUI(mdls, submodules, servConf){ function parseModulesForUI(mdls, submodules, servConf){
let reqMods = '' let reqMods = ''
let optMods = '' let optMods = ''
const Type = await hc.type
for(const mdl of mdls){ for(const mdl of mdls){
if(mdl.rawModule.type === Type.ForgeMod || mdl.rawModule.type === Type.LiteMod || mdl.rawModule.type === Type.LiteLoader){ if(mdl.rawModule.type === Type.ForgeMod || mdl.rawModule.type === Type.LiteMod || mdl.rawModule.type === Type.LiteLoader || mdl.rawModule.type === Type.FabricMod){
if(mdl.getRequired().value){ if(mdl.getRequired().value){
@ -757,7 +749,7 @@ async function parseModulesForUI(mdls, submodules, servConf){
</label> </label>
</div> </div>
${mdl.subModules.length > 0 ? `<div class="settingsSubModContainer"> ${mdl.subModules.length > 0 ? `<div class="settingsSubModContainer">
${Object.values(await parseModulesForUI(mdl.subModules, true, servConf[mdl.getVersionlessMavenIdentifier()])).join('')} ${Object.values(parseModulesForUI(mdl.subModules, true, servConf[mdl.getVersionlessMavenIdentifier()])).join('')}
</div>` : ''} </div>` : ''}
</div>` </div>`
@ -781,7 +773,7 @@ async function parseModulesForUI(mdls, submodules, servConf){
</label> </label>
</div> </div>
${mdl.subModules.length > 0 ? `<div class="settingsSubModContainer"> ${mdl.subModules.length > 0 ? `<div class="settingsSubModContainer">
${Object.values(await parseModulesForUI(mdl.subModules, true, conf.mods)).join('')} ${Object.values(parseModulesForUI(mdl.subModules, true, conf.mods)).join('')}
</div>` : ''} </div>` : ''}
</div>` </div>`
@ -1405,7 +1397,8 @@ const settingsAboutChangelogButton = settingsTabAbout.getElementsByClassName('se
// Bind the devtools toggle button. // Bind the devtools toggle button.
document.getElementById('settingsAboutDevToolsButton').onclick = (e) => { document.getElementById('settingsAboutDevToolsButton').onclick = (e) => {
xwindow.toggleDevTools() let window = remote.getCurrentWindow()
window.toggleDevTools()
} }
/** /**
@ -1445,7 +1438,7 @@ function populateVersionInformation(version, valueElement, titleElement, checkEl
* Retrieve the version information and display it on the UI. * Retrieve the version information and display it on the UI.
*/ */
function populateAboutVersionInformation(){ function populateAboutVersionInformation(){
populateVersionInformation(app.getVersion(), document.getElementById('settingsAboutCurrentVersionValue'), document.getElementById('settingsAboutCurrentVersionTitle'), document.getElementById('settingsAboutCurrentVersionCheck')) populateVersionInformation(remote.app.getVersion(), document.getElementById('settingsAboutCurrentVersionValue'), document.getElementById('settingsAboutCurrentVersionTitle'), document.getElementById('settingsAboutCurrentVersionCheck'))
} }
/** /**
@ -1454,9 +1447,9 @@ function populateAboutVersionInformation(){
*/ */
function populateReleaseNotes(){ function populateReleaseNotes(){
$.ajax({ $.ajax({
url: 'https://github.com/dscalzi/HeliosLauncher/releases.atom', url: 'https://git.onimai.ru/ONIMAI-SMP/Launcher/releases.atom',
success: (data) => { success: (data) => {
const version = 'v' + app.getVersion() const version = 'v' + remote.app.getVersion()
const entries = $(data).find('entry') const entries = $(data).find('entry')
for(let i=0; i<entries.length; i++){ for(let i=0; i<entries.length; i++){
@ -1538,7 +1531,7 @@ function populateSettingsUpdateInformation(data){
} else { } else {
settingsUpdateTitle.innerHTML = Lang.queryJS('settings.updates.latestVersionTitle') settingsUpdateTitle.innerHTML = Lang.queryJS('settings.updates.latestVersionTitle')
settingsUpdateChangelogCont.style.display = 'none' settingsUpdateChangelogCont.style.display = 'none'
populateVersionInformation(app.getVersion(), settingsUpdateVersionValue, settingsUpdateVersionTitle, settingsUpdateVersionCheck) populateVersionInformation(remote.app.getVersion(), settingsUpdateVersionValue, settingsUpdateVersionTitle, settingsUpdateVersionCheck)
settingsUpdateButtonStatus(Lang.queryJS('settings.updates.checkForUpdatesButton'), false, () => { settingsUpdateButtonStatus(Lang.queryJS('settings.updates.checkForUpdatesButton'), false, () => {
if(!isDev){ if(!isDev){
ipcRenderer.send('autoUpdateAction', 'checkForUpdate') ipcRenderer.send('autoUpdateAction', 'checkForUpdate')

View File

@ -2,12 +2,28 @@
* Initialize UI functions which depend on internal modules. * Initialize UI functions which depend on internal modules.
* Loaded after core UI functions are initialized in uicore.js. * Loaded after core UI functions are initialized in uicore.js.
*/ */
// Requirements
const path = require('path')
const { Type } = require('helios-distribution-types')
import { VIEWS } from './views.js' const AuthManager = require('./assets/js/authmanager')
const ConfigManager = require('./assets/js/configmanager')
const { DistroAPI } = require('./assets/js/distromanager')
let rscShouldLoad = false let rscShouldLoad = false
let fatalStartupError = false let fatalStartupError = false
// Mapping of each view to their container IDs.
const VIEWS = {
landing: '#landingContainer',
loginOptions: '#loginOptionsContainer',
loginOffline: '#loginOfflineContainer',
login: '#loginContainer',
settings: '#settingsContainer',
welcome: '#welcomeContainer',
waiting: '#waitingContainer'
}
// The currently shown view container. // The currently shown view container.
let currentView let currentView
@ -104,7 +120,8 @@ function showFatalStartupError(){
Lang.queryJS('uibinder.startup.closeButton') Lang.queryJS('uibinder.startup.closeButton')
) )
setOverlayHandler(() => { setOverlayHandler(() => {
xwindow.close() const window = remote.getCurrentWindow()
window.close()
}) })
toggleOverlay(true) toggleOverlay(true)
}) })
@ -129,10 +146,9 @@ function onDistroRefresh(data){
* *
* @param {Object} data The distro index object. * @param {Object} data The distro index object.
*/ */
async function syncModConfigurations(data){ function syncModConfigurations(data){
const syncedCfgs = [] const syncedCfgs = []
const Type = await hc.type
for(let serv of data.servers){ for(let serv of data.servers){
@ -148,7 +164,7 @@ async function syncModConfigurations(data){
for(let mdl of mdls){ for(let mdl of mdls){
const type = mdl.rawModule.type const type = mdl.rawModule.type
if(type === Type.ForgeMod || type === Type.LiteMod || type === Type.LiteLoader){ if(type === Type.ForgeMod || type === Type.LiteMod || type === Type.LiteLoader || type === Type.FabricMod){
if(!mdl.getRequired().value){ if(!mdl.getRequired().value){
const mdlID = mdl.getVersionlessMavenIdentifier() const mdlID = mdl.getVersionlessMavenIdentifier()
if(modsOld[mdlID] == null){ if(modsOld[mdlID] == null){
@ -183,7 +199,7 @@ async function syncModConfigurations(data){
for(let mdl of mdls){ for(let mdl of mdls){
const type = mdl.rawModule.type const type = mdl.rawModule.type
if(type === Type.ForgeMod || type === Type.LiteMod || type === Type.LiteLoader){ if(type === Type.ForgeMod || type === Type.LiteMod || type === Type.LiteLoader || type === Type.FabricMod){
if(!mdl.getRequired().value){ if(!mdl.getRequired().value){
mods[mdl.getVersionlessMavenIdentifier()] = scanOptionalSubModules(mdl.subModules, mdl) mods[mdl.getVersionlessMavenIdentifier()] = scanOptionalSubModules(mdl.subModules, mdl)
} else { } else {
@ -238,7 +254,7 @@ function scanOptionalSubModules(mdls, origin){
for(let mdl of mdls){ for(let mdl of mdls){
const type = mdl.rawModule.type const type = mdl.rawModule.type
// Optional types. // Optional types.
if(type === Type.ForgeMod || type === Type.LiteMod || type === Type.LiteLoader){ if(type === Type.ForgeMod || type === Type.LiteMod || type === Type.LiteLoader || type === Type.FabricMod){
// It is optional. // It is optional.
if(!mdl.getRequired().value){ if(!mdl.getRequired().value){
mods[mdl.getVersionlessMavenIdentifier()] = scanOptionalSubModules(mdl.subModules, mdl) mods[mdl.getVersionlessMavenIdentifier()] = scanOptionalSubModules(mdl.subModules, mdl)
@ -424,7 +440,7 @@ document.addEventListener('readystatechange', async () => {
ipcRenderer.on('distributionIndexDone', async (event, res) => { ipcRenderer.on('distributionIndexDone', async (event, res) => {
if(res) { if(res) {
const data = await DistroAPI.getDistribution() const data = await DistroAPI.getDistribution()
await syncModConfigurations(data) syncModConfigurations(data)
ensureJavaSettings(data) ensureJavaSettings(data)
if(document.readyState === 'interactive' || document.readyState === 'complete'){ if(document.readyState === 'interactive' || document.readyState === 'complete'){
await showMainUI(data) await showMainUI(data)
@ -447,5 +463,5 @@ async function devModeToggle() {
const data = await DistroAPI.refreshDistributionOrFallback() const data = await DistroAPI.refreshDistributionOrFallback()
ensureJavaSettings(data) ensureJavaSettings(data)
updateSelectedServer(data.servers[0]) updateSelectedServer(data.servers[0])
await syncModConfigurations(data) syncModConfigurations(data)
} }

View File

@ -1,5 +1,3 @@
import { VIEWS } from './views.js'
/** /**
* Core UI functions are initialized in this file. This prevents * Core UI functions are initialized in this file. This prevents
* unexpected errors from breaking the core features. Specifically, * unexpected errors from breaking the core features. Specifically,
@ -7,41 +5,58 @@ import { VIEWS } from './views.js'
* modules, excluding dependencies. * modules, excluding dependencies.
*/ */
// Requirements // Requirements
// const { ipcRenderer } = require('electron') const $ = require('jquery')
const isDev = await window.api.app.isDev() const {ipcRenderer, shell, webFrame} = require('electron')
// const { LoggerUtil } = require('helios-core') const remote = require('@electron/remote')
// const Lang = require('./assets/js/langloader') const isDev = require('./assets/js/isdev')
const { LoggerUtil } = require('helios-core')
const Lang = require('./assets/js/langloader')
// const loggerUICore = LoggerUtil.getLogger('UICore') const loggerUICore = LoggerUtil.getLogger('UICore')
// const loggerAutoUpdater = LoggerUtil.getLogger('AutoUpdater') const loggerAutoUpdater = LoggerUtil.getLogger('AutoUpdater')
// Log deprecation and process warnings.
process.traceProcessWarnings = true
process.traceDeprecation = true
// Disable eval function. // Disable eval function.
// eslint-disable-next-line // eslint-disable-next-line
window.eval = function () { window.eval = global.eval = function () {
throw new Error('Sorry, this app does not support window.eval().') throw new Error('Sorry, this app does not support window.eval().')
} }
// Display warning when devtools window is opened.
remote.getCurrentWebContents().on('devtools-opened', () => {
console.log('%cThe console is dark and full of terrors.', 'color: white; -webkit-text-stroke: 4px #a02d2a; font-size: 60px; font-weight: bold')
console.log('%cIf you\'ve been told to paste something here, you\'re being scammed.', 'font-size: 16px')
console.log('%cUnless you know exactly what you\'re doing, close this window.', 'font-size: 16px')
})
// Disable zoom, needed for darwin.
webFrame.setZoomLevel(0)
webFrame.setVisualZoomLevelLimits(1, 1)
// Initialize auto updates in production environments. // Initialize auto updates in production environments.
let updateCheckListener let updateCheckListener
if(!isDev){ if(!isDev){
ipcRenderer.on('autoUpdateNotification', (event, arg, info) => { ipcRenderer.on('autoUpdateNotification', (event, arg, info) => {
switch(arg){ switch(arg){
case 'checking-for-update': case 'checking-for-update':
// loggerAutoUpdater.info('Checking for update..') loggerAutoUpdater.info('Checking for update..')
settingsUpdateButtonStatus(Lang.queryJS('uicore.autoUpdate.checkingForUpdateButton'), true) settingsUpdateButtonStatus(Lang.queryJS('uicore.autoUpdate.checkingForUpdateButton'), true)
break break
case 'update-available': case 'update-available':
// loggerAutoUpdater.info('New update available', info.version) loggerAutoUpdater.info('New update available', info.version)
if(process.platform() === 'darwin'){ if(process.platform === 'darwin'){
info.darwindownload = `https://github.com/dscalzi/HeliosLauncher/releases/download/v${info.version}/Helios-Launcher-setup-${info.version}${process.arch() === 'arm64' ? '-arm64' : '-x64'}.dmg` info.darwindownload = `https://git.onimai.ru/ONIMAI-SMP/Launcher/releases/download/v${info.version}/ONIMAI.RU-MC-Launcher-setup-${info.version}${process.arch === 'arm64' ? '-arm64' : '-x64'}.dmg`
showUpdateUI(info) showUpdateUI(info)
} }
populateSettingsUpdateInformation(info) populateSettingsUpdateInformation(info)
break break
case 'update-downloaded': case 'update-downloaded':
// loggerAutoUpdater.info('Update ' + info.version + ' ready to be installed.') loggerAutoUpdater.info('Update ' + info.version + ' ready to be installed.')
settingsUpdateButtonStatus(Lang.queryJS('uicore.autoUpdate.installNowButton'), false, () => { settingsUpdateButtonStatus(Lang.queryJS('uicore.autoUpdate.installNowButton'), false, () => {
if(!isDev){ if(!isDev){
ipcRenderer.send('autoUpdateAction', 'installUpdateNow') ipcRenderer.send('autoUpdateAction', 'installUpdateNow')
@ -50,7 +65,7 @@ if(!isDev){
showUpdateUI(info) showUpdateUI(info)
break break
case 'update-not-available': case 'update-not-available':
// loggerAutoUpdater.info('No new update found.') loggerAutoUpdater.info('No new update found.')
settingsUpdateButtonStatus(Lang.queryJS('uicore.autoUpdate.checkForUpdatesButton')) settingsUpdateButtonStatus(Lang.queryJS('uicore.autoUpdate.checkForUpdatesButton'))
break break
case 'ready': case 'ready':
@ -62,17 +77,17 @@ if(!isDev){
case 'realerror': case 'realerror':
if(info != null && info.code != null){ if(info != null && info.code != null){
if(info.code === 'ERR_UPDATER_INVALID_RELEASE_FEED'){ if(info.code === 'ERR_UPDATER_INVALID_RELEASE_FEED'){
// loggerAutoUpdater.info('No suitable releases found.') loggerAutoUpdater.info('No suitable releases found.')
} else if(info.code === 'ERR_XML_MISSED_ELEMENT'){ } else if(info.code === 'ERR_XML_MISSED_ELEMENT'){
// loggerAutoUpdater.info('No releases found.') loggerAutoUpdater.info('No releases found.')
} else { } else {
// loggerAutoUpdater.error('Error during update check..', info) loggerAutoUpdater.error('Error during update check..', info)
// loggerAutoUpdater.debug('Error Code:', info.code) loggerAutoUpdater.debug('Error Code:', info.code)
} }
} }
break break
default: default:
// loggerAutoUpdater.info('Unknown argument', arg) loggerAutoUpdater.info('Unknown argument', arg)
break break
} }
}) })
@ -118,62 +133,72 @@ $(function(){
loggerUICore.info('UICore Initialized'); loggerUICore.info('UICore Initialized');
})*/ })*/
// loggerUICore.info('UICore Initializing..') document.addEventListener('readystatechange', function () {
if (document.readyState === 'interactive'){
loggerUICore.info('UICore Initializing..')
// Bind close button. // Bind close button.
Array.from(document.getElementsByClassName('fCb')).map((val) => { Array.from(document.getElementsByClassName('fCb')).map((val) => {
val.addEventListener('click', async e => { val.addEventListener('click', e => {
await window.api.xwindow.close() const window = remote.getCurrentWindow()
}) window.close()
}) })
})
// Bind restore down button. // Bind restore down button.
Array.from(document.getElementsByClassName('fRb')).map((val) => { Array.from(document.getElementsByClassName('fRb')).map((val) => {
val.addEventListener('click', async e => { val.addEventListener('click', e => {
if(await window.api.xwindow.isMaximized()){ const window = remote.getCurrentWindow()
await window.api.xwindow.unmaximize() if(window.isMaximized()){
} else { window.unmaximize()
await window.api.xwindow.maximize() } else {
} window.maximize()
document.activeElement.blur() }
}) document.activeElement.blur()
}) })
})
// Bind minimize button. // Bind minimize button.
Array.from(document.getElementsByClassName('fMb')).map((val) => { Array.from(document.getElementsByClassName('fMb')).map((val) => {
val.addEventListener('click', async e => { val.addEventListener('click', e => {
console.log('hi') const window = remote.getCurrentWindow()
await window.api.xwindow.minimize() window.minimize()
document.activeElement.blur() document.activeElement.blur()
}) })
}) })
// Remove focus from social media buttons once they're clicked. // Remove focus from social media buttons once they're clicked.
Array.from(document.getElementsByClassName('mediaURL')).map(val => { Array.from(document.getElementsByClassName('mediaURL')).map(val => {
val.addEventListener('click', e => { val.addEventListener('click', e => {
document.activeElement.blur() document.activeElement.blur()
}) })
}) })
//266.01 } else if(document.readyState === 'complete'){
//170.8
//53.21
// Bind progress bar length to length of bot wrapper
//const targetWidth = document.getElementById("launch_content").getBoundingClientRect().width
//const targetWidth2 = document.getElementById("server_selection").getBoundingClientRect().width
//const targetWidth3 = document.getElementById("launch_button").getBoundingClientRect().width
document.getElementById('launch_details').style.maxWidth = 266.01 //266.01
document.getElementById('launch_progress').style.width = 170.8 //170.8
document.getElementById('launch_details_right').style.maxWidth = 170.8 //53.21
document.getElementById('launch_progress_label').style.width = 53.21 // Bind progress bar length to length of bot wrapper
//const targetWidth = document.getElementById("launch_content").getBoundingClientRect().width
//const targetWidth2 = document.getElementById("server_selection").getBoundingClientRect().width
//const targetWidth3 = document.getElementById("launch_button").getBoundingClientRect().width
document.getElementById('launch_details').style.maxWidth = 266.01
document.getElementById('launch_progress').style.width = 170.8
document.getElementById('launch_details_right').style.maxWidth = 170.8
document.getElementById('launch_progress_label').style.width = 53.21
}
}, false)
/** /**
* Open web links in the user's default browser. * Open web links in the user's default browser.
*/ */
$(document).on('click', 'a[href^="http"]', async (event) => { $(document).on('click', 'a[href^="http"]', function(event) {
event.preventDefault() event.preventDefault()
await window.api.shell.openExternal(this.href) shell.openExternal(this.href)
}) })
/** /**
@ -181,8 +206,9 @@ $(document).on('click', 'a[href^="http"]', async (event) => {
* This will crash the program if you are using multiple * This will crash the program if you are using multiple
* DevTools, for example the chrome debugger in VS Code. * DevTools, for example the chrome debugger in VS Code.
*/ */
document.addEventListener('keydown', async (e) => { document.addEventListener('keydown', function (e) {
if((e.key === 'I' || e.key === 'i') && e.ctrlKey && e.shiftKey){ if((e.key === 'I' || e.key === 'i') && e.ctrlKey && e.shiftKey){
await window.api.xwindow.toggleDevTools() let window = remote.getCurrentWindow()
window.toggleDevTools()
} }
}) })

View File

@ -1,9 +0,0 @@
// Mapping of each view to their container IDs.
export const VIEWS = {
landing: '#landingContainer',
loginOptions: '#loginOptionsContainer',
login: '#loginContainer',
settings: '#settingsContainer',
welcome: '#welcomeContainer',
waiting: '#waitingContainer'
}

View File

@ -1,5 +1,3 @@
import { VIEWS } from './views.js'
/** /**
* Script for welcome.ejs * Script for welcome.ejs
*/ */

View File

@ -1,20 +1,20 @@
# Custom Language File for Launcher Customizer # Custom Language File for Launcher Customizer
[ejs.app] [ejs.app]
title = "Helios Launcher" title = "ONIMAI.RU MC Launcher"
[ejs.landing] [ejs.landing]
mediaGitHubURL = "https://github.com/dscalzi/HeliosLauncher" mediaGitHubURL = "https://onimai.ru"
mediaTwitterURL = "#" mediaTwitterURL = "#"
mediaInstagramURL = "#" mediaInstagramURL = "#"
mediaYouTubeURL = "#" mediaYouTubeURL = "#"
mediaDiscordURL = "https://discord.gg/zNWUXdt" mediaDiscordURL = "https://ds.onimai.ru"
[ejs.settings] [ejs.settings]
sourceGithubLink = "https://github.com/dscalZi/HeliosLauncher" sourceGithubLink = "https://git.onimai.ru/ONIMAI-SMP/Launcher"
supportLink = "https://github.com/dscalZi/HeliosLauncher/issues" supportLink = "https://git.onimai.ru/ONIMAI-SMP/Launcher/issues"
[ejs.welcome] [ejs.welcome]
welcomeHeader = "WELCOME TO WESTEROSCRAFT" welcomeHeader = "ДОБРО ПОЖАЛОВАТЬ!"
welcomeDescription = "Our mission is to recreate the universe imagined by author George RR Martin in his fantasy series, A Song of Ice and Fire. Through the collaborative effort of thousands of community members, we have sought to create Westeros as accurately and precisely as possible within Minecraft. The world we are creating is yours to explore. Journey from Dorne to Castle Black, and if you arent afraid, beyond the Wall itself, but best not delay. As the words of House Stark ominously warn: Winter is Coming." welcomeDescription = "Спасибо что скачали наш лаунчер! В первую очередь он предназначен для удобной игры на наших серверах. С данным лаунчером вы сможете не ебаться с ручным обновлением, а обновлять сборку одним нажатием кнопки. Удачной игры"
welcomeDescCTA = "You are just a few clicks away from Westeros." welcomeDescCTA = "Пара нажатий и ты на сервере"

View File

@ -1,297 +1,317 @@
[ejs.landing] [ejs.landing]
updateAvailableTooltip = "Update Available" updateAvailableTooltip = "Доступно обновление"
usernamePlaceholder = "Username" usernamePlaceholder = "Имя пользователя"
usernameEditButton = "Edit" usernameEditButton = "Редактировать"
settingsTooltip = "Settings" settingsTooltip = "Настройки"
serverStatus = "SERVER" serverStatus = "СЕРВЕР"
serverStatusPlaceholder = "OFFLINE" serverStatusPlaceholder = "ОФФЛАЙН"
mojangStatus = "MOJANG STATUS" mojangStatus = "СТАТУС MOJANG"
mojangStatusTooltipTitle = "Services" mojangStatusTooltipTitle = "Сервисы"
mojangStatusNETitle = "Non&nbsp;Essential" mojangStatusNETitle = "Необязательно"
newsButton = "NEWS" newsButton = "НОВОСТИ"
launchButton = "PLAY" launchButton = "ИГРАТЬ"
launchButtonPlaceholder = "&#8226; No Server Selected" launchButtonPlaceholder = "&#8226; Сервер не выбран"
launchDetails = "Please wait.." launchDetails = "Пожалуйста, подождите.."
newsNavigationStatus = "{currentPage} of {totalPages}" newsNavigationStatus = "{currentPage} из {totalPages}"
newsErrorLoadSpan = "Checking for News.." newsErrorLoadSpan = "Проверка новостей.."
newsErrorFailedSpan = "Failed to Load News" newsErrorFailedSpan = "Не удалось загрузить новости"
newsErrorRetryButton = "Try Again" newsErrorRetryButton = "Попробовать снова"
newsErrorNoneSpan = "No News" newsErrorNoneSpan = "Новостей нет"
[ejs.login] [ejs.login]
loginCancelText = "Cancel" loginCancelText = "Отмена"
loginSubheader = "MINECRAFT LOGIN" loginSubheader = "ВХОД В MINECRAFT"
loginEmailError = "* Invalid Value" loginEmailError = "* Неверное значение"
loginEmailPlaceholder = "EMAIL OR USERNAME" loginEmailPlaceholder = "EMAIL ИЛИ ИМЯ ПОЛЬЗОВАТЕЛЯ"
loginPasswordError = "* Required" loginPasswordError = "* Обязательное поле"
loginPasswordPlaceholder = "PASSWORD" loginPasswordPlaceholder = "ПАРОЛЬ"
loginForgotPasswordLink = "https://minecraft.net/password/forgot/" loginForgotPasswordLink = "https://minecraft.net/password/forgot/"
loginForgotPasswordText = "forgot password?" loginForgotPasswordText = "забыли пароль?"
loginRememberMeText = "remember me?" loginRememberMeText = "запомнить меня?"
loginButtonText = "LOGIN" loginButtonText = "ВОЙТИ"
loginNeedAccountLink = "https://minecraft.net/store/minecraft-java-edition/" loginNeedAccountLink = "https://minecraft.net/store/minecraft-java-edition/"
loginNeedAccountText = "Need an Account?" loginNeedAccountText = "Нужен аккаунт?"
loginPasswordDisclaimer1 = "Your password is sent directly to mojang and never stored." loginPasswordDisclaimer1 = "Ваш пароль отправляется напрямую в Mojang и никогда не сохраняется."
loginPasswordDisclaimer2 = "{appName} is not affiliated with Mojang AB." loginPasswordDisclaimer2 = "{appName} не связан с Mojang AB."
[ejs.loginOptions] [ejs.loginOptions]
loginOptionsTitle = "Login Options" loginOptionsTitle = "Опции входа"
loginWithMicrosoft = "Login with Microsoft" loginWithMicrosoft = "Войти через Microsoft"
loginWithMojang = "Login with Mojang" loginWithMojang = "Войти через Mojang"
cancelButton = "Cancel" loginWithOffline = "Вход через Пиратку"
cancelButton = "Отмена"
[ejs.overlay] [ejs.overlay]
serverSelectHeader = "Available Servers" serverSelectHeader = "Доступные серверы"
serverSelectConfirm = "Select" serverSelectConfirm = "Выбрать"
serverSelectCancel = "Cancel" serverSelectCancel = "Отмена"
accountSelectHeader = "Select an Account" accountSelectHeader = "Выберите аккаунт"
accountSelectConfirm = "Select" accountSelectConfirm = "Выбрать"
accountSelectCancel = "Cancel" accountSelectCancel = "Отмена"
[ejs.settings] [ejs.settings]
navHeaderText = "Settings" navHeaderText = "Настройки"
navAccount = "Account" navAccount = "Аккаунт"
navMinecraft = "Minecraft" navMinecraft = "Minecraft"
navMods = "Mods" navMods = "Моды"
navJava = "Java" navJava = "Java"
navLauncher = "Launcher" navLauncher = "Лаунчер"
navAbout = "About" navAbout = "О программе"
navUpdates = "Updates" navUpdates = "Обновления"
navDone = "Done" navDone = "Готово"
tabAccountHeaderText = "Account Settings" tabAccountHeaderText = "Настройки аккаунта"
tabAccountHeaderDesc = "Add new accounts or manage existing ones." tabAccountHeaderDesc = "Добавляйте новые аккаунты или управляйте существующими."
microsoftAccount = "Microsoft" microsoftAccount = "Microsoft"
addMicrosoftAccount = "+ Add Microsoft Account" addMicrosoftAccount = "+ Добавить аккаунт Microsoft"
mojangAccount = "Mojang" mojangAccount = "Mojang"
addMojangAccount = "+ Add Mojang Account" offlineAccount = "Аккаунт Пиратка"
minecraftTabHeaderText = "Minecraft Settings" addMojangAccount = "+ Добавить аккаунт Mojang"
minecraftTabHeaderDesc = "Options related to game launch." minecraftTabHeaderText = "Настройки Minecraft"
gameResolutionTitle = "Game Resolution" minecraftTabHeaderDesc = "Параметры, связанные с запуском игры."
launchFullscreenTitle = "Launch in fullscreen." gameResolutionTitle = "Разрешение игры"
autoConnectTitle = "Automatically connect to the server on launch." launchFullscreenTitle = "Запуск в полноэкранном режиме."
launchDetachedTitle = "Launch game process detached from launcher." autoConnectTitle = "Автоматически подключаться к серверу при запуске."
launchDetachedDesc = "If the game is not detached, closing the launcher will also close the game." launchDetachedTitle = "Запускать игру отдельно от лаунчера."
tabModsHeaderText = "Mod Settings" launchDetachedDesc = "Если игра не запущена отдельно, закрытие лаунчера приведет к закрытию игры."
tabModsHeaderDesc = "Enable or disable mods." tabModsHeaderText = "Настройки модов"
switchServerButton = "Switch" tabModsHeaderDesc = "Включайте или отключайте моды."
requiredMods = "Required Mods" switchServerButton = "Сменить сервер"
optionalMods = "Optional Mods" requiredMods = "Обязательные моды"
dropinMods = "Drop-in Mods" optionalMods = "Дополнительные моды"
addMods = "Add Mods" dropinMods = "Установленные моды"
dropinRefreshNote = "(F5 to Refresh)" addMods = "Добавить моды"
shaderpacks = "Shaderpacks" dropinRefreshNote = "(Нажмите F5 для обновления)"
shaderpackDesc = "Enable or disable shaders. Please note, shaders will only run smoothly on powerful setups. You may add custom packs here." shaderpacks = "Шейдерпаки"
selectShaderpack = "Select Shaderpack" shaderpackDesc = "Включайте или отключайте шейдеры. Учтите, что они требуют мощного компьютера. Вы можете добавлять собственные шейдерпаки здесь."
tabJavaHeaderText = "Java Settings" selectShaderpack = "Выбрать шейдерпак"
tabJavaHeaderDesc = "Manage the Java configuration (advanced)." tabJavaHeaderText = "Настройки Java"
memoryTitle = "Memory" tabJavaHeaderDesc = "Управление конфигурацией Java (для продвинутых пользователей)."
maxRAM = "Maximum RAM" memoryTitle = "Память"
minRAM = "Minimum RAM" maxRAM = "Максимальный объем RAM"
memoryDesc = "The recommended minimum RAM is 3 gigabytes. Setting the minimum and maximum values to the same value may reduce lag." minRAM = "Минимальный объем RAM"
memoryTotalTitle = "Total" memoryDesc = "Рекомендуемый минимум RAM — 3 ГБ. Установка одинаковых значений для минимума и максимума может снизить лаги."
memoryAvailableTitle = "Available" memoryTotalTitle = "Всего"
javaExecutableTitle = "Java Executable" memoryAvailableTitle = "Доступно"
javaExecSelDialogTitle = "Select Java Executable" javaExecutableTitle = "Исполняемый файл Java"
javaExecSelButtonText = "Choose File" javaExecSelDialogTitle = "Выберите исполняемый файл Java"
javaExecDesc = "The Java executable is validated before game launch." javaExecSelButtonText = "Выбрать файл"
javaPathDesc = "The path should end with <strong>{pathSuffix}</strong>." javaExecDesc = "Исполняемый файл Java проверяется перед запуском игры."
jvmOptsTitle = "Additional JVM Options" javaPathDesc = "Путь должен заканчиваться на <strong>{pathSuffix}</strong>."
jvmOptsDesc = "Options to be provided to the JVM at runtime. <em>-Xms</em> and <em>-Xmx</em> should not be included." jvmOptsTitle = "Дополнительные параметры JVM"
launcherTabHeaderText = "Launcher Settings" jvmOptsDesc = "Опции, передаваемые JVM во время выполнения. <em>-Xms</em> и <em>-Xmx</em> не должны включаться."
launcherTabHeaderDesc = "Options related to the launcher itself." launcherTabHeaderText = "Настройки лаунчера"
allowPrereleaseTitle = "Allow Pre-Release Updates." launcherTabHeaderDesc = "Параметры, связанные с самим лаунчером."
allowPrereleaseDesc = "Pre-Releases include new features which may have not been fully tested or integrated.<br>This will always be true if you are using a pre-release version." allowPrereleaseTitle = "Разрешить обновления предварительных версий."
dataDirectoryTitle = "Data Directory" allowPrereleaseDesc = "Предварительные версии включают новые функции, которые могут быть недостаточно протестированы.<br>Этот параметр всегда включен, если вы используете предварительную версию."
selectDataDirectory = "Select Data Directory" dataDirectoryTitle = "Директория данных"
chooseFolder = "Choose Folder" selectDataDirectory = "Выбрать директорию данных"
dataDirectoryDesc = "All game files and local Java installations will be stored in the data directory.<br>Screenshots and world saves are stored in the instance folder for the corresponding server configuration." chooseFolder = "Выбрать папку"
aboutTabHeaderText = "About" dataDirectoryDesc = "Все игровые файлы и локальные установки Java будут храниться в этой директории.<br>Скриншоты и сохранения миров хранятся в папке экземпляра соответствующей конфигурации сервера."
aboutTabHeaderDesc = "View information and release notes for the current version." aboutTabHeaderText = "О программе"
aboutTabHeaderDesc = "Просмотр информации и заметок о текущей версии."
aboutTitle = "{appName}" aboutTitle = "{appName}"
stableRelease = "Stable Release" stableRelease = "Стабильный релиз"
versionText = "Version " versionText = "Версия "
sourceGithub = "Source (GitHub)" sourceGithub = "Исходный код (GitHub)"
support = "Support" support = "Поддержка"
devToolsConsole = "DevTools Console" devToolsConsole = "Консоль DevTools"
releaseNotes = "Release Notes" releaseNotes = "Примечания к выпуску"
changelog = "Changelog" changelog = "История изменений"
noReleaseNotes = "No Release Notes" noReleaseNotes = "Нет примечаний к выпуску"
viewReleaseNotes = "View Release Notes on GitHub" viewReleaseNotes = "Просмотреть примечания к выпуску на GitHub"
launcherUpdatesHeaderText = "Launcher Updates" launcherUpdatesHeaderText = "Обновления лаунчера"
launcherUpdatesHeaderDesc = "Download, install, and review updates for the launcher." launcherUpdatesHeaderDesc = "Загрузка, установка и просмотр обновлений лаунчера."
checkForUpdates = "Check for Updates" checkForUpdates = "Проверить обновления"
whatsNew = "What's New" whatsNew = "Что нового"
updateReleaseNotes = "Update Release Notes" updateReleaseNotes = "Примечания к обновлению"
[ejs.waiting] [ejs.waiting]
waitingText = "Waiting for Microsoft.." waitingText = "Ожидание Microsoft.."
[ejs.welcome] [ejs.welcome]
continueButton = "CONTINUE" continueButton = "ПРОДОЛЖИТЬ"
[js.discord] [js.discord]
waiting = "Waiting for Client.." waiting = "Ожидание клиента.."
state = "Server: {shortId}" state = "Сервер: {shortId}"
[js.index] [js.index]
microsoftLoginTitle = "Microsoft Login" microsoftLoginTitle = "Вход через Microsoft"
microsoftLogoutTitle = "Microsoft Logout" microsoftLogoutTitle = "Выход из Microsoft"
[js.login] [js.login]
login = "LOGIN" login = "ВОЙТИ"
loggingIn = "LOGGING IN" loggingIn = "ВХОД В СИСТЕМУ"
success = "SUCCESS" success = "УСПЕШНО"
tryAgain = "Try Again" tryAgain = "Попробовать снова"
[js.login.error] [js.login.error]
invalidValue = "* Invalid Value" invalidValue = "* Неверное значение"
requiredValue = "* Required" requiredValue = "* Обязательное поле"
[js.login.error.unknown] [js.login.error.unknown]
title = "Unknown Error During Login" title = "Неизвестная ошибка при входе"
desc = "An unknown error has occurred. Please see the console for details." desc = "Произошла неизвестная ошибка. Подробности можно посмотреть в консоли."
[js.landing.launch] [js.landing.launch]
pleaseWait = "Please wait.." pleaseWait = "Пожалуйста, подождите.."
failureTitle = "Error During Launch" failureTitle = "Ошибка при запуске"
failureText = "See console (CTRL + Shift + i) for more details." failureText = "Смотрите консоль (CTRL + Shift + I) для подробностей."
okay = "Okay" okay = "ОК"
[js.landing.selectedAccount] [js.landing.selectedAccount]
noAccountSelected = "No Account Selected" noAccountSelected = "Аккаунт не выбран"
[js.landing.selectedServer] [js.landing.selectedServer]
noSelection = "No Server Selected" noSelection = "Сервер не выбран"
loading = "Loading.." loading = "Загрузка.."
[js.landing.serverStatus] [js.landing.serverStatus]
server = "SERVER" server = "СЕРВЕР"
offline = "OFFLINE" offline = "ОФФЛАЙН"
players = "PLAYERS" players = "ИГРОКИ"
[js.landing.systemScan] [js.landing.systemScan]
checking = "Checking system info.." checking = "Проверка информации о системе.."
noCompatibleJava = "No Compatible<br>Java Installation Found" noCompatibleJava = "Совместимая<br>установка Java не найдена"
installJavaMessage = "In order to launch Minecraft, you need a 64-bit installation of Java {major}. Would you like us to install a copy?" installJavaMessage = "Для запуска Minecraft требуется 64-битная версия Java {major}. Установить её сейчас?"
installJava = "Install Java" installJava = "Установить Java"
installJavaManually = "Install Manually" installJavaManually = "Установить вручную"
javaDownloadPrepare = "Preparing Java Download.." javaDownloadPrepare = "Подготовка загрузки Java.."
javaDownloadFailureTitle = "Error During Java Download" javaDownloadFailureTitle = "Ошибка загрузки Java"
javaDownloadFailureText = "See console (CTRL + Shift + i) for more details." javaDownloadFailureText = "Смотрите консоль (CTRL + Shift + I) для подробностей."
javaRequired = "Java is Required<br>to Launch" javaRequired = "Для запуска требуется Java"
javaRequiredMessage = 'A valid x64 installation of Java {major} is required to launch.<br><br>Please refer to our <a href="https://github.com/dscalzi/HeliosLauncher/wiki/Java-Management#manually-installing-a-valid-version-of-java">Java Management Guide</a> for instructions on how to manually install Java.' javaRequiredMessage = "Для запуска необходима действительная 64-битная установка Java {major}.<br><br>Пожалуйста, ознакомьтесь с нашим <a href=\"https://github.com/dscalzi/HeliosLauncher/wiki/Java-Management#manually-installing-a-valid-version-of-java\">Руководством по управлению Java</a>, чтобы установить её вручную."
javaRequiredDismiss = "I Understand" javaRequiredDismiss = "Понял"
javaRequiredCancel = "Go Back" javaRequiredCancel = "Назад"
[js.landing.downloadJava] [js.landing.downloadJava]
findJdkFailure = "Failed to find OpenJDK distribution." findJdkFailure = "Не удалось найти дистрибутив OpenJDK."
javaDownloadCorruptedError = "Downloaded JDK has a bad hash, the file may be corrupted." javaDownloadCorruptedError = "Загруженный JDK поврежден, файл может быть испорчен."
extractingJava = "Extracting Java" extractingJava = "Распаковка Java"
javaInstalled = "Java Installed!" javaInstalled = "Java установлена!"
[js.landing.dlAsync] [js.landing.dlAsync]
loadingServerInfo = "Loading server information.." loadingServerInfo = "Загрузка информации о сервере.."
fatalError = "Fatal Error" fatalError = "Критическая ошибка"
unableToLoadDistributionIndex = "Could not load a copy of the distribution index. See the console (CTRL + Shift + i) for more details." unableToLoadDistributionIndex = "Не удалось загрузить индекс дистрибуции. Смотрите консоль (CTRL + Shift + I) для подробностей."
pleaseWait = "Please wait.." pleaseWait = "Пожалуйста, подождите.."
errorDuringLaunchTitle = "Error During Launch" errorDuringLaunchTitle = "Ошибка при запуске"
seeConsoleForDetails = "See console (CTRL + Shift + i) for more details." seeConsoleForDetails = "Смотрите консоль (CTRL + Shift + I) для подробностей."
validatingFileIntegrity = "Validating file integrity.." validatingFileIntegrity = "Проверка целостности файлов.."
errorDuringFileVerificationTitle = "Error During File Verification" errorDuringFileVerificationTitle = "Ошибка при проверке файлов"
downloadingFiles = "Downloading files.." downloadingFiles = "Загрузка файлов.."
errorDuringFileDownloadTitle = "Error During File Download" errorDuringFileDownloadTitle = "Ошибка при загрузке файлов"
preparingToLaunch = "Preparing to launch.." preparingToLaunch = "Подготовка к запуску.."
launchingGame = "Launching game.." launchingGame = "Запуск игры.."
launchWrapperNotDownloaded = "The main file, LaunchWrapper, failed to download properly. As a result, the game cannot launch.<br><br>To fix this issue, temporarily turn off your antivirus software and launch the game again.<br><br>If you have time, please <a href=\"https://github.com/dscalzi/HeliosLauncher/issues\">submit an issue</a> and let us know what antivirus software you use. We'll contact them and try to straighten things out." launchWrapperNotDownloaded = "Основной файл, LaunchWrapper, не был загружен должным образом. В результате игра не может быть запущена.<br><br>Чтобы исправить эту проблему, временно отключите антивирусное ПО и попробуйте снова.<br><br>Если у вас есть время, пожалуйста, <a href=\"https://github.com/dscalzi/HeliosLauncher/issues\">сообщите об этой проблеме</a> и укажите, каким антивирусом вы пользуетесь. Мы постараемся связаться с разработчиками антивируса и решить проблему."
doneEnjoyServer = "Done. Enjoy the server!" doneEnjoyServer = "Готово. Наслаждайтесь сервером!"
checkConsoleForDetails = "Please check the console (CTRL + Shift + i) for more details." checkConsoleForDetails = "Пожалуйста, проверьте консоль (CTRL + Shift + I) для подробностей."
[js.landing.news] [js.landing.news]
checking = "Checking for News" checking = "Проверка новостей"
[js.landing.discord] [js.landing.discord]
loading = "Loading game.." loading = "Загрузка игры.."
joining = "Sailing to Westeros!" joining = "Путешествие в Вестерос!"
joined = "Exploring the Realm!" joined = "Исследование мира!"
[js.overlay] [js.overlay]
dismiss = "Dismiss" dismiss = "Закрыть"
[js.settings.fileSelectors] [js.settings.fileSelectors]
executables = "Executables" executables = "Исполняемые файлы"
allFiles = "All Files" allFiles = "Все файлы"
[js.settings.mstfLogin] [js.settings.mstfLogin]
errorTitle = "Something Went Wrong" errorTitle = "Что-то пошло не так"
errorMessage = "Microsoft authentication failed. Please try again." errorMessage = "Ошибка аутентификации Microsoft. Попробуйте еще раз."
okButton = "OK" okButton = "ОК"
[js.settings.mstfLogout] [js.settings.mstfLogout]
errorTitle = "Something Went Wrong" errorTitle = "Что-то пошло не так"
errorMessage = "Microsoft logout failed. Please try again." errorMessage = "Ошибка выхода из Microsoft. Попробуйте еще раз."
okButton = "OK" okButton = "ОК"
[js.settings.authAccountSelect]
selectButton = "Select Account"
selectedButton = "Selected Account &#10004;"
[js.settings.authAccountLogout]
lastAccountWarningTitle = "Warning<br>This is Your Last Account"
lastAccountWarningMessage = "In order to use the launcher you must be logged into at least one account. You will need to login again after.<br><br>Are you sure you want to log out?"
confirmButton = "I'm Sure"
cancelButton = "Cancel"
[js.settings.authAccountPopulate]
username = "Username"
uuid = "UUID"
selectAccount = "Select Account"
selectedAccount = "Selected Account ✓"
logout = "Log Out"
[js.settings.dropinMods] [js.settings.dropinMods]
removeButton = "Remove" removeButton = "Удалить"
deleteFailedTitle = "Failed to Delete<br>Drop-in Mod {fullName}" deleteFailedTitle = "Ошибка удаления<br>мода {fullName}"
deleteFailedMessage = "Make sure the file is not in use and try again." deleteFailedMessage = "Убедитесь, что файл не используется, и попробуйте снова."
failedToggleTitle = "Failed to Toggle<br>One or More Drop-in Mods" failedToggleTitle = "Ошибка переключения<br>одного или нескольких установленных модов"
okButton = "Okay" okButton = "ОК"
[js.settings.serverListing] [js.settings.serverListing]
mainServer = "Main Server" mainServer = "Основной сервер"
[js.settings.java] [js.settings.java]
selectedJava = "Selected: Java {version} ({vendor})" selectedJava = "Выбрано: Java {version} ({vendor})"
invalidSelection = "Invalid Selection" invalidSelection = "Некорректный выбор"
requiresJava = "Requires Java {major} x64." requiresJava = "Требуется Java {major} x64."
availableOptions = "Available Options for Java {major} (HotSpot VM)" availableOptions = "Доступные версии Java {major} (HotSpot VM)"
[js.settings.about] [js.settings.about]
preReleaseTitle = "Pre-release" preReleaseTitle = "Предварительная версия"
stableReleaseTitle = "Stable Release" stableReleaseTitle = "Стабильная версия"
releaseNotesFailed = "Failed to load release notes." releaseNotesFailed = "Не удалось загрузить примечания к выпуску."
[js.settings.updates] [js.settings.updates]
newReleaseTitle = "New Release Available" newReleaseTitle = "Доступно новое обновление"
newPreReleaseTitle = "New Pre-release Available" newPreReleaseTitle = "Доступна новая предварительная версия"
downloadingButton = "Downloading.." downloadingButton = "Загрузка.."
downloadButton = 'Download from GitHub<span style="font-size: 10px;color: gray;text-shadow: none !important;">Close the launcher and run the dmg to update.</span>' downloadButton = 'Загрузить с GitHub<span style="font-size: 10px;color: gray;text-shadow: none !important;">Закройте лаунчер и запустите установщик для обновления.</span>'
latestVersionTitle = "You Are Running the Latest Version" latestVersionTitle = "У вас установлена последняя версия"
checkForUpdatesButton = "Check for Updates" checkForUpdatesButton = "Проверить обновления"
checkingForUpdatesButton = "Checking for Updates.." checkingForUpdatesButton = "Проверка обновлений.."
[js.settings.msftLogin]
errorTitle = "Ошибка входа в Microsoft"
errorMessage = "Не удалось выполнить аутентификацию в Microsoft. Попробуйте снова."
okButton = "ОК"
[js.settings.authAccountSelect]
selectButton = "Выбрать аккаунт"
selectedButton = "Выбранный аккаунт &#10004;"
[js.settings.authAccountLogout]
lastAccountWarningTitle = "Внимание<br>Это ваш последний аккаунт"
lastAccountWarningMessage = "Для использования лаунчера необходимо быть авторизованным хотя бы в одном аккаунте. После выхода вам придется войти снова.<br><br>Вы уверены, что хотите выйти?"
confirmButton = "Я уверен"
cancelButton = "Отмена"
[js.settings.authAccountPopulate]
username = "Имя пользователя"
uuid = "UUID"
selectAccount = "Выбрать аккаунт"
selectedAccount = "Выбранный аккаунт ✓"
logout = "Выйти"
[js.uibinder.startup] [js.uibinder.startup]
fatalErrorTitle = "Fatal Error: Unable to Load Distribution Index" fatalErrorTitle = "Критическая ошибка: невозможно загрузить индекс дистрибуции"
fatalErrorMessage = "A connection could not be established to our servers to download the distribution index. No local copies were available to load. <br><br>The distribution index is an essential file which provides the latest server information. The launcher is unable to start without it. Ensure you are connected to the internet and relaunch the application." fatalErrorMessage = "Не удалось установить соединение с нашими серверами для загрузки индекса дистрибуции. Локальные копии отсутствуют.<br><br>Индекс дистрибуции — это важный файл, который содержит актуальную информацию о сервере. Лаунчер не сможет запуститься без него. Убедитесь, что у вас есть подключение к интернету, и перезапустите приложение."
closeButton = "Close" closeButton = "Закрыть"
[js.uibinder.validateAccount] [js.uibinder.validateAccount]
failedMessageTitle = "Failed to Refresh Login" failedMessageTitle = "Ошибка обновления входа"
failedMessage = "We were unable to refresh the login for <strong>{account}</strong>. Please select another account or login again." failedMessage = "Не удалось обновить вход для <strong>{account}</strong>. Пожалуйста, выберите другой аккаунт или войдите снова."
failedMessageSelectAnotherAccount = "We were unable to refresh the login for <strong>{account}</strong>. Please login again." failedMessageSelectAnotherAccount = "Не удалось обновить вход для <strong>{account}</strong>. Пожалуйста, войдите снова."
loginButton = "Login" loginButton = "Войти"
selectAnotherAccountButton = "Select Another Account" selectAnotherAccountButton = "Выбрать другой аккаунт"
[js.uicore.autoUpdate] [js.uicore.autoUpdate]
checkingForUpdateButton = "Checking for Updates..." checkingForUpdateButton = "Проверка обновлений..."
installNowButton = "Install Now" installNowButton = "Установить сейчас"
checkForUpdatesButton = "Check for Updates" checkForUpdatesButton = "Проверить обновления"
[js.auth.microsoft.error]
noProfileTitle = "Ошибка входа:<br>Профиль не настроен"
noProfileDesc = "Ваш аккаунт Microsoft еще не имеет профиля Minecraft. Если вы недавно купили игру или активировали ее через Xbox Game Pass, вам нужно настроить профиль на <a href=\"https://minecraft.net/\">Minecraft.net</a>.<br><br>Если вы еще не купили игру, вы можете сделать это на <a href=\"https://minecraft.net/\">Minecraft.net</a>."
noXboxAccountTitle = "Ошибка входа:<br>Нет аккаунта Xbox"
noXboxAccountDesc = "У вашей учетной записи Microsoft нет привязанного аккаунта Xbox."
xblBannedTitle = "Ошибка входа:<br>Xbox Live недоступен"
xblBannedDesc = "Ваш аккаунт Microsoft зарегистрирован в стране, где Xbox Live недоступен или заблокирован."
under18Title = "Ошибка входа:<br>Требуется родительское разрешение"
under18Desc = "Аккаунты пользователей младше 18 лет должны быть добавлены в «Семью» взрослым."
unknownTitle = "Неизвестная ошибка входа"
unknownDesc = "Произошла неизвестная ошибка. Подробности можно посмотреть в консоли."

363
app/assets/lang/ru_RU.toml Normal file
View File

@ -0,0 +1,363 @@
[ejs.landing]
updateAvailableTooltip = "Доступно обновление"
usernamePlaceholder = "Имя пользователя"
usernameEditButton = "Редактировать"
settingsTooltip = "Настройки"
serverStatus = "СЕРВЕР"
serverStatusPlaceholder = "ОФФЛАЙН"
mojangStatus = "СТАТУС MOJANG"
mojangStatusTooltipTitle = "Сервисы"
mojangStatusNETitle = "Необязательно"
newsButton = "НОВОСТИ"
launchButton = "ИГРАТЬ"
launchButtonPlaceholder = "&#8226; Сервер не выбран"
launchDetails = "Пожалуйста, подождите.."
newsNavigationStatus = "{currentPage} из {totalPages}"
newsErrorLoadSpan = "Проверка новостей.."
newsErrorFailedSpan = "Не удалось загрузить новости"
newsErrorRetryButton = "Попробовать снова"
newsErrorNoneSpan = "Новостей нет"
[ejs.login]
loginCancelText = "Отмена"
loginSubheader = "ВХОД В MINECRAFT"
loginEmailError = "* Неверное значение"
loginEmailPlaceholder = "EMAIL ИЛИ ИМЯ ПОЛЬЗОВАТЕЛЯ"
loginPasswordError = "* Обязательное поле"
loginPasswordPlaceholder = "ПАРОЛЬ"
loginForgotPasswordLink = "https://minecraft.net/password/forgot/"
loginForgotPasswordText = "забыли пароль?"
loginRememberMeText = "запомнить меня?"
loginButtonText = "ВОЙТИ"
loginNeedAccountLink = "https://minecraft.net/store/minecraft-java-edition/"
loginNeedAccountText = "Нужен аккаунт?"
loginPasswordDisclaimer1 = "Ваш пароль отправляется напрямую в Mojang и никогда не сохраняется."
loginPasswordDisclaimer2 = "{appName} не связан с Mojang AB."
[ejs.loginOptions]
loginOptionsTitle = "Опции входа"
loginWithMicrosoft = "Войти через Microsoft"
loginWithMojang = "Войти через Mojang"
cancelButton = "Отмена"
[ejs.overlay]
serverSelectHeader = "Доступные серверы"
serverSelectConfirm = "Выбрать"
serverSelectCancel = "Отмена"
accountSelectHeader = "Выберите аккаунт"
accountSelectConfirm = "Выбрать"
accountSelectCancel = "Отмена"
[ejs.settings]
navHeaderText = "Настройки"
navAccount = "Аккаунт"
navMinecraft = "Minecraft"
navMods = "Моды"
navJava = "Java"
navLauncher = "Лаунчер"
navAbout = "О программе"
navUpdates = "Обновления"
navDone = "Готово"
tabAccountHeaderText = "Настройки аккаунта"
tabAccountHeaderDesc = "Добавляйте новые аккаунты или управляйте существующими."
microsoftAccount = "Microsoft"
addMicrosoftAccount = "+ Добавить аккаунт Microsoft"
mojangAccount = "Mojang"
addMojangAccount = "+ Добавить аккаунт Mojang"
minecraftTabHeaderText = "Настройки Minecraft"
minecraftTabHeaderDesc = "Параметры, связанные с запуском игры."
gameResolutionTitle = "Разрешение игры"
launchFullscreenTitle = "Запуск в полноэкранном режиме."
autoConnectTitle = "Автоматически подключаться к серверу при запуске."
launchDetachedTitle = "Запускать игру отдельно от лаунчера."
launchDetachedDesc = "Если игра не запущена отдельно, закрытие лаунчера приведет к закрытию игры."
tabModsHeaderText = "Настройки модов"
tabModsHeaderDesc = "Включайте или отключайте моды."
switchServerButton = "Сменить сервер"
requiredMods = "Обязательные моды"
optionalMods = "Дополнительные моды"
dropinMods = "Установленные моды"
addMods = "Добавить моды"
dropinRefreshNote = "(Нажмите F5 для обновления)"
shaderpacks = "Шейдерпаки"
shaderpackDesc = "Включайте или отключайте шейдеры. Учтите, что они требуют мощного компьютера. Вы можете добавлять собственные шейдерпаки здесь."
selectShaderpack = "Выбрать шейдерпак"
tabJavaHeaderText = "Настройки Java"
tabJavaHeaderDesc = "Управление конфигурацией Java (для продвинутых пользователей)."
memoryTitle = "Память"
maxRAM = "Максимальный объем RAM"
minRAM = "Минимальный объем RAM"
memoryDesc = "Рекомендуемый минимум RAM — 3 ГБ. Установка одинаковых значений для минимума и максимума может снизить лаги."
memoryTotalTitle = "Всего"
memoryAvailableTitle = "Доступно"
javaExecutableTitle = "Исполняемый файл Java"
javaExecSelDialogTitle = "Выберите исполняемый файл Java"
javaExecSelButtonText = "Выбрать файл"
javaExecDesc = "Исполняемый файл Java проверяется перед запуском игры."
javaPathDesc = "Путь должен заканчиваться на <strong>{pathSuffix}</strong>."
jvmOptsTitle = "Дополнительные параметры JVM"
jvmOptsDesc = "Опции, передаваемые JVM во время выполнения. <em>-Xms</em> и <em>-Xmx</em> не должны включаться."
launcherTabHeaderText = "Настройки лаунчера"
launcherTabHeaderDesc = "Параметры, связанные с самим лаунчером."
allowPrereleaseTitle = "Разрешить обновления предварительных версий."
allowPrereleaseDesc = "Предварительные версии включают новые функции, которые могут быть недостаточно протестированы.<br>Этот параметр всегда включен, если вы используете предварительную версию."
dataDirectoryTitle = "Директория данных"
selectDataDirectory = "Выбрать директорию данных"
chooseFolder = "Выбрать папку"
dataDirectoryDesc = "Все игровые файлы и локальные установки Java будут храниться в этой директории.<br>Скриншоты и сохранения миров хранятся в папке экземпляра соответствующей конфигурации сервера."
aboutTabHeaderText = "О программе"
aboutTabHeaderDesc = "Просмотр информации и заметок о текущей версии."
aboutTitle = "{appName}"
stableRelease = "Стабильный релиз"
versionText = "Версия "
sourceGithub = "Исходный код (GitHub)"
support = "Поддержка"
devToolsConsole = "Консоль DevTools"
releaseNotes = "Примечания к выпуску"
changelog = "История изменений"
noReleaseNotes = "Нет примечаний к выпуску"
viewReleaseNotes = "Просмотреть примечания к выпуску на GitHub"
launcherUpdatesHeaderText = "Обновления лаунчера"
launcherUpdatesHeaderDesc = "Загрузка, установка и просмотр обновлений лаунчера."
checkForUpdates = "Проверить обновления"
whatsNew = "Что нового"
updateReleaseNotes = "Примечания к обновлению"
[ejs.waiting]
waitingText = "Ожидание Microsoft.."
[ejs.welcome]
continueButton = "ПРОДОЛЖИТЬ"
[js.discord]
waiting = "Ожидание клиента.."
state = "Сервер: {shortId}"
[js.index]
microsoftLoginTitle = "Вход через Microsoft"
microsoftLogoutTitle = "Выход из Microsoft"
[js.login]
login = "ВОЙТИ"
loggingIn = "ВХОД В СИСТЕМУ"
success = "УСПЕШНО"
tryAgain = "Попробовать снова"
[js.login.error]
invalidValue = "* Неверное значение"
requiredValue = "* Обязательное поле"
[js.login.error.unknown]
title = "Неизвестная ошибка при входе"
desc = "Произошла неизвестная ошибка. Подробности можно посмотреть в консоли."
[js.landing.launch]
pleaseWait = "Пожалуйста, подождите.."
failureTitle = "Ошибка при запуске"
failureText = "Смотрите консоль (CTRL + Shift + I) для подробностей."
okay = "ОК"
[js.landing.selectedAccount]
noAccountSelected = "Аккаунт не выбран"
[js.landing.selectedServer]
noSelection = "Сервер не выбран"
loading = "Загрузка.."
[js.landing.serverStatus]
server = "СЕРВЕР"
offline = "ОФФЛАЙН"
players = "ИГРОКИ"
[js.landing.systemScan]
checking = "Проверка информации о системе.."
noCompatibleJava = "Совместимая<br>установка Java не найдена"
installJavaMessage = "Для запуска Minecraft требуется 64-битная версия Java {major}. Установить её сейчас?"
installJava = "Установить Java"
installJavaManually = "Установить вручную"
javaDownloadPrepare = "Подготовка загрузки Java.."
javaDownloadFailureTitle = "Ошибка загрузки Java"
javaDownloadFailureText = "Смотрите консоль (CTRL + Shift + I) для подробностей."
javaRequired = "Для запуска требуется Java"
javaRequiredMessage = "Для запуска необходима действительная 64-битная установка Java {major}.<br><br>Пожалуйста, ознакомьтесь с нашим <a href=\"https://github.com/dscalzi/HeliosLauncher/wiki/Java-Management#manually-installing-a-valid-version-of-java\">Руководством по управлению Java</a>, чтобы установить её вручную."
javaRequiredDismiss = "Понял"
javaRequiredCancel = "Назад"
[js.landing.downloadJava]
findJdkFailure = "Не удалось найти дистрибутив OpenJDK."
javaDownloadCorruptedError = "Загруженный JDK поврежден, файл может быть испорчен."
extractingJava = "Распаковка Java"
javaInstalled = "Java установлена!"
[js.landing.dlAsync]
loadingServerInfo = "Загрузка информации о сервере.."
fatalError = "Критическая ошибка"
unableToLoadDistributionIndex = "Не удалось загрузить индекс дистрибуции. Смотрите консоль (CTRL + Shift + I) для подробностей."
pleaseWait = "Пожалуйста, подождите.."
errorDuringLaunchTitle = "Ошибка при запуске"
seeConsoleForDetails = "Смотрите консоль (CTRL + Shift + I) для подробностей."
validatingFileIntegrity = "Проверка целостности файлов.."
errorDuringFileVerificationTitle = "Ошибка при проверке файлов"
downloadingFiles = "Загрузка файлов.."
errorDuringFileDownloadTitle = "Ошибка при загрузке файлов"
preparingToLaunch = "Подготовка к запуску.."
launchingGame = "Запуск игры.."
launchWrapperNotDownloaded = "Основной файл, LaunchWrapper, не был загружен должным образом. В результате игра не может быть запущена.<br><br>Чтобы исправить эту проблему, временно отключите антивирусное ПО и попробуйте снова.<br><br>Если у вас есть время, пожалуйста, <a href=\"https://github.com/dscalzi/HeliosLauncher/issues\">сообщите об этой проблеме</a> и укажите, каким антивирусом вы пользуетесь. Мы постараемся связаться с разработчиками антивируса и решить проблему."
doneEnjoyServer = "Готово. Наслаждайтесь сервером!"
checkConsoleForDetails = "Пожалуйста, проверьте консоль (CTRL + Shift + I) для подробностей."
[js.landing.news]
checking = "Проверка новостей"
[js.landing.discord]
loading = "Загрузка игры.."
joining = "Путешествие в Вестерос!"
joined = "Исследование мира!"
[js.overlay]
dismiss = "Закрыть"
[js.settings.fileSelectors]
executables = "Исполняемые файлы"
allFiles = "Все файлы"
[js.settings.mstfLogin]
errorTitle = "Что-то пошло не так"
errorMessage = "Ошибка аутентификации Microsoft. Попробуйте еще раз."
okButton = "ОК"
[js.settings.mstfLogout]
errorTitle = "Что-то пошло не так"
errorMessage = "Ошибка выхода из Microsoft. Попробуйте еще раз."
okButton = "ОК"
[js.settings.authAccountLogout]
lastAccountWarningTitle = "Внимание<br>Это ваш последний аккаунт"
lastAccountWarningMessage = "Для использования лаунчера необходимо быть авторизованным хотя бы в одном аккаунте. После выхода вам придется войти снова.<br><br>Вы уверены, что хотите выйти?"
confirmButton = "Я уверен"
cancelButton = "Отмена"
[js.settings.authAccountPopulate]
username = "Имя пользователя"
uuid = "UUID"
selectAccount = "Выбрать аккаунт"
selectedAccount = "Выбранный аккаунт ✓"
logout = "Выйти"
[js.settings.dropinMods]
removeButton = "Удалить"
deleteFailedTitle = "Ошибка удаления<br>мода {fullName}"
deleteFailedMessage = "Убедитесь, что файл не используется, и попробуйте снова."
failedToggleTitle = "Ошибка переключения<br>одного или нескольких установленных модов"
okButton = "ОК"
[js.settings.serverListing]
mainServer = "Основной сервер"
[js.settings.java]
selectedJava = "Выбрано: Java {version} ({vendor})"
invalidSelection = "Некорректный выбор"
requiresJava = "Требуется Java {major} x64."
availableOptions = "Доступные версии Java {major} (HotSpot VM)"
[js.settings.about]
preReleaseTitle = "Предварительная версия"
stableReleaseTitle = "Стабильная версия"
releaseNotesFailed = "Не удалось загрузить примечания к выпуску."
[js.settings.updates]
newReleaseTitle = "Доступно новое обновление"
newPreReleaseTitle = "Доступна новая предварительная версия"
downloadingButton = "Загрузка.."
downloadButton = 'Загрузить с GitHub<span style="font-size: 10px;color: gray;text-shadow: none !important;">Закройте лаунчер и запустите установщик для обновления.</span>'
latestVersionTitle = "У вас установлена последняя версия"
checkForUpdatesButton = "Проверить обновления"
checkingForUpdatesButton = "Проверка обновлений.."
[js.settings.msftLogin]
errorTitle = "Ошибка входа в Microsoft"
errorMessage = "Не удалось выполнить аутентификацию в Microsoft. Попробуйте снова."
okButton = "ОК"
[js.settings.authAccountSelect]
selectButton = "Выбрать аккаунт"
selectedButton = "Выбранный аккаунт &#10004;"
[js.settings.authAccountLogout]
lastAccountWarningTitle = "Внимание<br>Это ваш последний аккаунт"
lastAccountWarningMessage = "Для использования лаунчера необходимо быть авторизованным хотя бы в одном аккаунте. После выхода вам придется войти снова.<br><br>Вы уверены, что хотите выйти?"
confirmButton = "Я уверен"
cancelButton = "Отмена"
[js.settings.authAccountPopulate]
username = "Имя пользователя"
uuid = "UUID"
selectAccount = "Выбрать аккаунт"
selectedAccount = "Выбранный аккаунт ✓"
logout = "Выйти"
[js.settings.dropinMods]
removeButton = "Удалить"
deleteFailedTitle = "Ошибка удаления<br>мода {fullName}"
deleteFailedMessage = "Убедитесь, что файл не используется, и попробуйте снова."
failedToggleTitle = "Ошибка переключения<br>одного или нескольких установленных модов"
okButton = "ОК"
[js.settings.serverListing]
mainServer = "Основной сервер"
[js.settings.java]
selectedJava = "Выбрано: Java {version} ({vendor})"
invalidSelection = "Некорректный выбор"
requiresJava = "Требуется Java {major} x64."
availableOptions = "Доступные версии Java {major} (HotSpot VM)"
[js.settings.about]
preReleaseTitle = "Предварительная версия"
stableReleaseTitle = "Стабильная версия"
releaseNotesFailed = "Не удалось загрузить примечания к выпуску."
[js.settings.updates]
newReleaseTitle = "Доступно новое обновление"
newPreReleaseTitle = "Доступна новая предварительная версия"
downloadingButton = "Загрузка.."
downloadButton = 'Загрузить с GitHub<span style="font-size: 10px;color: gray;text-shadow: none !important;">Закройте лаунчер и запустите установщик для обновления.</span>'
latestVersionTitle = "У вас установлена последняя версия"
checkForUpdatesButton = "Проверить обновления"
checkingForUpdatesButton = "Проверка обновлений.."
[js.settings.msftLogin]
errorTitle = "Ошибка входа в Microsoft"
errorMessage = "Не удалось выполнить аутентификацию в Microsoft. Попробуйте снова."
okButton = "ОК"
[js.uibinder.startup]
fatalErrorTitle = "Критическая ошибка: невозможно загрузить индекс дистрибуции"
fatalErrorMessage = "Не удалось установить соединение с нашими серверами для загрузки индекса дистрибуции. Локальные копии отсутствуют.<br><br>Индекс дистрибуции — это важный файл, который содержит актуальную информацию о сервере. Лаунчер не сможет запуститься без него. Убедитесь, что у вас есть подключение к интернету, и перезапустите приложение."
closeButton = "Закрыть"
[js.uibinder.validateAccount]
failedMessageTitle = "Ошибка обновления входа"
failedMessage = "Не удалось обновить вход для <strong>{account}</strong>. Пожалуйста, выберите другой аккаунт или войдите снова."
failedMessageSelectAnotherAccount = "Не удалось обновить вход для <strong>{account}</strong>. Пожалуйста, войдите снова."
loginButton = "Войти"
selectAnotherAccountButton = "Выбрать другой аккаунт"
[js.uicore.autoUpdate]
checkingForUpdateButton = "Проверка обновлений..."
installNowButton = "Установить сейчас"
checkForUpdatesButton = "Проверить обновления"
[js.auth.microsoft.error]
noProfileTitle = "Ошибка входа:<br>Профиль не настроен"
noProfileDesc = "Ваш аккаунт Microsoft еще не имеет профиля Minecraft. Если вы недавно купили игру или активировали ее через Xbox Game Pass, вам нужно настроить профиль на <a href=\"https://minecraft.net/\">Minecraft.net</a>.<br><br>Если вы еще не купили игру, вы можете сделать это на <a href=\"https://minecraft.net/\">Minecraft.net</a>."
noXboxAccountTitle = "Ошибка входа:<br>Нет аккаунта Xbox"
noXboxAccountDesc = "У вашей учетной записи Microsoft нет привязанного аккаунта Xbox."
xblBannedTitle = "Ошибка входа:<br>Xbox Live недоступен"
xblBannedDesc = "Ваш аккаунт Microsoft зарегистрирован в стране, где Xbox Live недоступен или заблокирован."
under18Title = "Ошибка входа:<br>Требуется родительское разрешение"
under18Desc = "Аккаунты пользователей младше 18 лет должны быть добавлены в «Семью» взрослым."
unknownTitle = "Неизвестная ошибка входа"
unknownDesc = "Произошла неизвестная ошибка. Подробности можно посмотреть в консоли."

View File

@ -39,53 +39,6 @@
</svg> </svg>
</a> </a>
</div> </div>
<div class="mediaContainer">
<a href="<%- lang('landing.mediaTwitterURL') %>" class="mediaURL" id="twitterURL">
<svg id="twitterSVG" class="mediaSVG" viewBox="0 0 5000 4060" preserveAspectRatio="xMidYMid meet">
<g>
<path d="M1210 4048 c-350 -30 -780 -175 -1124 -378 -56 -33 -86 -57 -86 -68 0 -16 7 -17 83 -9 114 12 349 1 493 -22 295 -49 620 -180 843 -341 l54 -38 -49 -7 c-367 -49 -660 -256 -821 -582 -30 -61 -53 -120 -51 -130 3 -16 12 -17 73 -13 97 7 199 5 270 -4 l60 -9 -65 -22 c-341 -117 -609 -419 -681 -769 -18 -88 -26 -226 -13 -239 4 -3 32 7 63 22 68 35 198 77 266 86 28 4 58 9 68 12 10 2 -22 -34 -72 -82 -240 -232 -353 -532 -321 -852 15 -149 79 -347 133 -418 16 -20 17 -19 49 20 377 455 913 795 1491 945 160 41 346 74 485 86 l82 7 -7 -59 c-5 -33 -7 -117 -6 -189 2 -163 31 -286 103 -430 141 -285 422 -504 708 -550 112 -19 333 -19 442 0 180 30 335 108 477 239 l58 54 95 -24 c143 -36 286 -89 427 -160 70 -35 131 -60 135 -56 19 19 -74 209 -151 312 -50 66 -161 178 -216 217 l-30 22 73 -14 c111 -21 257 -63 353 -101 99 -39 99 -39 99 -19 0 57 -237 326 -412 468 l-88 71 6 51 c4 28 1 130 -5 226 -30 440 -131 806 -333 1202 -380 745 -1036 1277 -1823 1477 -243 62 -430 81 -786 78 -134 0 -291 -5 -349 -10z"/>
</g>
</svg>
</a>
</div>
<div class="mediaContainer">
<a href="<%- lang('landing.mediaInstagramURL') %>" class="mediaURL" id="instagramURL">
<svg id="instagramSVG" class="mediaSVG" viewBox="0 0 5040 5040">
<defs>
<radialGradient id="instaFill" cx="30%" cy="107%" r="150%">
<stop offset="0%" stop-color="#fdf497"/>
<stop offset="5%" stop-color="#fdf497"/>
<stop offset="45%" stop-color="#fd5949"/>
<stop offset="60%" stop-color="#d6249f"/>
<stop offset="90%" stop-color="#285AEB"/>
</radialGradient>
</defs>
<g>
<path d="M1390 5024 c-163 -9 -239 -19 -315 -38 -281 -70 -477 -177 -660 -361 -184 -184 -292 -380 -361 -660 -43 -171 -53 -456 -53 -1445 0 -989 10 -1274 53 -1445 69 -280 177 -476 361 -660 184 -184 380 -292 660 -361 171 -43 456 -53 1445 -53 989 0 1274 10 1445 53 280 69 476 177 660 361 184 184 292 380 361 660 43 171 53 456 53 1445 0 989 -10 1274 -53 1445 -69 280 -177 476 -361 660 -184 184 -380 292 -660 361 -174 44 -454 53 -1470 52 -599 0 -960 -5 -1105 -14z m2230 -473 c58 -6 141 -18 185 -27 397 -78 638 -318 719 -714 37 -183 41 -309 41 -1290 0 -981 -4 -1107 -41 -1290 -81 -395 -319 -633 -714 -714 -183 -37 -309 -41 -1290 -41 -981 0 -1107 4 -1290 41 -397 81 -636 322 -714 719 -33 166 -38 296 -43 1100 -5 796 3 1203 27 1380 67 489 338 758 830 825 47 7 162 15 255 20 250 12 1907 4 2035 -9z"/>
<path d="M2355 3819 c-307 -42 -561 -172 -780 -400 -244 -253 -359 -543 -359 -899 0 -361 116 -648 367 -907 262 -269 563 -397 937 -397 374 0 675 128 937 397 251 259 367 546 367 907 0 361 -116 648 -367 907 -197 203 -422 326 -690 378 -101 20 -317 27 -412 14z m400 -509 c275 -88 470 -284 557 -560 20 -65 23 -95 23 -230 0 -135 -3 -165 -23 -230 -88 -278 -284 -474 -562 -562 -65 -20 -95 -23 -230 -23 -135 0 -165 3 -230 23 -278 88 -474 284 -562 562 -20 65 -23 95 -23 230 0 135 3 165 23 230 73 230 219 403 427 507 134 67 212 83 390 79 111 -3 155 -8 210 -26z"/>
<path d="M3750 1473 c-29 -11 -66 -38 -106 -77 -70 -71 -94 -126 -94 -221 0 -95 24 -150 94 -221 72 -71 126 -94 225 -94 168 0 311 143 311 311 0 99 -23 154 -94 225 -43 42 -76 66 -110 77 -61 21 -166 21 -226 0z"/>
</g>
</svg>
</a>
</div>
<div class="mediaContainer">
<a href="<%- lang('landing.mediaYouTubeURL') %>" class="mediaURL" id="youtubeURL">
<svg id="youtubeSVG" class="mediaSVG" viewBox="35.34 34.3575 70.68 68.71500">
<g>
<path d="M84.8,69.52,65.88,79.76V59.27Zm23.65.59c0-5.14-.79-17.63-3.94-20.57S99,45.86,73.37,45.86s-28,.73-31.14,3.68S38.29,65,38.29,70.11s.79,17.63,3.94,20.57,5.52,3.68,31.14,3.68,28-.74,31.14-3.68,3.94-15.42,3.94-20.57"/>
</g>
</svg>
</a>
</div>
<div class="mediaContainer">
<a href="<%- lang('landing.mediaDiscordURL') %>" class="mediaURL" id="discordURL">
<svg id="discordSVG" class="mediaSVG" viewBox="35.34 34.3575 70.68 68.71500">
<g>
<path d="M81.23,78.48a6.14,6.14,0,1,1,6.14-6.14,6.14,6.14,0,0,1-6.14,6.14M60,78.48a6.14,6.14,0,1,1,6.14-6.14A6.14,6.14,0,0,1,60,78.48M104.41,73c-.92-7.7-8.24-22.9-8.24-22.9A43,43,0,0,0,88,45.59a17.88,17.88,0,0,0-8.38-1.27l-.13,1.06a23.52,23.52,0,0,1,5.8,1.95,87.59,87.59,0,0,1,8.17,4.87s-10.32-5.63-22.27-5.63a51.32,51.32,0,0,0-23.2,5.63,87.84,87.84,0,0,1,8.17-4.87,23.57,23.57,0,0,1,5.8-1.95l-.13-1.06a17.88,17.88,0,0,0-8.38,1.27,42.84,42.84,0,0,0-8.21,4.56S37.87,65.35,37,73s-.37,11.54-.37,11.54,4.22,5.68,9.9,7.14,7.7,1.47,7.7,1.47l3.75-4.68a21.22,21.22,0,0,1-4.65-2A24.47,24.47,0,0,1,47.93,82S61.16,88.4,70.68,88.4c10,0,22.75-6.44,22.75-6.44a24.56,24.56,0,0,1-5.35,4.56,21.22,21.22,0,0,1-4.65,2l3.75,4.68s2,0,7.7-1.47,9.89-7.14,9.89-7.14.55-3.85-.37-11.54"/>
</g>
</svg>
</a>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -216,5 +169,5 @@
</div> </div>
</div> </div>
</div> </div>
<!-- <script type="module" src="./assets/js/scripts/landing.js"></script> --> <script src="./assets/js/scripts/landing.js"></script>
</div> </div>

View File

@ -18,19 +18,7 @@
<span class="loginErrorSpan" id="loginEmailError"><%- lang('login.loginEmailError') %></span> <span class="loginErrorSpan" id="loginEmailError"><%- lang('login.loginEmailError') %></span>
<input id="loginUsername" class="loginField" type="text" placeholder="<%- lang('login.loginEmailPlaceholder') %>"/> <input id="loginUsername" class="loginField" type="text" placeholder="<%- lang('login.loginEmailPlaceholder') %>"/>
</div> </div>
<div class="loginFieldContainer">
<svg id="lockSVG" class="loginSVG" viewBox="40 32 60.36 70.43">
<g>
<path d="M86.16,54a16.38,16.38,0,1,0-32,0H44V102.7H96V54Zm-25.9-3.39a9.89,9.89,0,1,1,19.77,0A9.78,9.78,0,0,1,79.39,54H60.89A9.78,9.78,0,0,1,60.26,50.59ZM70,96.2a6.5,6.5,0,0,1-6.5-6.5,6.39,6.39,0,0,1,3.1-5.4V67h6.5V84.11a6.42,6.42,0,0,1,3.39,5.6A6.5,6.5,0,0,1,70,96.2Z"/>
</g>
</svg>
<span class="loginErrorSpan" id="loginPasswordError"><%- lang('login.loginPasswordError') %></span>
<input id="loginPassword" class="loginField" type="password" placeholder="<%- lang('login.loginPasswordPlaceholder') %>"/>
</div>
<div id="loginOptions"> <div id="loginOptions">
<span class="loginSpanDim">
<a href="<%- lang('login.loginForgotPasswordLink') %>"><%- lang('login.loginForgotPasswordText') %></a>
</span>
<label id="checkmarkContainer"> <label id="checkmarkContainer">
<input id="loginRememberOption" type="checkbox" checked> <input id="loginRememberOption" type="checkbox" checked>
<span id="loginRememberText" class="loginSpanDim"><%- lang('login.loginRememberMeText') %></span> <span id="loginRememberText" class="loginSpanDim"><%- lang('login.loginRememberMeText') %></span>
@ -61,5 +49,5 @@
</div> </div>
</form> </form>
</div> </div>
<!-- <script type="module" src="./assets/js/scripts/login.js"></script> --> <script src="./assets/js/scripts/login.js"></script>
</div> </div>

View File

@ -15,13 +15,8 @@
</button> </button>
</div> </div>
<div class="loginOptionButtonContainer"> <div class="loginOptionButtonContainer">
<button id="loginOptionMojang" class="loginOptionButton"> <button id="loginOptionOffline" class="loginOptionButton">
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 9.677 9.667"> <span><%- lang('loginOptions.loginWithOffline') %></span>
<path d="M-26.332-12.098h2.715c-1.357.18-2.574 1.23-2.715 2.633z" fill="#fff" />
<path d="M2.598.022h7.07L9.665 7c-.003 1.334-1.113 2.46-2.402 2.654H0V2.542C.134 1.2 1.3.195 2.598.022z" fill="#db2331" />
<path d="M1.54 2.844c.314-.76 1.31-.46 1.954-.528.785-.083 1.503.272 2.1.758l.164-.9c.327.345.587.756.964 1.052.28.254.655-.342.86-.013.42.864.408 1.86.54 2.795l-.788-.373C6.9 4.17 5.126 3.052 3.656 3.685c-1.294.592-1.156 2.65.06 3.255 1.354.703 2.953.51 4.405.292-.07.42-.34.87-.834.816l-4.95.002c-.5.055-.886-.413-.838-.89l.04-4.315z" fill="#fff" />
</svg>
<span><%- lang('loginOptions.loginWithMojang') %></span>
</button> </button>
</div> </div>
</div> </div>
@ -30,5 +25,5 @@
</div> </div>
</div> </div>
</div> </div>
<!-- <script type="module" src="./assets/js/scripts/loginOptions.js"></script> --> <script src="./assets/js/scripts/loginOptions.js"></script>
</div> </div>

View File

@ -37,5 +37,5 @@
</div> </div>
</div> </div>
</div> </div>
<!-- <script type="module" src="./assets/js/scripts/overlay.js"></script> --> <script src="./assets/js/scripts/overlay.js"></script>
</div> </div>

View File

@ -52,23 +52,20 @@
<div class="settingsAuthAccountTypeContainer"> <div class="settingsAuthAccountTypeContainer">
<div class="settingsAuthAccountTypeHeader"> <div class="settingsAuthAccountTypeHeader">
<div class="settingsAuthAccountTypeHeaderLeft"> <div class="settingsAuthAccountTypeHeaderLeft">
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 9.677 9.667"> <img src="assets/images/lotip22.svg"/>
<path d="M-26.332-12.098h2.715c-1.357.18-2.574 1.23-2.715 2.633z" fill="#fff" /> <span><%- lang('settings.offlineAccount') %></span>
<path d="M2.598.022h7.07L9.665 7c-.003 1.334-1.113 2.46-2.402 2.654H0V2.542C.134 1.2 1.3.195 2.598.022z" fill="#db2331" />
<path d="M1.54 2.844c.314-.76 1.31-.46 1.954-.528.785-.083 1.503.272 2.1.758l.164-.9c.327.345.587.756.964 1.052.28.254.655-.342.86-.013.42.864.408 1.86.54 2.795l-.788-.373C6.9 4.17 5.126 3.052 3.656 3.685c-1.294.592-1.156 2.65.06 3.255 1.354.703 2.953.51 4.405.292-.07.42-.34.87-.834.816l-4.95.002c-.5.055-.886-.413-.838-.89l.04-4.315z" fill="#fff" />
</svg>
<span><%- lang('settings.mojangAccount') %></span>
</div> </div>
<div class="settingsAuthAccountTypeHeaderRight"> <div class="settingsAuthAccountTypeHeaderRight">
<button class="settingsAddAuthAccount" id="settingsAddMojangAccount"><%- lang('settings.addMojangAccount') %></button> <button class="settingsAddAuthAccount" id="settingsAddOfflineAccount"><%- lang('settings.addOfflineAccount') %></button>
</div> </div>
</div> </div>
<div class="settingsCurrentAccounts" id="settingsCurrentMojangAccounts"> <div class="settingsCurrentAccounts" id="settingsCurrentOfflineAccounts">
<!-- Mojang auth accounts populated here. --> <!-- Mojang auth accounts populated here. -->
</div> </div>
</div> </div>
</div> </div>
<div id="settingsTabMinecraft" class="settingsTab" style="display: none;"> <div id="settingsTabMinecraft" class="settingsTab" style="display: none;">
<div class="settingsTabHeader"> <div class="settingsTabHeader">
<span class="settingsTabHeaderText"><%- lang('settings.minecraftTabHeaderText') %></span> <span class="settingsTabHeaderText"><%- lang('settings.minecraftTabHeaderText') %></span>
@ -389,5 +386,5 @@
</div> </div>
</div> </div>
</div> </div>
<!-- <script type="module" src="./assets/js/scripts/settings.js"></script> --> <script src="./assets/js/scripts/settings.js"></script>
</div> </div>

View File

@ -21,5 +21,5 @@
</div> </div>
</button> </button>
</div> </div>
<!-- <script type="module" src="./assets/js/scripts/welcome.js"></script> --> <script src="./assets/js/scripts/welcome.js"></script>
</div> </div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 107 KiB

View File

@ -1,3 +1,3 @@
owner: dscalzi owner: ONIMAI-SMP
repo: HeliosLauncher repo: Launcher
provider: github provider: git.onimai.ru

View File

@ -360,10 +360,12 @@ The resolved/provided paths are appended to a base path depending on the module'
| Type | Path | | Type | Path |
| ---- | ---- | | ---- | ---- |
| `ForgeHosted` | ({`commonDirectory`}/libraries/{`path` OR resolved}) | | `ForgeHosted` | ({`commonDirectory`}/libraries/{`path` OR resolved}) |
| `Fabric` | ({`commonDirectory`}/libraries/{`path` OR resolved}) |
| `LiteLoader` | ({`commonDirectory`}/libraries/{`path` OR resolved}) | | `LiteLoader` | ({`commonDirectory`}/libraries/{`path` OR resolved}) |
| `Library` | ({`commonDirectory`}/libraries/{`path` OR resolved}) | | `Library` | ({`commonDirectory`}/libraries/{`path` OR resolved}) |
| `ForgeMod` | ({`commonDirectory`}/modstore/{`path` OR resolved}) | | `ForgeMod` | ({`commonDirectory`}/modstore/{`path` OR resolved}) |
| `LiteMod` | ({`commonDirectory`}/modstore/{`path` OR resolved}) | | `LiteMod` | ({`commonDirectory`}/modstore/{`path` OR resolved}) |
| `FabricMod` | ({`commonDirectory`}/mods/fabric/{`path` OR resolved}) |
| `File` | ({`instanceDirectory`}/{`Server.id`}/{`path` OR resolved}) | | `File` | ({`instanceDirectory`}/{`Server.id`}/{`path` OR resolved}) |
The `commonDirectory` and `instanceDirectory` values are stored in the launcher's config.json. The `commonDirectory` and `instanceDirectory` values are stored in the launcher's config.json.
@ -408,7 +410,7 @@ If the module is enabled by default. Has no effect unless `Required.value` is fa
### ForgeHosted ### ForgeHosted
The module type `ForgeHosted` represents forge itself. Currently, the launcher only supports forge servers, as vanilla servers can be connected to via the mojang launcher. The `Hosted` part is key, this means that the forge module must declare its required libraries as submodules. The module type `ForgeHosted` represents forge itself. Currently, the launcher only supports modded servers, as vanilla servers can be connected to via the mojang launcher. The `Hosted` part is key, this means that the forge module must declare its required libraries as submodules.
Ex. Ex.
@ -443,6 +445,40 @@ There were plans to add a `Forge` type, in which the required libraries would be
--- ---
### Fabric
The module type `Fabric` represents the fabric mod loader. Currently, the launcher only supports modded servers, as vanilla servers can be connected to via the mojang launcher.
Ex.
```json
{
"id": "net.fabricmc:fabric-loader:0.15.0",
"name": "Fabric (fabric-loader)",
"type": "Fabric",
"artifact": {
"size": 1196222,
"MD5": "a43d5a142246801343b6cedef1c102c4",
"url": "http://localhost:8080/repo/lib/net/fabricmc/fabric-loader/0.15.0/fabric-loader-0.15.0.jar"
},
"subModules": [
{
"id": "1.20.1-fabric-0.15.0",
"name": "Fabric (version.json)",
"type": "VersionManifest",
"artifact": {
"size": 2847,
"MD5": "69a2bd43452325ba1bc882fa0904e054",
"url": "http://localhost:8080/repo/versions/1.20.1-fabric-0.15.0/1.20.1-fabric-0.15.0.json"
}
}
}
```
Fabric works similarly to Forge 1.13+.
---
### LiteLoader ### LiteLoader
The module type `LiteLoader` represents liteloader. It is handled as a library and added to the classpath at runtime. Special launch conditions are executed when liteloader is present and enabled. This module can be optional and toggled similarly to `ForgeMod` and `Litemod` modules. The module type `LiteLoader` represents liteloader. It is handled as a library and added to the classpath at runtime. Special launch conditions are executed when liteloader is present and enabled. This module can be optional and toggled similarly to `ForgeMod` and `Litemod` modules.

View File

@ -1,8 +1,8 @@
appId: 'helioslauncher' appId: 'onimairu-mc_launcher'
productName: 'Helios Launcher' productName: 'ONIMAI.RU MC Launcher'
artifactName: '${productName}-setup-${version}.${ext}' artifactName: '${productName}-setup-${version}.${ext}'
copyright: 'Copyright © 2018-2022 Daniel Scalzi' copyright: 'Copyright © 2024 ONIMAI.RU'
asar: true asar: true
compression: 'maximum' compression: 'maximum'
@ -39,8 +39,8 @@ mac:
# Linux Configuration # Linux Configuration
linux: linux:
target: 'AppImage' target: 'AppImage'
maintainer: 'Daniel Scalzi' maintainer: 'SPAWNRYS'
vendor: 'Daniel Scalzi' vendor: 'ONIMAI.RU'
synopsis: 'Modded Minecraft Launcher' synopsis: 'Modded Minecraft Launcher'
description: 'Custom launcher which allows users to join modded servers. All mods, configurations, and updates are handled automatically.' description: 'Custom launcher which allows users to join modded servers. All mods, configurations, and updates are handled automatically.'
category: 'Game' category: 'Game'

222
index.js
View File

@ -1,104 +1,23 @@
const remoteMain = require('@electron/remote/main')
remoteMain.initialize()
// Requirements // Requirements
const { app, BrowserWindow, ipcMain, Menu, shell } = require('electron') const { app, BrowserWindow, ipcMain, Menu, shell } = require('electron')
const autoUpdater = require('electron-updater').autoUpdater const autoUpdater = require('electron-updater').autoUpdater
const ejse = require('ejs-electron') const ejse = require('ejs-electron')
const fs = require('fs-extra') const fs = require('fs')
const isDev = require('./app/assets/js/isdev')
const path = require('path') const path = require('path')
const semver = require('semver') const semver = require('semver')
const { pathToFileURL } = require('url') const { pathToFileURL } = require('url')
const { AZURE_CLIENT_ID, MSFT_OPCODE, MSFT_REPLY_TYPE, MSFT_ERROR, SHELL_OPCODE } = require('./app/assets/js/ipcconstants') const { AZURE_CLIENT_ID, MSFT_OPCODE, MSFT_REPLY_TYPE, MSFT_ERROR, SHELL_OPCODE } = require('./app/assets/js/ipcconstants')
const LangLoader = require('./app/assets/js/langloader')
const { Type } = require('helios-distribution-types')
const { totalmem, freemem, tmpdir } = require('node:os')
const { prerelease } = require('semver')
const { addMojangAccount, addMicrosoftAccount, removeMojangAccount, removeMicrosoftAccount, validateSelected } = require('./app/assets/js/main/authmanager')
const ConfigManager = require('./app/assets/js/main/configmanager')
const { DistroAPI } = require('./app/assets/js/main/distromanager')
// eslint-disable-next-line no-unused-vars
const { HeliosDistribution } = require('helios-core/common')
const { LoggerUtil } = require('helios-core')
const { getLang, setupLanguage, queryEJS, queryJS } = require('./app/assets/js/main/langloader')
const logger = LoggerUtil.getLogger('Preloader')
// Log deprecation and process warnings.
process.traceProcessWarnings = true
process.traceDeprecation = true
// Load ConfigManager
ConfigManager.load()
// Yuck!
// TODO Fix this
DistroAPI['commonDir'] = ConfigManager.getCommonDirectory()
DistroAPI['instanceDir'] = ConfigManager.getInstanceDirectory()
// Setup Lang // Setup Lang
setupLanguage() LangLoader.setupLanguage()
/**
*
* @param {HeliosDistribution} data
*/
function onDistroLoad(data){
if(data != null){
// Resolve the selected server if its value has yet to be set.
if(ConfigManager.getSelectedServer() == null || data.getServerById(ConfigManager.getSelectedServer()) == null){
logger.info('Determining default selected server..')
ConfigManager.setSelectedServer(data.getMainServer().rawServer.id)
ConfigManager.save()
}
}
win.webContents.send('distributionIndexDone', data != null)
}
// Ensure Distribution is downloaded and cached.
DistroAPI.getDistribution()
.then(heliosDistro => {
logger.info('Loaded distribution index.')
onDistroLoad(heliosDistro)
})
.catch(err => {
logger.info('Failed to load an older version of the distribution index.')
logger.info('Application cannot run.')
logger.error(err)
onDistroLoad(null)
})
// Clean up temp dir incase previous launches ended unexpectedly.
fs.remove(path.join(tmpdir(), ConfigManager.getTempNativeFolder()), (err) => {
if(err){
logger.warn('Error while cleaning natives directory', err)
} else {
logger.info('Cleaned natives directory.')
}
})
const autoUpdateChannel = new MessageChannel()
// ORIGINAL BELOW
// Setup auto updater. // Setup auto updater.
function initAutoUpdater(data) { function initAutoUpdater(event, data) {
if(data){ if(data){
autoUpdater.allowPrerelease = true autoUpdater.allowPrerelease = true
@ -107,7 +26,7 @@ function initAutoUpdater(data) {
// autoUpdater.allowPrerelease = true // autoUpdater.allowPrerelease = true
} }
if(!app.isPackaged){ if(isDev){
autoUpdater.autoInstallOnAppQuit = false autoUpdater.autoInstallOnAppQuit = false
autoUpdater.updateConfigPath = path.join(__dirname, 'dev-app-update.yml') autoUpdater.updateConfigPath = path.join(__dirname, 'dev-app-update.yml')
} }
@ -115,77 +34,22 @@ function initAutoUpdater(data) {
autoUpdater.autoDownload = false autoUpdater.autoDownload = false
} }
autoUpdater.on('update-available', (info) => { autoUpdater.on('update-available', (info) => {
autoUpdateChannel.port1.postMessage(['autoUpdateNotification', 'update-available', info]) event.sender.send('autoUpdateNotification', 'update-available', info)
}) })
autoUpdater.on('update-downloaded', (info) => { autoUpdater.on('update-downloaded', (info) => {
autoUpdateChannel.port1.postMessage(['autoUpdateNotification', 'update-downloaded', info]) event.sender.send('autoUpdateNotification', 'update-downloaded', info)
}) })
autoUpdater.on('update-not-available', (info) => { autoUpdater.on('update-not-available', (info) => {
autoUpdateChannel.port1.postMessage(['autoUpdateNotification', 'update-not-available', info]) event.sender.send('autoUpdateNotification', 'update-not-available', info)
}) })
autoUpdater.on('checking-for-update', () => { autoUpdater.on('checking-for-update', () => {
autoUpdateChannel.port1.postMessage(['autoUpdateNotification', 'checking-for-update']) event.sender.send('autoUpdateNotification', 'checking-for-update')
}) })
autoUpdater.on('error', (err) => { autoUpdater.on('error', (err) => {
autoUpdateChannel.port1.postMessage(['autoUpdateNotification', 'realerror', err]) event.sender.send('autoUpdateNotification', 'realerror', err)
}) })
} }
/*
// all on autoupdatechannel
[
command,
arg1,
arg2,
...
]
*/
autoUpdateChannel.port1.on('message', (event) => {
const command = event[0]
switch(command) {
case 'initAutoUpdater':
console.log('Initializing auto updater.')
initAutoUpdater(event[1])
autoUpdateChannel.port1.postMessage([
'autoUpdateNotification',
'ready'
])
break
case 'checkForUpdate':
// TODO Test that error is passed properly
autoUpdater.checkForUpdates()
.catch(err => {
autoUpdateChannel.port1.postMessage([
'autoUpdateNotification',
'realerror',
err
])
})
break
case 'allowPrereleaseChange':
if(!event[1]){
const preRelComp = semver.prerelease(app.getVersion())
if(preRelComp != null && preRelComp.length > 0){
autoUpdater.allowPrerelease = true
} else {
autoUpdater.allowPrerelease = event[1]
}
} else {
autoUpdater.allowPrerelease = event[1]
}
break
case 'installUpdateNow':
autoUpdater.quitAndInstall()
break
default:
console.log('Unknown command', command)
break
}
})
// Open channel to listen for update actions. // Open channel to listen for update actions.
ipcMain.on('autoUpdateAction', (event, arg, data) => { ipcMain.on('autoUpdateAction', (event, arg, data) => {
switch(arg){ switch(arg){
@ -220,6 +84,10 @@ ipcMain.on('autoUpdateAction', (event, arg, data) => {
break break
} }
}) })
// Redirect distribution index event from preloader to renderer.
ipcMain.on('distributionIndexDone', (event, res) => {
event.sender.send('distributionIndexDone', res)
})
// Handle trash item. // Handle trash item.
ipcMain.handle(SHELL_OPCODE.TRASH_ITEM, async (event, ...args) => { ipcMain.handle(SHELL_OPCODE.TRASH_ITEM, async (event, ...args) => {
@ -257,7 +125,7 @@ ipcMain.on(MSFT_OPCODE.OPEN_LOGIN, (ipcEvent, ...arguments_) => {
msftAuthViewSuccess = arguments_[0] msftAuthViewSuccess = arguments_[0]
msftAuthViewOnClose = arguments_[1] msftAuthViewOnClose = arguments_[1]
msftAuthWindow = new BrowserWindow({ msftAuthWindow = new BrowserWindow({
title: queryJS('index.microsoftLoginTitle'), title: LangLoader.queryJS('index.microsoftLoginTitle'),
backgroundColor: '#222222', backgroundColor: '#222222',
width: 520, width: 520,
height: 600, height: 600,
@ -310,7 +178,7 @@ ipcMain.on(MSFT_OPCODE.OPEN_LOGOUT, (ipcEvent, uuid, isLastAccount) => {
msftLogoutSuccess = false msftLogoutSuccess = false
msftLogoutSuccessSent = false msftLogoutSuccessSent = false
msftLogoutWindow = new BrowserWindow({ msftLogoutWindow = new BrowserWindow({
title: queryJS('index.microsoftLogoutTitle'), title: LangLoader.queryJS('index.microsoftLogoutTitle'),
backgroundColor: '#222222', backgroundColor: '#222222',
width: 520, width: 520,
height: 600, height: 600,
@ -366,18 +234,15 @@ function createWindow() {
webPreferences: { webPreferences: {
preload: path.join(__dirname, 'app', 'assets', 'js', 'preloader.js'), preload: path.join(__dirname, 'app', 'assets', 'js', 'preloader.js'),
nodeIntegration: true, nodeIntegration: true,
contextIsolation: true contextIsolation: false
}, },
backgroundColor: '#171614' backgroundColor: '#171614'
}) })
remoteMain.enable(win.webContents)
// Disable zoom, needed for darwin.
win.webContents.setZoomLevel(0)
win.webContents.setVisualZoomLevelLimits(1, 1)
const data = { const data = {
bkid: Math.floor((Math.random() * fs.readdirSync(path.join(__dirname, 'app', 'assets', 'images', 'backgrounds')).length)), bkid: Math.floor((Math.random() * fs.readdirSync(path.join(__dirname, 'app', 'assets', 'images', 'backgrounds')).length)),
lang: (str, placeHolders) => queryEJS(str, placeHolders) lang: (str, placeHolders) => LangLoader.queryEJS(str, placeHolders)
} }
Object.entries(data).forEach(([key, val]) => ejse.data(key, val)) Object.entries(data).forEach(([key, val]) => ejse.data(key, val))
@ -476,47 +341,8 @@ function getPlatformIcon(filename){
return path.join(__dirname, 'app', 'assets', 'images', `${filename}.${ext}`) return path.join(__dirname, 'app', 'assets', 'images', `${filename}.${ext}`)
} }
app.whenReady().then(() => { app.on('ready', createWindow)
app.on('ready', createMenu)
ipcMain.handle('os.totalmem', () => totalmem())
ipcMain.handle('os.freemem', () => freemem())
ipcMain.handle('semver.prerelease', (version) => prerelease(version))
ipcMain.handle('path.join', (...args) => path.join(args))
ipcMain.handle('app.isDev', () => !app.isPackaged)
ipcMain.handle('app.getVersion', () => app.getVersion())
ipcMain.handle('shell.openExternal', (url) => shell.openExternal(url))
ipcMain.handle('shell.openPath', (path) => shell.openPath(path))
ipcMain.handle('xwindow.close', () => win.close())
ipcMain.handle('xwindow.setProgressBar', (progress) => win.setProgressBar(progress))
ipcMain.handle('xwindow.toggleDevTools', () => win.webContents.toggleDevTools())
ipcMain.handle('xwindow.minimize', () => win.minimize())
ipcMain.handle('xwindow.maximize', () => win.maximize())
ipcMain.handle('xwindow.unmaximize', () => win.unmaximize())
ipcMain.handle('xwindow.isMaximized', () => win.isMaximized())
ipcMain.handle('process.platform', () => process.platform)
ipcMain.handle('process.arch', () => process.arch)
ipcMain.handle('hc.type', () => Type)
ipcMain.handle('AuthManager.addMojangAccount', async (username, password) => await addMojangAccount(username, password))
ipcMain.handle('AuthManager.addMicrosoftAccount', async (authCode) => await addMicrosoftAccount(authCode))
ipcMain.handle('AuthManager.removeMojangAccount', async (uuid) => await removeMojangAccount(uuid))
ipcMain.handle('AuthManager.removeMicrosoftAccount', async (uuid) => await removeMicrosoftAccount(uuid))
ipcMain.handle('AuthManager.validateSelected', async () => await validateSelected())
ipcMain.handle('Lang.getLang', () => getLang())
ipcMain.handle('AutoUpdater.port2', () => autoUpdateChannel.port2)
createWindow()
createMenu()
})
app.on('window-all-closed', () => { app.on('window-all-closed', () => {
// On macOS it is common for applications and their menu bar // On macOS it is common for applications and their menu bar

9563
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +1,13 @@
{ {
"name": "helioslauncher", "name": "onimairu-mc_launcher",
"version": "2.0.5", "version": "1.0.1",
"productName": "Helios Launcher", "productName": "ONIMAI.RU MC Launcher",
"description": "Modded Minecraft Launcher", "description": "Modded Minecraft Launcher",
"author": "Daniel Scalzi (https://github.com/dscalzi/)", "author": "ONIMAI.RU (https://git.onimai.ru/ONIMAI-SMP/)",
"license": "UNLICENSED", "license": "UNLICENSED",
"homepage": "https://github.com/dscalzi/HeliosLauncher", "homepage": "https://git.onimai.ru/ONIMAI-SMP/Launcher",
"bugs": { "bugs": {
"url": "https://github.com/dscalzi/HeliosLauncher/issues" "url": "https://git.onimai.ru/ONIMAI-SMP/Launcher/issues"
}, },
"private": true, "private": true,
"main": "index.js", "main": "index.js",
@ -20,32 +20,32 @@
"lint": "eslint --config .eslintrc.json ." "lint": "eslint --config .eslintrc.json ."
}, },
"engines": { "engines": {
"node": "18.x.x" "node": "20.x.x"
}, },
"dependencies": { "dependencies": {
"@electron/remote": "^2.0.11", "@electron/remote": "^2.1.2",
"adm-zip": "^0.5.9", "adm-zip": "^0.5.16",
"discord-rpc-patch": "^4.0.1", "discord-rpc-patch": "^4.0.1",
"ejs": "^3.1.9", "ejs": "^3.1.10",
"ejs-electron": "^2.1.1", "ejs-electron": "^3.0.0",
"electron-updater": "^6.1.4", "electron-updater": "^6.3.9",
"fs-extra": "^11.1.1", "fs-extra": "^11.1.1",
"github-syntax-dark": "^0.5.0", "github-syntax-dark": "^0.5.0",
"got": "^11.8.5", "got": "^11.8.5",
"helios-core": "~2.0.5", "helios-core": "~2.2.3",
"helios-distribution-types": "^1.2.0", "helios-distribution-types": "^1.3.0",
"jquery": "^3.7.1", "jquery": "^3.7.1",
"lodash.merge": "^4.6.2", "lodash.merge": "^4.6.2",
"semver": "^7.5.4", "semver": "^7.6.3",
"toml": "^3.0.0" "toml": "^3.0.0"
}, },
"devDependencies": { "devDependencies": {
"electron": "^26.3.0", "electron": "^33.2.1",
"electron-builder": "^24.6.4", "electron-builder": "^25.1.8",
"eslint": "^8.50.0" "eslint": "^8.57.1"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/dscalzi/HeliosLauncher.git" "url": "git+https://git.onimai.ru/ONIMAI-SMP/Launcher.git"
} }
} }