it uses roblox open cloud and glitch memory it has the data in the glitch memory if its being updated after 10 seconds of no updates it sets, the source code is
ik it uses roblox database but it removes every limit using the extra code
const express = require("express");
const path = require("path");
const axios = require("axios");
const crypto = require("crypto");
const fs = require("fs");
const { v4: uuidv4 } = require("uuid");
const bodyparser = require("body-parser");
const app = express();
const universeid = process.env.universe;
const key = process.env.datakey;
function encodeBase64(data) {
return Buffer.from(data).toString("base64");
}
function decodeBase64(data) {
return Buffer.from(data, "base64");
}
function getunix() {
const currentDate = new Date();
const unixTimestamp = Math.floor(currentDate.getTime() / 1000);
return unixTimestamp;
}
async function getAsync(value, name) {
const res = await axios.get(
`https://apis.roblox.com/datastores/v1/universes/${universeid}/standard-datastores/datastore/entries/entry`,
{
params: {
datastoreName: name,
entryKey: value,
},
headers: {
"x-api-key": key,
},
}
);
let data = res.data;
return data;
}
async function setAsync(value, name, write) {
const jsonvalue = await JSON.stringify(write);
const convertadd = await crypto
.createHash("md5")
.update(jsonvalue)
.digest("base64");
const res = await axios.post(
`https://apis.roblox.com/datastores/v1/universes/${universeid}/standard-datastores/datastore/entries/entry`,
write,
{
params: {
datastoreName: name,
entryKey: value,
},
headers: {
"x-api-key": key,
"content-md5": convertadd,
"content-type": "application/json",
},
}
);
let data = res.data;
return data;
}
app.use(express.json());
app.use(express.static(__dirname));
app.get("/", (req, res) => {
res.sendFile(path.join(__dirname, "redirect.html"));
});
app.get("/get-started", (req, res) => {
res.sendFile(path.join(__dirname, "Start.html"));
});
let cache = {};
function removeExpiredItems() {
const currentTime = getunix();
const keysToRemove = [];
for (const entryKey in cache) {
const entry = cache[entryKey];
const entryTime = entry[1];
if (currentTime - entryTime > 5) {
keysToRemove.push(entryKey);
}
}
keysToRemove.forEach((key) => {
const info = key.split(";");
const AccessKey = info[1];
const entryKey = info[0];
const cacheEntry = cache[key];
const data = cacheEntry[0];
const time = cacheEntry[1];
delete cache[key];
setAsync(entryKey, AccessKey, data);
console.log("removed from mem");
});
}
setInterval(removeExpiredItems, 10000);
let inc = [];
app.post("/increment", async (req, res) => {
const body = req.body;
let AccessKey = body["AccessKey"];
let name = body["Name"];
let key = body["Key"];
let writedata = body["Write"];
if (typeof writedata === "number" && !isNaN(writedata)) {
} else {
writedata = 1;
}
let entrykey = name + key;
console.log(body);
let set;
let from = cache[entrykey + ";" + AccessKey];
if (from) {
if (typeof from[0] === "number" && !isNaN(from[0])) {
} else {
from[0] = 0;
}
writedata += from[0];
from[0] = writedata;
let u = getunix();
from[1] = u;
console.log("mem inc");
} else {
let got;
try {
if (inc[entrykey + AccessKey] == true) {
res.sendStatus(500);
return;
}
inc[entrykey + AccessKey] = true;
got = await getAsync(entrykey, AccessKey);
} catch (error) {
got = 0;
}
if (typeof got === "number" && !isNaN(got)) {
} else {
got = 0;
}
writedata += got;
set = await setAsync(entrykey, AccessKey, writedata);
let u = getunix();
let c = {
[0]: writedata,
[1]: u,
};
cache[entrykey + ";" + AccessKey] = c;
delete inc[entrykey + AccessKey];
}
res.send({ writedata });
});
app.post("/set", async (req, res) => {
const body = req.body;
let AccessKey = body["AccessKey"];
let name = body["Name"];
let key = body["Key"];
let writedata = body["Write"];
let entrykey = name + key;
console.log(body);
let set;
let from = cache[entrykey + ";" + AccessKey];
if (from) {
from[0] = writedata;
let u = getunix();
from[1] = u;
console.log("mem set");
} else {
set = await setAsync(entrykey, AccessKey, writedata);
let u = getunix();
let c = {
[0]: writedata,
[1]: u,
};
cache[entrykey + ";" + AccessKey] = c;
}
res.send({ writedata });
});
app.post("/get", async (req, res) => {
try {
const body = req.body;
let AccessKey = body["AccessKey"];
let name = body["Name"];
let key = body["Key"];
let entrykey = name + key;
console.log(body);
let got;
let from = cache[entrykey + ";" + AccessKey];
if (from) {
got = from[0];
console.log("mem got");
} else {
got = await getAsync(entrykey, AccessKey);
}
res.status(200).send({ got });
let u = getunix();
let c = {
[0]: got,
[1]: u,
};
cache[entrykey + ";" + AccessKey] = c;
} catch (error) {
res.send("nil");
}
});
app.listen(process.env.PORT || 3000, () => {
console.log("Server is running");
});