allah gen
This commit is contained in:
parent
58d5351d68
commit
e68e5afde7
@ -37,13 +37,14 @@ proc hit(host: string) {.gcsafe.} =
|
|||||||
|
|
||||||
proc main(): void {.thread.} =
|
proc main(): void {.thread.} =
|
||||||
while true:
|
while true:
|
||||||
var ip = GenerateIP()
|
var
|
||||||
var ping = status(ip)
|
ip = GenerateIP()
|
||||||
|
ping = status(ip)
|
||||||
if ping:
|
if ping:
|
||||||
hit(ip)
|
hit(ip)
|
||||||
discard
|
discard
|
||||||
|
|
||||||
var cmd = os.execShellCmd("clear")
|
discard os.execShellCmd("clear")
|
||||||
var cLock: Lock
|
var cLock: Lock
|
||||||
initLock(cLock)
|
initLock(cLock)
|
||||||
var thread: Thread[void]
|
var thread: Thread[void]
|
||||||
|
20
server/css/index.css
Normal file
20
server/css/index.css
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@200&display=swap');
|
||||||
|
.😳 {
|
||||||
|
padding: 10px;
|
||||||
|
color: #dcddde;
|
||||||
|
font-size: 20px;
|
||||||
|
border: solid rgba(168, 168, 168, 0.89) 1px;
|
||||||
|
}
|
||||||
|
.👽 {
|
||||||
|
font-family: 'Nunito Sans';
|
||||||
|
padding: 10px;
|
||||||
|
font-size: 25px;
|
||||||
|
color: rgba(255, 255, 255, 0.959);
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.💀 {
|
||||||
|
background-color: rgba(49, 49, 49, 0.89);
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
background-color: rgb(20, 20, 20);
|
||||||
|
}
|
@ -23,7 +23,7 @@ const makeEmbed = (mc, neit) => {
|
|||||||
.addField("**Players**", `\`${mc.players.online}/${mc.players.max}\``, true)
|
.addField("**Players**", `\`${mc.players.online}/${mc.players.max}\``, true)
|
||||||
.addField("**Ping**", `\`${mc.roundTripLatency}ms\``, true)
|
.addField("**Ping**", `\`${mc.roundTripLatency}ms\``, true)
|
||||||
.addField("**Motd**", "```\n" + mc.motd.clean + "\n```")
|
.addField("**Motd**", "```\n" + mc.motd.clean + "\n```")
|
||||||
.addField("**Playerlist Sample**", "```\n" + mc.PlayerList + "\n```")
|
.addField("**Playerlist Sample**", "```fix\n" + mc.PlayerList + "\n```")
|
||||||
.addField("**IP Range**", "```\n" + geoIP.pretty(mc.ip.range[0]) + " - " + geoIP.pretty(mc.ip.range[1]) + "```")
|
.addField("**IP Range**", "```\n" + geoIP.pretty(mc.ip.range[0]) + " - " + geoIP.pretty(mc.ip.range[1]) + "```")
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ app.post("/server", async (req, res) => {
|
|||||||
Minecraft.Server = `${Server}:25565`
|
Minecraft.Server = `${Server}:25565`
|
||||||
var cleanMOTD = replaceMOTD(Minecraft.motd.clean)
|
var cleanMOTD = replaceMOTD(Minecraft.motd.clean)
|
||||||
Minecraft.PlayerList = ""
|
Minecraft.PlayerList = ""
|
||||||
Minecraft.players.sample ? Minecraft.players.sample.forEach(e => Minecraft.PlayerList += `${e.name}::${e.id}\n`) : Minecraft.PlayerList = "No Players"
|
Minecraft.players.sample ? Minecraft.players.sample.forEach(e => Minecraft.PlayerList += `${e.name} : ${e.id}\n`) : Minecraft.PlayerList = "No Players"
|
||||||
db.exec(`INSERT INTO servers VALUES (
|
db.exec(`INSERT INTO servers VALUES (
|
||||||
'${Minecraft.Server}',
|
'${Minecraft.Server}',
|
||||||
'${Minecraft.version.name}',
|
'${Minecraft.version.name}',
|
||||||
@ -100,5 +100,63 @@ app.listen(9000, () => {
|
|||||||
console.clear()
|
console.clear()
|
||||||
console.log("server ready")
|
console.log("server ready")
|
||||||
})
|
})
|
||||||
|
app.use(express.static(`${__dirname}/css`))
|
||||||
|
app.get('/', async(req, res) => {
|
||||||
|
db.all(`SELECT host, version FROM servers`, async(err, servers) => {
|
||||||
|
var table = ""
|
||||||
|
for (var srv of servers) {
|
||||||
|
var proto = srv.version.split(" ")
|
||||||
|
proto.length >= 2 ? software = proto[0] : software = "Vanilla"
|
||||||
|
proto.length <= 1 ? version = proto[0] : version = proto[1]
|
||||||
|
table += `<tr><td class="😳">${srv.host}</td><td class="😳">${version}</td><td class="😳">${software}</td></tr>`
|
||||||
|
}
|
||||||
|
let content = `
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>TaxenHeimer</title>
|
||||||
|
<link rel="stylesheet" href="index.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<center>
|
||||||
|
<table class="👽" id="allah">
|
||||||
|
<tr><td class="💀">Host</td><td class="💀">Version</td><td class="💀">Software</td></tr>
|
||||||
|
${table}
|
||||||
|
</table>
|
||||||
|
</center>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
`
|
||||||
|
res.send(content)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
async function updatedb() {
|
||||||
|
db.all(`SELECT host FROM servers`, async(err, serv) => {
|
||||||
|
for (var servs of serv) {
|
||||||
|
var srv = servs.host
|
||||||
|
mc.status(srv.split(":")[0], parseInt(srv.split(":")[1]), {
|
||||||
|
enableSRV: true
|
||||||
|
}).then(minecraft => {
|
||||||
|
var cleanMOTD = replaceMOTD(minecraft.motd.clean)
|
||||||
|
minecraft.PlayerList = ""
|
||||||
|
minecraft.players.sample ? minecraft.players.sample.forEach(e => minecraft.PlayerList += `${e.name} : ${e.id}\n`) : minecraft.PlayerList = "No Players"
|
||||||
|
db.exec(`UPDATE servers SET
|
||||||
|
version='${minecraft.version.name}',
|
||||||
|
players='${minecraft.players.online}/${minecraft.players.max}',
|
||||||
|
playerlist='${minecraft.PlayerList.replace(/\n/g, "\\n")}',
|
||||||
|
ping='${minecraft.roundTripLatency}ms',
|
||||||
|
motd='${cleanMOTD}',
|
||||||
|
timestamp='Last updated ${new Date().toLocaleDateString('en-US')}'
|
||||||
|
WHERE host='${srv}'`)
|
||||||
|
}).catch(e => {
|
||||||
|
db.exec(`DELETE FROM servers WHERE host='${srv}'`)
|
||||||
|
offline.exec(`INSERT INTO servers VALUES (
|
||||||
|
'${srv}',
|
||||||
|
'${new Date().toLocaleDateString("en-US")}'
|
||||||
|
)`)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return "Update finished"
|
||||||
|
}
|
||||||
process.on("unhandledRejection", callback => console.log(callback.message))
|
process.on("unhandledRejection", callback => console.log(callback.message))
|
||||||
process.on("uncaughtException", callback => console.log(callback.message))
|
process.on("uncaughtException", callback => console.log(callback.message))
|
Loading…
Reference in New Issue
Block a user