diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..914c7de --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 DPSoftware + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/app/app.ejs b/app/app.ejs index c69c395..704f6d6 100644 --- a/app/app.ejs +++ b/app/app.ejs @@ -39,25 +39,169 @@ <%- include('overlay') %>
-
+

Please wait...

+
+ + + + + DOPFoundation + + + Powered by + +
diff --git a/app/assets/js/configmanager.js b/app/assets/js/configmanager.js index 2a0cef9..2e0cb01 100644 --- a/app/assets/js/configmanager.js +++ b/app/assets/js/configmanager.js @@ -5,11 +5,12 @@ const path = require('path') const logger = LoggerUtil.getLogger('ConfigManager') -const sysRoot = process.env.APPDATA || (process.platform == 'darwin' ? process.env.HOME + '/Library/Application Support' : process.env.HOME) - -const dataPath = path.join(sysRoot, '.DPSlauncher') - +// Use Electron's 'userData' path directly for dataPath const launcherDir = require('@electron/remote').app.getPath('userData') +const dataPath = path.join(launcherDir, '.minecraft') + +logger.info('Data path is set to:', dataPath) + /** * Retrieve the absolute path of the launcher directory. diff --git a/app/assets/js/processbuilder.js b/app/assets/js/processbuilder.js index 0e95562..82791bd 100644 --- a/app/assets/js/processbuilder.js +++ b/app/assets/js/processbuilder.js @@ -368,7 +368,7 @@ class ProcessBuilder { // Java Arguments if(process.platform === 'darwin'){ - args.push('-Xdock:name=HeliosLauncher') + args.push('-Xdock:name=DMBLauncher') args.push('-Xdock:icon=' + path.join(__dirname, '..', 'images', 'minecraft.icns')) } args.push('-Xmx' + ConfigManager.getMaxRAM(this.server.rawServer.id)) @@ -419,7 +419,7 @@ class ProcessBuilder { // Java Arguments if(process.platform === 'darwin'){ - args.push('-Xdock:name=HeliosLauncher') + args.push('-Xdock:name=DMBLauncher') args.push('-Xdock:icon=' + path.join(__dirname, '..', 'images', 'minecraft.icns')) } args.push('-Xmx' + ConfigManager.getMaxRAM(this.server.rawServer.id)) diff --git a/app/assets/js/scripts/landing.js b/app/assets/js/scripts/landing.js index 40c1751..990d3b0 100644 --- a/app/assets/js/scripts/landing.js +++ b/app/assets/js/scripts/landing.js @@ -1040,11 +1040,9 @@ document.addEventListener('keydown', (e) => { */ function displayArticle(articleObject, index){ newsArticleTitle.innerHTML = articleObject.title - newsArticleTitle.href = articleObject.link newsArticleAuthor.innerHTML = 'by ' + articleObject.author newsArticleDate.innerHTML = articleObject.date - newsArticleComments.innerHTML = articleObject.comments - newsArticleComments.href = articleObject.commentsLink + newsArticleFeedServerIcon.innerHTML = `icon of feed server` newsArticleContentScrollable.innerHTML = '
' + articleObject.content + '
' Array.from(newsArticleContentScrollable.getElementsByClassName('bbCodeSpoilerButton')).forEach(v => { v.onclick = () => { @@ -1060,71 +1058,71 @@ function displayArticle(articleObject, index){ * Load news information from the RSS feed specified in the * distribution index. */ -async function loadNews(){ +async function loadNews() { - const distroData = await DistroAPI.getDistribution() - if(!distroData.rawDistribution.rss) { - loggerLanding.debug('No RSS feed provided.') - return null + const distroData = await DistroAPI.getDistribution(); + if (!distroData.rawDistribution.rcf) { + loggerLanding.debug('No RCF feed provided.'); + return null; } const promise = new Promise((resolve, reject) => { - - const newsFeed = distroData.rawDistribution.rss - const newsHost = new URL(newsFeed).origin + '/' + + const newsFeed = distroData.rawDistribution.rcf; $.ajax({ url: newsFeed, + dataType: 'json', // Specify that we expect JSON data success: (data) => { - const items = $(data).find('item') - const articles = [] + const feedInfo = data.info; // General feed info + const items = data.feeds; // Content items (array) + const articles = []; + const feed_server_icon_url = data.image.icon; - for(let i=0; i { resolve({ articles: null - }) - }) - }) + }); + }); + }); - return await promise + return await promise; } diff --git a/app/landing.ejs b/app/landing.ejs index b836a5b..4a93416 100644 --- a/app/landing.ejs +++ b/app/landing.ejs @@ -175,17 +175,18 @@ \ No newline at end of file diff --git a/distro.json b/distro.json index fe2b22c..63d12c8 100644 --- a/distro.json +++ b/distro.json @@ -14,7 +14,7 @@ "minimum": 1024 } }, - "rss": "", + "rcf": "https://api.damp11113.xyz/feed/getfeed?page=1&limit=10&service=dmb_mc", "servers": [ { "id": "DMB", diff --git a/electron-builder.yml b/electron-builder.yml index 43a49b8..56b29b6 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -1,5 +1,5 @@ -appId: 'helioslauncher' -productName: 'Helios Launcher' +appId: 'dmblauncher' +productName: 'DMB Launcher' artifactName: '${productName}-setup-${version}.${ext}' copyright: 'Copyright © 2018-2024 Daniel Scalzi' diff --git a/package.json b/package.json index 40af98e..252d17e 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,18 @@ { - "name": "helioslauncher", + "name": "dmblauncher", "version": "2.2.1", - "productName": "Helios Launcher", - "description": "Modded Minecraft Launcher", - "author": "Daniel Scalzi (https://github.com/dscalzi/)", - "license": "UNLICENSED", - "homepage": "https://github.com/dscalzi/HeliosLauncher", + "productName": "DMB Launcher", + "description": "Modded Minecraft Launcher for DMB project", + "author": "Daniel Scalzi (https://github.com/dscalzi/), damp11113", + "license": "UNLICENSED/MIT (Some part of DPSoftware)", + "homepage": "https://damp11113.xyz", "bugs": { "url": "https://github.com/dscalzi/HeliosLauncher/issues" }, "private": true, "main": "index.js", "scripts": { - "start": "electron .", + "dev": "electron .", "dist": "electron-builder build", "dist:win": "npm run dist -- -w", "dist:mac": "npm run dist -- -m", diff --git a/run.bat b/run.bat index a01add9..b896a08 100644 --- a/run.bat +++ b/run.bat @@ -1 +1 @@ -npm run start \ No newline at end of file +npm run dev \ No newline at end of file