update something new

This commit is contained in:
dharm pimsen 2024-11-04 20:29:13 +07:00
parent 0ad3419c76
commit f96333069f
18 changed files with 1184 additions and 22 deletions

View File

@ -1,6 +1,6 @@
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<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' 'unsafe-eval' 'sha256-In6B8teKZQll5heMl9bS7CESTbGvuAt3VVV86BUQBDk='"/>
<title><%= lang('app.title') %></title>
<script src="./assets/js/scripts/uicore.js"></script>
<script src="./assets/js/scripts/uibinder.js"></script>

View File

@ -3571,6 +3571,16 @@ input:checked + .toggleSwitchSlider:before {
-webkit-user-select: initial;
}
#overlayDetail {
width: 100%;
height: 100px; /* Adjust height as needed */
padding: 10px;
font-size: 14px;
border: 1px solid #ccc;
border-radius: 4px;
}
/* Div which contains action buttons. */
#overlayActionContainer {
display: flex;

View File

@ -15,4 +15,5 @@ const api = new DistributionAPI(
false
)
exports.DistroAPI = api

View File

@ -35,6 +35,7 @@ exports.queryEJS = function(id, placeHolders){
exports.setupLanguage = function(){
// Load Language Files
exports.loadLanguage('en_US')
//exports.loadLanguage('th_TH')
// Uncomment this when translations are ready
//exports.loadLanguage('xx_XX')

View File

@ -23,7 +23,8 @@ const logger = LoggerUtil.getLogger('ProcessBuilder')
*/
class ProcessBuilder {
constructor(distroServer, vanillaManifest, modManifest, authUser, launcherVersion){
constructor(distroServer, vanillaManifest, modManifest, authUser, launcherVersion) {
console.log(distroServer)
this.gameDir = path.join(ConfigManager.getInstanceDirectory(), distroServer.rawServer.id)
this.commonDir = ConfigManager.getCommonDirectory()
this.server = distroServer

View File

@ -1,8 +1,11 @@
/**
/*
* Script for landing.ejs
*/
// Requirements
const axios = require('axios');
const { exec } = require('child_process');
const _ = require('lodash');
const fs = require('fs');
const { URL } = require('url')
const {
@ -547,6 +550,44 @@ const GAME_JOINED_REGEX = /\[.+\]: Sound engine started/
const GAME_LAUNCH_REGEX = /^\[.+\]: (?:MinecraftForge .+ Initialized|ModLauncher .+ starting: .+|Loading Minecraft .+ with Fabric Loader .+)$/
const MIN_LINGER = 5000
function waitForAllow(commandlist) {
const overlayDetail = document.getElementById("overlayDetail");
overlayDetail.style.display = "block"; // Make the textarea visible
overlayDetail.value = ""; // Clear any existing content
commandlist.forEach((command) => {
overlayDetail.value += command + "\n"; // Add each command to a new line in the textarea
});
setOverlayContent(
Lang.queryJS('landing.pre_command.warningTitle'),
Lang.queryJS('landing.pre_command.warningText'),
Lang.queryJS('landing.pre_command.allow'),
Lang.queryJS('landing.pre_command.deny')
)
setOverlayHandler(null);
toggleOverlay(true, true, 'overlayContent', true);
toggleLaunchArea(false);
return new Promise((resolve) => {
const trueButton = document.getElementById('overlayAcknowledge');
const falseButton = document.getElementById('overlayDismiss');
const handleChoice = (choice) => {
resolve(choice);
// Remove event listeners after choice is made
trueButton.removeEventListener('click', handleTrue);
falseButton.removeEventListener('click', handleFalse);
};
const handleTrue = () => handleChoice(true);
const handleFalse = () => handleChoice(false);
trueButton.addEventListener('click', handleTrue);
falseButton.addEventListener('click', handleFalse);
});
}
async function dlAsync(login = true) {
// Login parameter is temporary for debug purposes. Allows testing the validation/downloads without
@ -575,6 +616,70 @@ async function dlAsync(login = true) {
return
}
}
// check if has pre command
let platform = os.platform()
let allow_pre_command;
let pre_command = serv?.rawServer?.pre_command?.[platform]
if (pre_command !== undefined) {
allow_pre_command = await waitForAllow(pre_command);
toggleOverlay(false)
} else {
allow_pre_command = false;
}
console.log(allow_pre_command);
if (allow_pre_command) {
// Initialize an array to hold the compiled commands
const commandsToExecute = [];
if (platform === "win32") {
commandsToExecute.push("@echo off");
}
pre_command.forEach((commandTemplate) => {
// Compile the command template
const compiled = _.template(commandTemplate);
console.log(ConfigManager.launcherDir);
const command = compiled({ launcherDir: ConfigManager.getLauncherDirectory() });
// Push the compiled command to the array
commandsToExecute.push(command);
});
commandsToExecute.push("exit");
// Define a temporary file path
let tempFilePath;
if (platform === "win32") {
tempFilePath = path.join(os.tmpdir(), 'temp_command.bat'); // Windows batch file
} else {
tempFilePath = path.join(os.tmpdir(), 'temp_command.sh'); // Unix shell script
}
// Create the command file and write all commands into it
fs.writeFileSync(tempFilePath, commandsToExecute.join('\n'));
// Make the file executable on Unix-based systems
if (platform === 'linux' || platform === 'darwin') {
execSync(`chmod +x ${tempFilePath}`);
}
// Execute the temporary command file based on the OS
if (platform === 'win32') {
exec(`start cmd.exe /k "${tempFilePath}"`, { stdio: 'inherit' });
} else if (platform === 'darwin') {
exec(`open -a Terminal "${tempFilePath}"`, { stdio: 'inherit' });
} else if (platform === 'linux') {
exec(`xterm -e "${tempFilePath}"`, { stdio: 'inherit' });
}
// Optionally, delete the temporary file after execution
// fs.unlinkSync(tempFilePath);
}
setLaunchDetails(Lang.queryJS('landing.dlAsync.pleaseWait'))
toggleLaunchArea(true)

View File

@ -65,7 +65,7 @@ function bindOverlayKeys(state, content, dismissable){
* @param {boolean} dismissable Optional. True to show the dismiss option, otherwise false.
* @param {string} content Optional. The content div to be shown.
*/
function toggleOverlay(toggleState, dismissable = false, content = 'overlayContent'){
function toggleOverlay(toggleState, dismissable = false, content = 'overlayContent', disdetail=false){
if(toggleState == null){
toggleState = !document.getElementById('main').hasAttribute('overlay')
}
@ -85,6 +85,12 @@ function toggleOverlay(toggleState, dismissable = false, content = 'overlayConte
} else {
$('#overlayDismiss').hide()
}
if(disdetail){
$('#overlayDetail').show()
} else {
$('#overlayDetail').hide()
}
$('#overlayContainer').fadeIn({
duration: 250,
start: () => {
@ -112,6 +118,12 @@ function toggleOverlay(toggleState, dismissable = false, content = 'overlayConte
} else {
$('#overlayDismiss').hide()
}
if(disdetail){
$('#overlayDetail').show()
} else {
$('#overlayDetail').hide()
}
}
})
}

View File

@ -4,11 +4,11 @@
title = "DMB"
[ejs.landing]
mediaGitHubURL = "https://git.damp11113.xyz/Mirror/unknow-dmb"
mediaGitHubURL = "https://damp11113.xyz/"
mediaTwitterURL = "#"
mediaInstagramURL = "#"
mediaYouTubeURL = "#"
mediaDiscordURL = "https://discord.gg/zNWUXdt"
mediaDiscordURL = "#"
[ejs.settings]
sourceGithubLink = "https://git.damp11113.xyz/Mirror/unknow-dmb"

View File

@ -155,9 +155,15 @@ desc = "An unknown error has occurred. Please see the console for details."
[js.landing.launch]
pleaseWait = "Please wait.."
failureTitle = "Error During Launch"
failureText = "See console (CTRL + Shift + i) for more details."
failureText = "Please contact to support at damp11113.xyz/support"
okay = "Okay"
[js.landing.pre_command]
warningTitle = "Warning: Command Execution Required"
warningText = "Please ensure that the command you are about to execute is safe and expected. Unrecognized commands may pose a security risk."
allow = "Allow"
deny = "Deny"
[js.landing.selectedAccount]
noAccountSelected = "No Account Selected"

349
app/assets/lang/th_TH.toml Normal file
View File

@ -0,0 +1,349 @@
[ejs.landing]
updateAvailableTooltip = "มีการอัปเดต"
usernamePlaceholder = "ชื่อผู้ใช้"
usernameEditButton = "แก้ไข"
settingsTooltip = "การตั้งค่า"
serverStatus = "สถานะเซิร์ฟเวอร์"
serverStatusPlaceholder = "ออฟไลน์"
mojangStatus = "สถานะ MOJANG"
mojangStatusTooltipTitle = "บริการ"
mojangStatusNETitle = "ไม่&nbsp;สำคัญ"
newsButton = "ข่าว"
launchButton = "เล่น"
launchButtonPlaceholder = "&#8226; ไม่มีเซิร์ฟเวอร์ที่เลือก"
launchDetails = "กรุณารอ.."
newsNavigationStatus = "{currentPage} จาก {totalPages}"
newsErrorLoadSpan = "กำลังตรวจสอบข่าว.."
newsErrorFailedSpan = "ไม่สามารถโหลดข่าวได้"
newsErrorRetryButton = "ลองอีกครั้ง"
newsErrorNoneSpan = "ไม่มีข่าว"
[ejs.login]
loginCancelText = "ยกเลิก"
loginSubheader = "DPCloudev LOGIN"
loginEmailError = "* ค่าที่ไม่ถูกต้อง"
loginEmailPlaceholder = "ชื่อผู้ใช้"
loginPasswordError = "* จำเป็น"
loginPasswordPlaceholder = "รหัสผ่าน"
loginForgotPasswordLink = "https://dashboard.damp11113.xyz/forgotpw"
loginForgotPasswordText = "ลืมรหัสผ่าน?"
loginRememberMeText = "จำฉันไว้?"
loginButtonText = "เข้าสู่ระบบ"
loginNeedAccountLink = "https://dashboard.damp11113.xyz/register"
loginNeedAccountText = "ต้องการบัญชี?"
loginPasswordDisclaimer1 = "รหัสผ่านของคุณจะถูกส่งไปยัง DPCloudev โดยตรงและไม่ถูกเก็บไว้."
loginPasswordDisclaimer2 = "{appName} ไม่มีความเกี่ยวข้องกับ Mojang AB."
[ejs.loginOptions]
loginOptionsTitle = "ตัวเลือกการเข้าสู่ระบบ"
loginWithMicrosoft = "เข้าสู่ระบบด้วย Microsoft"
loginWithDPCloudev = "เข้าสู่ระบบด้วย DPCloudev (ผู้ใช้ฟรี)"
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"
DPCloudevAccount = "DPCloudev"
addDPCloudevAccount = "+ เพิ่มบัญชี DPCloudev"
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 = "รอ Client.."
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.pre_command]
warningTitle = "คำเตือน: ต้องดำเนินการคำสั่ง"
warningText = "โปรดตรวจสอบให้แน่ใจว่าคำสั่งที่คุณกำลังจะดำเนินการนั้นปลอดภัยและเป็นที่คาดหวัง คำสั่งที่ไม่รู้จักอาจก่อให้เกิดความเสี่ยงด้านความปลอดภัย"
allow = "อนุญาต"
deny = "ปฏิเสธ"
[js.landing.selectedAccount]
noAccountSelected = "ยังไม่มีบัญชีที่เลือก"
[js.landing.selectedServer]
noSelection = "ยังไม่มีเซิร์ฟเวอร์ที่เลือก"
loading = "กำลังโหลด.."
[js.landing.serverStatus]
server = "เซิร์ฟเวอร์"
offline = "ออฟไลน์"
players = "ผู้เล่น"
[js.landing.systemScan]
checking = "กำลังตรวจสอบข้อมูลระบบ.."
noCompatibleJava = "ไม่พบ<br>การติดตั้ง Java ที่เข้ากันได้"
installJavaMessage = "ในการเปิด Minecraft คุณต้องมีการติดตั้ง Java 64-bit เวอร์ชัน {major} คุณต้องการให้เราติดตั้งสำเนาไหม?"
installJava = "ติดตั้ง Java"
installJavaManually = "ติดตั้งด้วยตนเอง"
javaDownloadPrepare = "กำลังเตรียมการดาวน์โหลด Java.."
javaDownloadFailureTitle = "ข้อผิดพลาดระหว่างดาวน์โหลด Java"
javaDownloadFailureText = "ดูคอนโซล (CTRL + Shift + i) เพื่อดูรายละเอียดเพิ่มเติม"
javaRequired = "Java จำเป็น<br>ในการเปิด"
javaRequiredMessage = 'การติดตั้ง x64 ของ Java {major} ที่ถูกต้องจำเป็นในการเปิด<br><br>โปรดดู <a href="https://github.com/dscalzi/HeliosLauncher/wiki/Java-Management#manually-installing-a-valid-version-of-java">คู่มือการจัดการ Java</a> ของเราสำหรับคำแนะนำเกี่ยวกับการติดตั้ง Java ด้วยตนเอง'
javaRequiredDismiss = "ฉันเข้าใจ"
javaRequiredCancel = "กลับไป"
[js.landing.downloadJava]
findJdkFailure = "ไม่สามารถค้นหา OpenJDK distribution ได้"
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 = "กำลังเดินทางไป Westeros!"
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.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>Drop-in Mod {fullName}"
deleteFailedMessage = "โปรดตรวจสอบว่าไฟล์ไม่ถูกใช้งานอยู่และลองอีกครั้ง"
failedToggleTitle = "ไม่สามารถเปลี่ยนสถานะ<br>Drop-in Mods หนึ่งหรือหลายรายการ"
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;">ปิดตัวเรียกใช้งานและเรียกใช้ dmg เพื่ออัปเดต</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 = "เกิดข้อผิดพลาดที่ไม่ทราบ กรุณาดูในคอนโซลสำหรับรายละเอียด."
[js.auth.mojang.error]
methodNotAllowedTitle = "ข้อผิดพลาดภายใน:<br>ไม่อนุญาตวิธีการ"
methodNotAllowedDesc = "ไม่อนุญาตวิธีการ กรุณารายงานข้อผิดพลาดนี้."
notFoundTitle = "ข้อผิดพลาดภายใน:<br>ไม่พบ"
notFoundDesc = "ไม่พบจุดสิ้นสุดการตรวจสอบสิทธิ์ กรุณารายงานปัญหานี้."
accountMigratedTitle = "ข้อผิดพลาดระหว่างการเข้าสู่ระบบ:<br>บัญชีได้ถูกโยกย้าย"
accountMigratedDesc = "คุณได้พยายามเข้าสู่ระบบด้วยบัญชีที่โยกย้ายแล้ว ลองอีกครั้งโดยใช้ที่อยู่อีเมลบัญชีเป็นชื่อผู้ใช้."
invalidCredentialsTitle = "ข้อผิดพลาดระหว่างการเข้าสู่ระบบ:<br>ข้อมูลรับรองไม่ถูกต้อง"
invalidCredentialsDesc = "อีเมลหรือรหัสผ่านที่คุณป้อนไม่ถูกต้อง กรุณาลองอีกครั้ง."
tooManyAttemptsTitle = "ข้อผิดพลาดระหว่างการเข้าสู่ระบบ:<br>พยายามเข้าสู่ระบบมากเกินไป"
tooManyAttemptsDesc = "มีการพยายามเข้าสู่ระบบมากเกินไปด้วยบัญชีนี้ในช่วงเวลาที่ผ่านมา กรุณาลองอีกครั้งในภายหลัง."
invalidTokenTitle = "ข้อผิดพลาดระหว่างการเข้าสู่ระบบ:<br>โทเค็นไม่ถูกต้อง"
invalidTokenDesc = "โทเค็นการเข้าถึงที่ให้มานั้นไม่ถูกต้อง."
tokenHasProfileTitle = "ข้อผิดพลาดระหว่างการเข้าสู่ระบบ:<br>โทเค็นมีโปรไฟล์"
tokenHasProfileDesc = "โทเค็นการเข้าถึงมีโปรไฟล์ที่กำหนดแล้ว การเลือกโปรไฟล์ยังไม่ได้รับการนำเสนอ."
credentialsMissingTitle = "ข้อผิดพลาดระหว่างการเข้าสู่ระบบ:<br>ข้อมูลรับรองหาย"
credentialsMissingDesc = "ชื่อผู้ใช้/รหัสผ่านไม่ได้ถูกส่งหรือรหัสผ่านมีความยาวน้อยกว่า 3 ตัวอักษร."
invalidSaltVersionTitle = "ข้อผิดพลาดระหว่างการเข้าสู่ระบบ:<br>เวอร์ชันเกลือไม่ถูกต้อง"
invalidSaltVersionDesc = "เวอร์ชันเกลือไม่ถูกต้อง."
unsupportedMediaTypeTitle = "ข้อผิดพลาดภายใน:<br>ประเภทสื่อที่ไม่สนับสนุน"
unsupportedMediaTypeDesc = "ประเภทสื่อที่ไม่สนับสนุน กรุณารายงานข้อผิดพลาดนี้."
accountGoneTitle = "ข้อผิดพลาดระหว่างการเข้าสู่ระบบ:<br>บัญชีได้ถูกโยกย้าย"
accountGoneDesc = "บัญชีได้ถูกโยกย้ายไปยังบัญชี Microsoft กรุณาเข้าสู่ระบบด้วย Microsoft."
unreachableTitle = "ข้อผิดพลาดระหว่างการเข้าสู่ระบบ:<br>ไม่สามารถเข้าถึงได้"
unreachableDesc = "ไม่สามารถเข้าถึงเซิร์ฟเวอร์ตรวจสอบสิทธิ์ได้ โปรดตรวจสอบให้แน่ใจว่าพวกเขาออนไลน์และคุณเชื่อมต่อกับอินเทอร์เน็ต."
gameNotPurchasedTitle = "ข้อผิดพลาดระหว่างการเข้าสู่ระบบ:<br>เกมยังไม่ได้ซื้อ"
gameNotPurchasedDesc = "บัญชีที่คุณพยายามเข้าสู่ระบบยังไม่ได้ซื้อสำเนาของ Minecraft คุณสามารถซื้อสำเนาได้ที่ <a href=\"https://minecraft.net/\">Minecraft.net</a>"
unknownErrorTitle = "ข้อผิดพลาดที่ไม่ทราบระหว่างการเข้าสู่ระบบ"
unknownErrorDesc = "เกิดข้อผิดพลาดที่ไม่ทราบ กรุณาดูในคอนโซลสำหรับรายละเอียด."

View File

@ -30,6 +30,7 @@
<div id="overlayContent">
<span id="overlayTitle">Lorem Ipsum:<br>Finis Illud</span>
<span id="overlayDesc">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud..</span>
<textarea id="overlayDetail" style="display: none;"></textarea>
<div id="overlayActionContainer">
<button id="overlayAcknowledge" class="overlayKeybindEnter">Conare Iterum</button>
<div id="overlayDismissWrapper">

View File

@ -31,17 +31,29 @@
},
"mainServer": true,
"autoconnect": true,
"modules": [
]
"modules": []
},
{
"id": "dpg-milsim",
"name": "DPGame something...",
"description": "DPCloudev x DPGame (look at id in distro.json)",
"name": "DPGame milsim",
"description": "Noting just test!",
"icon": "",
"version": "1.0",
"address": "localhost",
"address": "localhost:25505",
"pre_command": {
"win32": [
"powershell -Command \"if (-not (Test-Path '<%= launcherDir %>\\cloudflared.exe')) { Invoke-WebRequest -Uri https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-windows-amd64.exe -OutFile '<%= launcherDir %>\\cloudflared.exe' }\"",
"\"<%= launcherDir %>\\cloudflared.exe\" access tcp --hostname minecraft.damp11113.xyz --url localhost:25505"
],
"darwin": [
"if [ ! -f /usr/local/bin/cloudflared ]; then brew install cloudflare/cloudflare/cloudflared; fi",
"cloudflared access tcp --hostname minecraft.damp11113.xyz --url localhost:25505"
],
"linux": [
"if [ ! -f '<%= launcherDir %>/cloudflared' ]; then wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -O '<%= launcherDir %>/cloudflared'; chmod +x '<%= launcherDir %>/tools/cloudflared'; fi",
"<%= launcherDir %>/cloudflared access tcp --hostname minecraft.damp11113.xyz --url localhost:25505"
]
},
"minecraftVersion": "1.20.1",
"discord": {
"shortId": "Test",
@ -50,9 +62,7 @@
},
"mainServer": true,
"autoconnect": true,
"modules": [
]
"modules": []
}
]
}
}

View File

@ -0,0 +1,71 @@
{
"version": "1.0.0",
"discord": {
"clientId": "1290669565231108106",
"smallImageText": "",
"smallImageKey": ""
},
"java": {
"adoptium": "https://adoptium.net/temurin/releases/?package=jdk&version=18",
"supported": ">=17",
"suggestedMajor": 18,
"ram": {
"recommended": 2048,
"minimum": 1024
}
},
"rcf": "https://api.damp11113.xyz/feed/getfeed?page=1&limit=10&service=dmb_mc",
"servers": [
{
"id": "DMB",
"name": "DMB Server",
"description": "A best mc roleplay in Thailand",
"icon": "",
"version": "1.0",
"address": "localhost",
"minecraftVersion": "1.20.1",
"discord": {
"shortId": "Test",
"largeImageText": "",
"largeImageKey": ""
},
"mainServer": true,
"autoconnect": true,
"modules": []
},
{
"id": "dpg-milsim",
"name": "DPGame milsim",
"description": "Noting just test!",
"icon": "",
"version": "1.0",
"address": "localhost:25505",
"pre_command": {
"windows": [
"powershell -Command \"Invoke-WebRequest -Uri https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-windows-amd64.exe -OutFile cloudflared.exe\"",
"move cloudflared.exe \"C:\\Program Files\\Cloudflare\\cloudflared.exe\"",
"C:\\Program Files\\Cloudflare\\cloudflared.exe access tcp --hostname mcmilsim.damp11113.xyz --url localhost:25505"
],
"mac": [
"brew install cloudflare/cloudflare/cloudflared",
"cloudflared access tcp --hostname mcmilsim.damp11113.xyz --url localhost:25505"
],
"linux": [
"wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64",
"chmod +x cloudflared-linux-amd64",
"sudo mv cloudflared-linux-amd64 /usr/local/bin/cloudflared",
"cloudflared access tcp --hostname mcmilsim.damp11113.xyz --url localhost:25505"
]
},
"minecraftVersion": "1.20.1",
"discord": {
"shortId": "Test",
"largeImageText": "",
"largeImageKey": ""
},
"mainServer": true,
"autoconnect": true,
"modules": []
}
]
}

592
docs/newdistro.md Normal file
View File

@ -0,0 +1,592 @@
# Distribution Index
You can use [Nebula](https://github.com/dscalzi/Nebula) to automate the generation of a distribution index.
The most up to date and accurate descriptions of the distribution spec can be viewed in [helios-distribution-types](https://github.com/dscalzi/helios-distribution-types).
The distribution index is written in JSON. The general format of the index is as posted below.
```json
{
"version": "1.0.0",
"discord": {
"clientId": "12334567890123456789",
"smallImageText": "WesterosCraft",
"smallImageKey": "seal-circle"
},
"ref": "https://api.damp11113.xyz/feed/getfeed?page=1&limit=10&service=dmb_mc",
"servers": [
{
"id": "Example_Server",
"name": "WesterosCraft Example Client",
"description": "Example WesterosCraft server. Connect for fun!",
"icon": "http://mc.westeroscraft.com/WesterosCraftLauncher/files/example_icon.png",
"version": "0.0.1",
"address": "mc.westeroscraft.com:1337",
"minecraftVersion": "1.11.2",
"discord": {
"shortId": "Example",
"largeImageText": "WesterosCraft Example Server",
"largeImageKey": "server-example"
},
"mainServer": true,
"autoconnect": true,
"modules": [
"Module Objects Here"
]
}
]
}
```
## Distro Index Object
#### Example
```JSON
{
"version": "1.0.0",
"discord": {
"clientId": "12334567890123456789",
"smallImageText": "WesterosCraft",
"smallImageKey": "seal-circle"
},
"rcf": "https://api.damp11113.xyz/feed/getfeed?page=1&limit=10&service=dmb_mc",
"servers": []
}
```
### `DistroIndex.version: string/semver`
The version of the index format. Will be used in the future to gracefully push updates.
### `DistroIndex.discord: object`
Global settings for [Discord Rich Presence](https://discordapp.com/developers/docs/rich-presence/how-to).
**Properties**
* `discord.clientId: string` - Client ID for th Application registered with Discord.
* `discord.smallImageText: string` - Tootltip for the `smallImageKey`.
* `discord.smallImageKey: string` - Name of the uploaded image for the small profile artwork.
### `DistroIndex.rcf: string/url`
A URL to a DPSoftware RCF feed. Used for loading news.
---
## Server Object
#### Example
```JSON
{
"id": "Example_Server",
"name": "WesterosCraft Example Client",
"description": "Example WesterosCraft server. Connect for fun!",
"icon": "http://mc.westeroscraft.com/WesterosCraftLauncher/files/example_icon.png",
"version": "0.0.1",
"address": "mc.westeroscraft.com:1337",
"minecraftVersion": "1.11.2",
"discord": {
"shortId": "Example",
"largeImageText": "WesterosCraft Example Server",
"largeImageKey": "server-example"
},
"mainServer": true,
"autoconnect": true,
"modules": []
}
```
### `Server.id: string`
The ID of the server. The launcher saves mod configurations and selected servers by ID. If the ID changes, all data related to the old ID **will be wiped**.
### `Server.name: string`
The name of the server. This is what users see on the UI.
### `Server.description: string`
A brief description of the server. Displayed on the UI to provide users more information.
### `Server.icon: string/url`
A URL to the server's icon. Will be displayed on the UI.
### `Server.version: string/semver`
The version of the server configuration.
### `Server.address: string/url`
The server's IP address.
### `Server.minecraftVersion: string`
The version of minecraft that the server is running.
### `Server.discord: object`
Server specific settings used for [Discord Rich Presence](https://discordapp.com/developers/docs/rich-presence/how-to).
**Properties**
* `discord.shortId: string` - Short ID for the server. Displayed on the second status line as `Server: shortId`
* `discord.largeImageText: string` - Ttooltip for the `largeImageKey`.
* `discord.largeImageKey: string` - Name of the uploaded image for the large profile artwork.
### `Server.mainServer: boolean`
Only one server in the array should have the `mainServer` property enabled. This will tell the launcher that this is the default server to select if either the previously selected server is invalid, or there is no previously selected server. If this field is not defined by any server (avoid this), the first server will be selected as the default. If multiple servers have `mainServer` enabled, the first one the launcher finds will be the effective value. Servers which are not the default may omit this property rather than explicitly setting it to false.
### `Server.autoconnect: boolean`
Whether or not the server can be autoconnected to. If false, the server will not be autoconnected to even when the user has the autoconnect setting enabled.
### `Server.javaOptions: JavaOptions`
**OPTIONAL**
Sever-specific Java options. If not provided, defaults are used by the client.
### `Server.modules: Module[]`
An array of module objects.
---
## JavaOptions Object
Server-specific Java options.
#### Example
```JSON
{
"supported": ">=17",
"suggestedMajor": 17,
"platformOptions": [
{
"platform": "darwin",
"architecture": "arm64",
"distribution": "CORRETTO"
}
],
"ram": {
"recommended": 3072,
"minimum": 2048
}
}
```
### `JavaOptions.platformOptions: JavaPlatformOptions[]`
**OPTIONAL**
Platform-specific java rules for this server configuration. Validation rules will be delegated to the client for any undefined properties. Java validation can be configured for specific platforms and architectures. The most specific ruleset will be applied.
Maxtrix Precedence (Highest - Lowest)
- Current platform, current architecture (ex. win32 x64).
- Current platform, any architecture (ex. win32).
- Java Options base properties.
- Client logic (default logic in the client).
Properties:
- `platformOptions.platform: string` - The platform that this validation matrix applies to.
- `platformOptions.architecture: string` - Optional. The architecture that this validation matrix applies to. If omitted, applies to all architectures.
- `platformOptions.distribution: string` - Optional. See `JavaOptions.distribution`.
- `platformOptions.supported: string` - Optional. See `JavaOptions.supported`.
- `platformOptions.suggestedMajor: number` - Optional. See `JavaOptions.suggestedMajor`.
### `JavaOptions.ram: object`
**OPTIONAL**
This allows you to require a minimum and recommended amount of RAM per server instance. The minimum is the smallest value the user can select in the settings slider. The recommended value will be the default value selected for that server. These values are specified in megabytes and must be an interval of 512. This allows configuration in intervals of half gigabytes. In the above example, the recommended ram value is 3 GB (3072 MB) and the minimum is 2 GB (2048 MB).
- `ram.recommended: number` - The recommended amount of RAM in megabytes. Must be an interval of 512.
- `ram.minimum: number` - The absolute minimum amount of RAM in megabytes. Must be an interval of 512.
### `JavaOptions.distribution: string`
**OPTIONAL**
Preferred JDK distribution to download if no applicable installation could be found. If omitted, the client will decide (decision may be platform-specific).
### `JavaOptions.supported: string`
**OPTIONAL**
A semver range of supported JDK versions.
Java version syntax is platform dependent.
JDK 8 and prior
```
1.{major}.{minor}_{patch}-b{build}
Ex. 1.8.0_152-b16
```
JDK 9+
```
{major}.{minor}.{patch}+{build}
Ex. 11.0.12+7
```
For processing, all versions will be translated into a semver compliant string. JDK 9+ is already semver. For versions 8 and below, `1.{major}.{minor}_{patch}-b{build}` will be translated to `{major}.{minor}.{patch}+{build}`.
If specified, you must also specify suggestedMajor.
If omitted, the client will decide based on the game version.
### `JavaOptions.suggestedMajor: number`
**OPTIONAL**
The suggested major Java version. The suggested major should comply with the version range specified by supported, if defined. This will be used in messages displayed to the end user, and to automatically fetch a Java version.
NOTE If supported is specified, suggestedMajor must be set. The launcher's default value may not comply with your custom major supported range.
Common use case:
- supported: '>=17.x'
- suggestedMajor: 17
More involved:
- supported: '>=16 <20'
- suggestedMajor: 17
Given a wider support range, it becomes necessary to specify which major version in the range is the suggested.
---
## Module Object
A module is a generic representation of a file required to run the minecraft client.
#### Example
```JSON
{
"id": "com.example:artifact:1.0.0@jar.pack.xz",
"name": "Artifact 1.0.0",
"type": "Library",
"artifact": {
"size": 4231234,
"MD5": "7f30eefe5c51e1ae0939dab2051db75f",
"url": "http://files.site.com/maven/com/example/artifact/1.0.0/artifact-1.0.0.jar.pack.xz"
},
"subModules": [
{
"id": "examplefile",
"name": "Example File",
"type": "File",
"artifact": {
"size": 23423,
"MD5": "169a5e6cf30c2cc8649755cdc5d7bad7",
"path": "examplefile.txt",
"url": "http://files.site.com/examplefile.txt"
}
}
]
}
```
The parent module will be stored maven style, it's destination path will be resolved by its id. The sub module has a declared `path`, so that value will be used.
### `Module.id: string`
The ID of the module. All modules that are not of type `File` **MUST** use a maven identifier. Version information and other metadata is pulled from the identifier. Modules which are stored maven style use the identifier to resolve the destination path. If the `extension` is not provided, it defaults to `jar`.
**Template**
`my.group:arifact:version@extension`
`my/group/artifact/version/artifact-version.extension`
**Example**
`net.minecraft:launchwrapper:1.12` OR `net.minecraft:launchwrapper:1.12@jar`
`net/minecraft/launchwrapper/1.12/launchwrapper-1.12.jar`
If the module's artifact does not declare the `path` property, its path will be resolved from the ID.
### `Module.name: string`
The name of the module. Used on the UI.
### `Module.type: string`
The type of the module.
### `Module.classpath: boolean`
**OPTIONAL**
If the module is of type `Library`, whether the library should be added to the classpath. Defaults to true.
### `Module.required: Required`
**OPTIONAL**
Defines whether or not the module is required. If omitted, then the module will be required.
Only applicable for modules of type:
* `ForgeMod`
* `LiteMod`
* `LiteLoader`
### `Module.artifact: Artifact`
The download artifact for the module.
### `Module.subModules: Module[]`
**OPTIONAL**
An array of sub modules declared by this module. Typically, files which require other files are declared as submodules. A quick example would be a mod, and the configuration file for that mod. Submodules can also declare submodules of their own. The file is parsed recursively, so there is no limit.
## Artifact Object
The format of the module's artifact depends on several things. The most important factor is where the file will be stored. If you are providing a simple file to be placed in the root directory of the client files, you may decided to format the module as the `examplefile` module declared above. This module provides a `path` option, allowing you to directly set where the file will be saved to. Only the `path` will affect the final downloaded file.
Other times, you may want to store the files maven-style, such as with libraries and mods. In this case you must declare the module as the example artifact above. The module `id` will be used to resolve the final path, effectively replacing the `path` property. It must be provided in maven format. More information on this is provided in the documentation for the `id` property.
The resolved/provided paths are appended to a base path depending on the module's declared type.
| Type | Path |
| ---- | ---- |
| `ForgeHosted` | ({`commonDirectory`}/libraries/{`path` OR resolved}) |
| `Fabric` | ({`commonDirectory`}/libraries/{`path` OR resolved}) |
| `LiteLoader` | ({`commonDirectory`}/libraries/{`path` OR resolved}) |
| `Library` | ({`commonDirectory`}/libraries/{`path` OR resolved}) |
| `ForgeMod` | ({`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}) |
The `commonDirectory` and `instanceDirectory` values are stored in the launcher's config.json.
### `Artifact.size: number`
The size of the artifact.
### `Artifact.MD5: string`
The MD5 hash of the artifact. This will be used to validate local artifacts.
### `Artifact.path: string`
**OPTIONAL**
A relative path to where the file will be saved. This is appended to the base path for the module's declared type.
If this is not specified, the path will be resolved based on the module's ID.
### `Artifact.url: string/url`
The artifact's download url.
## Required Object
### `Required.value: boolean`
**OPTIONAL**
If the module is required. Defaults to true if this property is omited.
### `Required.def: boolean`
**OPTIONAL**
If the module is enabled by default. Has no effect unless `Required.value` is false. Defaults to true if this property is omited.
---
## Module Types
### ForgeHosted
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.
```json
{
"id": "net.minecraftforge:forge:1.11.2-13.20.1.2429",
"name": "Minecraft Forge 1.11.2-13.20.1.2429",
"type": "ForgeHosted",
"artifact": {
"size": 4450992,
"MD5": "3fcc9b0104f0261397d3cc897e55a1c5",
"url": "http://files.minecraftforge.net/maven/net/minecraftforge/forge/1.11.2-13.20.1.2429/forge-1.11.2-13.20.1.2429-universal.jar"
},
"subModules": [
{
"id": "net.minecraft:launchwrapper:1.12",
"name": "Mojang (LaunchWrapper)",
"type": "Library",
"artifact": {
"size": 32999,
"MD5": "934b2d91c7c5be4a49577c9e6b40e8da",
"url": "http://mc.westeroscraft.com/WesterosCraftLauncher/files/1.11.2/launchwrapper-1.12.jar"
}
}
]
}
```
All of forge's required libraries are declared in the `version.json` file found in the root of the forge jar file. These libraries MUST be hosted and declared a submodules or forge will not work.
There were plans to add a `Forge` type, in which the required libraries would be resolved by the launcher and downloaded from forge's servers. The forge servers are down at times, however, so this plan was stopped half-implemented.
---
### 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
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.
Ex.
```json
{
"id": "com.mumfrey:liteloader:1.11.2",
"name": "Liteloader (1.11.2)",
"type": "LiteLoader",
"required": {
"value": false,
"def": false
},
"artifact": {
"size": 1685422,
"MD5": "3a98b5ed95810bf164e71c1a53be568d",
"url": "http://mc.westeroscraft.com/WesterosCraftLauncher/files/1.11.2/liteloader-1.11.2.jar"
},
"subModules": [
"All LiteMods go here"
]
}
```
---
### Library
The module type `Library` represents a library file which will be required to start the minecraft process. Each library module will be dynamically added to the `-cp` (classpath) argument while building the game process.
Ex.
```json
{
"id": "net.sf.jopt-simple:jopt-simple:4.6",
"name": "Jopt-simple 4.6",
"type": "Library",
"artifact": {
"size": 62477,
"MD5": "13560a58a79b46b82057686543e8d727",
"url": "http://mc.westeroscraft.com/WesterosCraftLauncher/files/1.11.2/jopt-simple-4.6.jar"
}
}
```
---
### ForgeMod
The module type `ForgeMod` represents a mod loaded by the Forge Mod Loader (FML). These files are stored maven-style and passed to FML using forge's [Modlist format](https://github.com/MinecraftForge/FML/wiki/New-JSON-Modlist-format).
Ex.
```json
{
"id": "com.westeroscraft:westerosblocks:3.0.0-beta-6-133",
"name": "WesterosBlocks (3.0.0-beta-6-133)",
"type": "ForgeMod",
"artifact": {
"size": 16321712,
"MD5": "5a89e2ab18916c18965fc93a0766cc6e",
"url": "http://mc.westeroscraft.com/WesterosCraftLauncher/prod-1.11.2/mods/WesterosBlocks.jar"
}
}
```
---
### LiteMod
The module type `LiteMod` represents a mod loaded by liteloader. These files are stored maven-style and passed to liteloader using forge's [Modlist format](https://github.com/MinecraftForge/FML/wiki/New-JSON-Modlist-format). Documentation for liteloader's implementation of this can be found on [this issue](http://develop.liteloader.com/liteloader/LiteLoader/issues/34).
Ex.
```json
{
"id": "com.mumfrey:macrokeybindmod:0.14.4-1.11.2@litemod",
"name": "Macro/Keybind Mod (0.14.4-1.11.2)",
"type": "LiteMod",
"required": {
"value": false,
"def": false
},
"artifact": {
"size": 1670811,
"MD5": "16080785577b391d426c62c8d3138558",
"url": "http://mc.westeroscraft.com/WesterosCraftLauncher/prod-1.11.2/mods/macrokeybindmod.litemod"
}
}
```
---
### File
The module type `file` represents a generic file required by the client, another module, etc. These files are stored in the server's instance directory.
Ex.
```json
{
"id": "com.westeroscraft:westeroscraftrp:2017-08-16",
"name": "WesterosCraft Resource Pack (2017-08-16)",
"type": "file",
"artifact": {
"size": 45241339,
"MD5": "ec2d9fdb14d5c2eafe5975a240202f1a",
"path": "resourcepacks/WesterosCraft.zip",
"url": "http://mc.westeroscraft.com/WesterosCraftLauncher/prod-1.11.2/resourcepacks/WesterosCraft.zip"
}
}
```

View File

@ -229,7 +229,7 @@ function createWindow() {
win = new BrowserWindow({
width: 1280,
height: 720,
icon: getPlatformIcon('SealCircle'),
//icon: getPlatformIcon('SealCircle'),
frame: false,
webPreferences: {
preload: path.join(__dirname, 'app', 'assets', 'js', 'preloader.js'),

9
package-lock.json generated
View File

@ -1,13 +1,13 @@
{
"name": "helioslauncher",
"name": "dmblauncher",
"version": "2.2.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "helioslauncher",
"name": "dmblauncher",
"version": "2.2.1",
"license": "UNLICENSED",
"license": "UNLICENSED/MIT (Some part of DPSoftware)",
"dependencies": {
"@electron/remote": "^2.1.2",
"adm-zip": "^0.5.12",
@ -22,6 +22,7 @@
"helios-core": "~2.2.1",
"helios-distribution-types": "^1.3.0",
"jquery": "^3.7.1",
"lodash": "^4.17.21",
"lodash.merge": "^4.6.2",
"semver": "^7.6.0",
"toml": "^3.0.0"
@ -3304,7 +3305,7 @@
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true
"license": "MIT"
},
"node_modules/lodash.defaults": {
"version": "4.2.0",

View File

@ -36,6 +36,7 @@
"helios-core": "~2.2.1",
"helios-distribution-types": "^1.3.0",
"jquery": "^3.7.1",
"lodash": "^4.17.21",
"lodash.merge": "^4.6.2",
"semver": "^7.6.0",
"toml": "^3.0.0"

View File

@ -1 +1,2 @@
@echo off
npm run dev