Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to colyseus #28

Closed
wants to merge 70 commits into from
Closed

Migrate to colyseus #28

wants to merge 70 commits into from

Conversation

keshav2010
Copy link
Owner

No description provided.

…iles be built successfully using commonjs modules for now
…mproved class implementation for SceneObject to capture real dependency on QuadtreeItem and SAT.Box
…adtree in SceneObject. Need to work on SoldierStateBehaviour.ts and GameStateManager.ts
Comment on lines +53 to +76
app.get("/", async (req, res) => {
try {
const pathName = path.resolve(__dirname, "dist");
const files = await fs.promises.readdir(pathName);
const filename = files.find((file) => path.extname(file) === ".html");
if (!filename) {
console.log(`Serving back 500`);
return res
.status(500)
.send(`<h1>ERROR! No HTML files found in ${pathName}</h1>`);
}
const filepath = path.resolve(pathName, filename);
const stats = await fs.promises.stat(filepath);
console.log(`Serving : ${filepath}`);
if (!stats.isFile()) {
return res.status(500).send(`<h1>ERROR! ${filename} is not a file.</h1>`);
}
console.log(`Serving : ${filepath}`);
res.sendFile(filepath);
} catch (err) {
console.error(err);
res.status(500).send("<h1>Internal Server Error, Try again later.</h1>");
}
});

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
a file system access
, but is not rate-limited.
This route handler performs
a file system access
, but is not rate-limited.
This route handler performs
a file system access
, but is not rate-limited.
@keshav2010 keshav2010 closed this Apr 9, 2024
@keshav2010 keshav2010 deleted the migrate-to-colyseus branch May 17, 2024 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant