Skip to content

Commit

Permalink
while this works, we can require them later now
Browse files Browse the repository at this point in the history
  • Loading branch information
Techbot121 authored and Meta Construct committed Jan 4, 2025
1 parent d87c68b commit 661fa3b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
3 changes: 1 addition & 2 deletions app/services/webapp/api/game-server-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import path from "path";
import pug from "pug";

export default async (webApp: WebApp): Promise<void> => {
const gameBridge = await webApp.container.getService("GameBridge");

webApp.app.get("/server-status/:id/:bruh?", async (req, res) => {
const gameBridge = await webApp.container.getService("GameBridge");
const server: GameServer = gameBridge.servers[req.params.id];

if (!server) {
Expand Down
3 changes: 1 addition & 2 deletions app/services/webapp/api/gamemode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import servers from "@/config/gamebridge.servers.json";
const HOSTING_IDS = { 3: true, 1: true };

export default async (webApp: WebApp): Promise<void> => {
const bot = await webApp.container.getService("DiscordBot");

webApp.app.get("/gamemode/:id/", async (req, res) => {
const bot = await webApp.container.getService("DiscordBot");
const ip = req.header("x-forwarded-for")?.split(",")[0];
if (!ip) return res.sendStatus(403);
const isOkIp = servers.find(srv => srv.ip === ip);
Expand Down
3 changes: 1 addition & 2 deletions app/services/webapp/api/gmod-error-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ const ignoreRegex = [
//const fileIgnore = [];

export default async (webApp: WebApp): Promise<void> => {
const gameBridge = await webApp.container.getService("GameBridge");

const webhook = new Discord.WebhookClient({
url: config.webhookUrl,
});
Expand All @@ -104,6 +102,7 @@ export default async (webApp: WebApp): Promise<void> => {
res.status(204);
res.end();

const gameBridge = await webApp.container.getService("GameBridge");
const server = servers.find(srv => srv.ip === ip);
let gameserver: GameServer;
let player: Player | undefined;
Expand Down
3 changes: 1 addition & 2 deletions app/services/webapp/api/steam-oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ import axios from "axios";
// openid.sig=W0u5DRbtHE1GG0ZKXjerUZDUGmc=

export default async (webApp: WebApp): Promise<void> => {
const sql = await webApp.container.getService("SQL");

webApp.app.get("/steam/auth/callback/:id", rateLimit(), async (req, res) => {
const sql = await webApp.container.getService("SQL");
const query = req.query;
const userId = req.params.id;
if (!userId) res.status(403).send("Missing userid for linking");
Expand Down

0 comments on commit 661fa3b

Please sign in to comment.