Compare commits
7 Commits
developmen
...
9b66df772a
| Author | SHA1 | Date | |
|---|---|---|---|
| 9b66df772a | |||
| 76094830c4 | |||
| 39cdf17e3e | |||
| 55e3f5a3c4 | |||
| 496bc61c7d | |||
| 204616a2d8 | |||
| 5770f28acb |
@ -271,6 +271,7 @@ async function generateAccountPage(name, cookie, admin) {
|
||||
}
|
||||
|
||||
let modifiedHTML = rawProfileHTML;
|
||||
console.log(userData.music);
|
||||
let songData = JSON.parse(userData.music) || false;
|
||||
modifiedHTML = modifiedHTML.replaceAll("{{ name }}", sanitizeHtml(userData.name, allowNone));
|
||||
modifiedHTML = modifiedHTML.replaceAll("{{ join_date }}", dayjs(userData.createdAt).fromNow());
|
||||
|
||||
@ -5,15 +5,6 @@
|
||||
https://coolors.co/10002b-240046-3c096c-5a189a-7b2cbf-9d4edd-c77dff-e0aaff -->
|
||||
|
||||
<!-- initialize externals -->
|
||||
<meta property="og:title" content="Selenite" />
|
||||
<meta property="description" content="Selenite is the best unblocked games site. With over 400 games and an account system, no other websites come close to Selenite." />
|
||||
<meta content="/favicon.png" property="og:image" />
|
||||
<meta content="#c77dff" data-react-helmet="true" name="theme-color" />
|
||||
<meta name="googlebot" content="index, follow, snippet" />
|
||||
<link rel="canonical" href="https://selenite.cc/" />
|
||||
<meta property="og:description" content="Selenite is the best unblocked games site. With over 400 games and an account system, no other websites come close to Selenite." />
|
||||
<meta property="og:title" content="Selenite">
|
||||
<meta property="og:type" content="website">
|
||||
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
|
||||
@ -5,8 +5,6 @@
|
||||
https://coolors.co/10002b-240046-3c096c-5a189a-7b2cbf-9d4edd-c77dff-e0aaff -->
|
||||
|
||||
<!-- initialize externals -->
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
|
||||
<script src=" https://cdn.jsdelivr.net/npm/js-cookie@3.0.5/dist/js.cookie.min.js "></script>
|
||||
|
||||
<!-- initialize my stuff -->
|
||||
<script src="/js/all.min.js"></script>
|
||||
|
||||
@ -5,16 +5,6 @@
|
||||
https://coolors.co/10002b-240046-3c096c-5a189a-7b2cbf-9d4edd-c77dff-e0aaff -->
|
||||
|
||||
<!-- initialize externals -->
|
||||
<meta property="og:title" content="Selenite" />
|
||||
<meta property="description" content="Selenite is the best unblocked games site. With over 400 games and an account system, no other websites come close to Selenite." />
|
||||
|
||||
<meta content="/favicon.png" property="og:image" />
|
||||
<meta content="#c77dff" data-react-helmet="true" name="theme-color" />
|
||||
<meta name="googlebot" content="index, follow, snippet" />
|
||||
<link rel="canonical" href="https://selenite.cc/" />
|
||||
<meta property="og:description" content="Selenite is the best unblocked games site. With over 400 games and an account system, no other websites come close to Selenite." />
|
||||
<meta property="og:title" content="Selenite">
|
||||
<meta property="og:type" content="website">
|
||||
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
@ -44,7 +34,6 @@
|
||||
<!-- seo + other things -->
|
||||
<title>{{ name }}'s Profile | Selenite</title>
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3415518411898563" crossorigin="anonymous"></script>
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", ()=>{
|
||||
let music = {{ is_music }};
|
||||
|
||||
@ -5,16 +5,6 @@
|
||||
https://coolors.co/10002b-240046-3c096c-5a189a-7b2cbf-9d4edd-c77dff-e0aaff -->
|
||||
|
||||
<!-- initialize externals -->
|
||||
<meta property="og:title" content="Selenite" />
|
||||
<meta property="description" content="Selenite is the best unblocked games site. With over 400 games and an account system, no other websites come close to Selenite." />
|
||||
|
||||
<meta content="/favicon.png" property="og:image" />
|
||||
<meta content="#c77dff" data-react-helmet="true" name="theme-color" />
|
||||
<meta name="googlebot" content="index, follow, snippet" />
|
||||
<link rel="canonical" href="https://selenite.cc/" />
|
||||
<meta property="og:description" content="Selenite is the best unblocked games site. With over 400 games and an account system, no other websites come close to Selenite." />
|
||||
<meta property="og:title" content="Selenite">
|
||||
<meta property="og:type" content="website">
|
||||
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
@ -44,7 +34,6 @@
|
||||
<!-- seo + other things -->
|
||||
<title>{{ name }}'s Profile | Selenite</title>
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3415518411898563" crossorigin="anonymous"></script>
|
||||
<!-- <script>
|
||||
let audioObject;
|
||||
document.addEventListener("DOMContentLoaded", ()=>{
|
||||
|
||||
@ -5,8 +5,6 @@
|
||||
https://coolors.co/10002b-240046-3c096c-5a189a-7b2cbf-9d4edd-c77dff-e0aaff -->
|
||||
|
||||
<!-- initialize externals -->
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
|
||||
<script src=" https://cdn.jsdelivr.net/npm/js-cookie@3.0.5/dist/js.cookie.min.js "></script>
|
||||
|
||||
<!-- initialize my stuff -->
|
||||
<script src="/js/all.min.js"></script>
|
||||
@ -14,7 +12,9 @@
|
||||
|
||||
<script src="https://js.hcaptcha.com/1/api.js" async defer></script>
|
||||
|
||||
<link rel="stylesheet" href="/style.css" />
|
||||
<link rel="stylesheet" href="/css/main.css" />
|
||||
<link rel="stylesheet" href="/css/pages.css" />
|
||||
|
||||
|
||||
<!-- seo + other things -->
|
||||
<title>Reset Password | Selenite</title>
|
||||
@ -62,26 +62,15 @@
|
||||
</script>
|
||||
</head>
|
||||
<alerts> </alerts>
|
||||
<body id="noscroll">
|
||||
<header>
|
||||
<a href="/index.html">Home</a>
|
||||
<a href="/bookmarklets.html">Bookmarklets</a>
|
||||
<a href="/projects.html">Games</a>
|
||||
<a href="/apps.html">Apps</a>
|
||||
<a href="/settings.html">Settings</a>
|
||||
<a id="blank" href="#">Open Blank</a>
|
||||
<a href="/u/" class="usericon"><img src="/img/user.svg"></a>
|
||||
</header>
|
||||
<main id="main" class="noscroll">
|
||||
<h2>Reset Password</h2>
|
||||
<body>
|
||||
<h2>reset password</h2>
|
||||
<form action="" id="reset">
|
||||
<input type="text" id="username" placeholder="username" />
|
||||
<input type="password" id="key" placeholder="key" />
|
||||
<input type="password" id="password" placeholder="password" />
|
||||
<div class="h-captcha" id="hcaptcha" data-sitekey="1774ec96-39be-4fb0-9e82-f4c62354b8fa"></div>
|
||||
<button type="submit" value="Submit">Reset Password</button>
|
||||
<button type="submit" value="Submit">reset password</button>
|
||||
</form>
|
||||
</main>
|
||||
<popups>
|
||||
<div id="popup" style="display: none">
|
||||
<h1 id="title"></h1>
|
||||
@ -89,13 +78,5 @@
|
||||
<button id="close">X</button>
|
||||
</div>
|
||||
</popups>
|
||||
<footer class="noscroll">
|
||||
<a href="https://gitlab.com/skysthelimit.dev/selenite">Source</a>
|
||||
<a href="https://discord.gg/7jyufnwJNf">Discord</a>
|
||||
<a href="/suggest.html">Suggestions & Bugs</a>
|
||||
<a href="/contact.html">Contact</a>
|
||||
<a href="/support.html">Donate</a>
|
||||
<a href="/about.html">About</a>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -5,15 +5,6 @@
|
||||
https://coolors.co/10002b-240046-3c096c-5a189a-7b2cbf-9d4edd-c77dff-e0aaff -->
|
||||
|
||||
<!-- initialize externals -->
|
||||
<meta property="og:title" content="Selenite" />
|
||||
<meta property="description" content="Selenite is the best unblocked games site. With over 400 games and an account system, no other websites come close to Selenite." />
|
||||
<meta content="/favicon.png" property="og:image" />
|
||||
<meta content="#c77dff" data-react-helmet="true" name="theme-color" />
|
||||
<meta name="googlebot" content="index, follow, snippet" />
|
||||
<link rel="canonical" href="https://selenite.cc/" />
|
||||
<meta property="og:description" content="Selenite is the best unblocked games site. With over 400 games and an account system, no other websites come close to Selenite." />
|
||||
<meta property="og:title" content="Selenite">
|
||||
<meta property="og:type" content="website">
|
||||
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
|
||||
@ -5,16 +5,6 @@
|
||||
https://coolors.co/10002b-240046-3c096c-5a189a-7b2cbf-9d4edd-c77dff-e0aaff -->
|
||||
|
||||
<!-- initialize externals -->
|
||||
<meta property="og:title" content="Selenite" />
|
||||
<meta property="description" content="Selenite is the best unblocked games site. With over 400 games and an account system, no other websites come close to Selenite." />
|
||||
|
||||
<meta content="/favicon.png" property="og:image" />
|
||||
<meta content="#c77dff" data-react-helmet="true" name="theme-color" />
|
||||
<meta name="googlebot" content="index, follow, snippet" />
|
||||
<link rel="canonical" href="https://selenite.cc/" />
|
||||
<meta property="og:description" content="Selenite is the best unblocked games site. With over 400 games and an account system, no other websites come close to Selenite." />
|
||||
<meta property="og:title" content="Selenite">
|
||||
<meta property="og:type" content="website">
|
||||
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
@ -123,7 +113,7 @@
|
||||
});
|
||||
</script>
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3415518411898563" crossorigin="anonymous"></script>
|
||||
|
||||
</head>
|
||||
<alerts> </alerts>
|
||||
<body>
|
||||
|
||||
27
index.js
27
index.js
@ -45,10 +45,20 @@ import WebSocket, { WebSocketServer } from "ws";
|
||||
const wss = new WebSocketServer({ noServer: true });
|
||||
// let openSockets = 0;
|
||||
wss.on("connection", function connection(ws, req, res) {
|
||||
ws.send(`online=${wss.clients.size}`);
|
||||
setInterval(() => {
|
||||
ws.send(`online=${wss.clients.size}`);
|
||||
}, 10000);
|
||||
// ws.send(`online=${wss.clients.size}`);
|
||||
// setInterval(() => {
|
||||
// ws.send(`online=${wss.clients.size}`);
|
||||
// }, 10000);
|
||||
let server = new WebSocket("ws://localhost:7910");
|
||||
|
||||
server.on("message", async function message(data) {
|
||||
let message = Buffer.from(data).toString();
|
||||
if(message.startsWith("online")) {
|
||||
ws.send(message);
|
||||
} else if(message.startsWith("annc")) {
|
||||
ws.send(message);
|
||||
}
|
||||
})
|
||||
|
||||
ws.on("error", console.error);
|
||||
|
||||
@ -67,14 +77,15 @@ wss.on("connection", function connection(ws, req, res) {
|
||||
} else if (message.startsWith("annc")) {
|
||||
let splitMessage = message.split(";;");
|
||||
if(await isAdmin(splitMessage[1])) {
|
||||
wss.clients.forEach(client => {
|
||||
client.send(`annc;;${splitMessage[2]};;${splitMessage[3]}`);
|
||||
})
|
||||
// wss.clients.forEach(client => {
|
||||
// client.send(`annc;;${splitMessage[2]};;${splitMessage[3]}`);
|
||||
// })
|
||||
server.send(message);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ws.on("close", () => {});
|
||||
ws.on("close", () => {server.close()});
|
||||
});
|
||||
app.post(
|
||||
"/api/event",
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
"description": "",
|
||||
"exports": "./index.js",
|
||||
"scripts": {
|
||||
"websocket_server": "bun --watch websocket.js",
|
||||
"start": "bun --watch index.js",
|
||||
"svg": "node svg-converter.js"
|
||||
},
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
module.exports = {
|
||||
name: "Selenite", // Name of your application
|
||||
script: "index.js", // Entry point of your application
|
||||
script: "start.cjs", // Entry point of your application
|
||||
interpreter: "bun", // Path to the Bun interpreter
|
||||
watch: true,
|
||||
cron_restart: '0 0 * * *',
|
||||
|
||||
33
websocket.js
Normal file
33
websocket.js
Normal file
@ -0,0 +1,33 @@
|
||||
import WebSocket, { WebSocketServer } from "ws";
|
||||
const wss = new WebSocketServer({ noServer: true });
|
||||
|
||||
wss.on("connection", function connection(ws, req, res) {
|
||||
ws.send(`online=${wss.clients.size}`);
|
||||
setInterval(() => {
|
||||
ws.send(`online=${wss.clients.size}`);
|
||||
}, 10000);
|
||||
|
||||
ws.on("message", async function message(data, isBinary) {
|
||||
let message = Buffer.from(data).toString();
|
||||
if (message.startsWith("annc")) {
|
||||
let splitMessage = message.split(";;");
|
||||
wss.clients.forEach(client => {
|
||||
client.send(`annc;;${splitMessage[2]};;${splitMessage[3]}`);
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
ws.on("close", () => {});
|
||||
});
|
||||
let port = 7910;
|
||||
import express from "express";
|
||||
const app = express();
|
||||
const server = app.listen(port, () => {
|
||||
console.log("Websocket server is online.");
|
||||
console.log("- http://localhost:" + port);
|
||||
});
|
||||
server.on("upgrade", (request, socket, head) => {
|
||||
wss.handleUpgrade(request, socket, head, (socket) => {
|
||||
wss.emit("connection", socket, request);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user