This repository has been archived by the owner on Sep 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ampersoftware/feature/serverlist
Server List
- Loading branch information
Showing
12 changed files
with
568 additions
and
147 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,47 @@ | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP --> | ||
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'"> | ||
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'"> | ||
<title>Creators.TF Launcher - Alpha Version</title> | ||
<link rel="stylesheet" href="node_modules/@mdi/font/css/materialdesignicons.min.css"> | ||
<link rel="stylesheet" href="fonts/fonts.css"> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
<body> | ||
<div id="sidebar"> | ||
<div id="boxOfButtons"> | ||
<button id="settings-button" tooltip="Settings section. This is where you can change your folder directories and see other technical stuff."><i class="mdi mdi-cog"></i></button> | ||
<button id="patchnotes-button" tooltip="Patch notes. Here we put all the changes that happened related to the launcher."><i class="mdi mdi-format-list-bulleted-square"></i></button> | ||
<button id="update-button-updated" class="hidden" tooltip="Your launcher is up to date."><i class="mdi mdi-check-bold"></i></button> | ||
<button id="update-button-download" class="hidden" tooltip="An update is available. Download now?"><i class="mdi mdi-download"></i></button> | ||
<button id="update-button-downloading" class="hidden" tooltip="A new update is being downloaded."><i class="mdi mdi-loading"></i></button> | ||
<button id="update-button-update" class="hidden" tooltip="An update is installed. Update now?"><i class="mdi mdi-sync-alert"></i></button> | ||
</div> | ||
</div> | ||
<div id="contentdummy"></div> | ||
<div id="content"> | ||
<div id="content-area"> | ||
<div id="title-image-holder"> | ||
<img id="title-image"> | ||
</div> | ||
<p id="content-text"></p> | ||
<div class="modInfoBox"> | ||
<div class="socialMedia" id="socialMediaGithub"></div> | ||
<div class="socialMedia" id="socialMediaWebsite"></div> | ||
<div class="socialMedia" id="socialMediaTwitter"></div> | ||
<div class="socialMedia" id="socialMediaInstagram"></div> | ||
<div class="socialMedia" id="socialMediaDiscord"></div> | ||
</div> | ||
<!-- <p id="version">🛠<span id="version-text"></span></p> --> | ||
</div> | ||
<div id="fadebehindbutton"></div> | ||
<button id="install-play-update">Loading...</button> | ||
<button id="remove-mod">Uninstall Mod</button> | ||
</div> | ||
<script src="./renderer.js"></script> | ||
<script src="consolewarning.js"></script> | ||
</body> | ||
<head> | ||
<meta charset="utf-8"> | ||
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP --> | ||
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'"> | ||
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'"> | ||
<title>Creators.TF Launcher - Alpha Version</title> | ||
<link rel="stylesheet" href="node_modules/@mdi/font/css/materialdesignicons.min.css"> | ||
<link rel="stylesheet" href="fonts/fonts.css"> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
<body> | ||
<div id="sidebar"> | ||
<div id="boxOfButtons"> | ||
<button id="settings-button" tooltip="Settings section. This is where you can change your folder directories and see other technical stuff."><i class="mdi mdi-cog"></i></button> | ||
<button id="patchnotes-button" tooltip="Patch notes. Here we put all the changes that happened related to the launcher."><i class="mdi mdi-format-list-bulleted-square"></i></button> | ||
<button id="update-button-updated" class="hidden" tooltip="Your launcher is up to date."><i class="mdi mdi-check-bold"></i></button> | ||
<button id="update-button-download" class="hidden" tooltip="An update is available. Download now?"><i class="mdi mdi-download"></i></button> | ||
<button id="update-button-downloading" class="hidden" tooltip="A new update is being downloaded."><i class="mdi mdi-loading"></i></button> | ||
<button id="update-button-update" class="hidden" tooltip="An update is installed. Update now?"><i class="mdi mdi-sync-alert"></i></button> | ||
</div> | ||
</div> | ||
<div id="contentdummy"></div> | ||
<div id="content"> | ||
<div id="content-area"> | ||
<div id="boxOfModButtons"> | ||
<button id="serverlist"><i class="mdi mdi-server"></i></button> | ||
<button id="remove-mod"><i class="mdi mdi-delete-forever"></i></button> | ||
</div> | ||
<div id="title-image-holder"><img id="title-image"></div> | ||
<p id="content-text">Description Text goes here</p> | ||
<div class="modInfoBox"> | ||
<div class="socialMedia" id="socialMediaGithub"></div> | ||
<div class="socialMedia" id="socialMediaWebsite"></div> | ||
<div class="socialMedia" id="socialMediaTwitter"></div> | ||
<div class="socialMedia" id="socialMediaInstagram"></div> | ||
<div class="socialMedia" id="socialMediaDiscord"></div> | ||
</div> | ||
<!-- <p id="version">🛠<span id="version-text"></span></p> --> | ||
</div> | ||
<div id="fadebehindbutton"></div> | ||
<button id="install-play-update">Loading...</button> | ||
</div> | ||
<script src="renderer.js"></script> | ||
<script src="consolewarning.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP --> | ||
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'"> | ||
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'"> | ||
<title>Server List</title> | ||
<link rel="stylesheet" href="../node_modules/flag-icon-css/css/flag-icon.min.css"> | ||
<link rel="stylesheet" href="../node_modules/@mdi/font/css/materialdesignicons.min.css"> | ||
<link rel="stylesheet" href="../fonts/fonts.css"> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
<body> | ||
<h1 id="modname">Creators.TF - Server List</h1> | ||
<div id="loading"><h1>LOADING...</h1></div> | ||
<div id="failMessage"></div> | ||
<div id="server-container"></div> | ||
<script src="../consolewarning.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
const { BrowserWindow, ipcMain } = require("electron"); | ||
const path = global.path; | ||
|
||
var serverlistWindow; | ||
const apiEndpoint = "https://creators.tf/api/IServers/GServerList?provider=15"; | ||
|
||
module.exports.OpenWindow = OpenWindow; | ||
function OpenWindow() { | ||
global.log.info("Loading Server List window..."); | ||
serverlistWindow = new BrowserWindow({ | ||
parent: global.mainWindow, | ||
webPreferences: { | ||
preload: path.join(__dirname, "serverpage-preload.js"), | ||
nodeIntegration: false | ||
}, | ||
modal: true, | ||
show: false, | ||
center: true, | ||
darkTheme: true, | ||
maximizable: true, | ||
resizable: true, | ||
autoHideMenuBar: true, | ||
minWidth: 700, | ||
minHeight: 500, | ||
width: 900, | ||
height: 650 | ||
}); | ||
serverlistWindow.removeMenu(); | ||
serverlistWindow.loadFile(path.join(__dirname, "serverlist.html")); | ||
serverlistWindow.once("ready-to-show", () => { | ||
serverlistWindow.show(); | ||
}); | ||
|
||
} | ||
|
||
ipcMain.on("GetServerList", async (event, arg) => { | ||
GetServerList().then((result) => {event.reply("GetServerList-Reply", result)}); | ||
}); | ||
|
||
function GetServerList() { | ||
return new Promise((resolve, reject) => { | ||
var options = { | ||
headers: { | ||
'User-Agent': 'creators-tf-launcher' | ||
} | ||
}; | ||
|
||
var data = []; | ||
|
||
let req = https.get(apiEndpoint, options, res => { | ||
console.log(`statusCode: ${res.statusCode}`); | ||
res.on('data', d => { | ||
if (res.statusCode != 200) { | ||
reject(`Failed accessing ${url}: ` + res.statusCode); | ||
return; | ||
} | ||
data.push(d); | ||
}); | ||
res.on("end", function() { | ||
var buf = Buffer.concat(data); | ||
let parsed = JSON.parse(buf.toString()); | ||
resolve(parsed); | ||
}); | ||
}); | ||
req.on('error', error => { | ||
reject(error.toString()); | ||
}); | ||
req.end(); | ||
}); | ||
} |
Oops, something went wrong.