Still figuring out initial matchmaking hang (FROSTBITE). Lots of other changes.
- Added missing room images
- Removed internal rooms and disallow cloning some rooms
- License fixes
- Switched target to 20200306
- Socket header fixes
- Sockets are closed upon shutdown
* Sockets persist after being destroyed, fix
- Config changes for 20200306
- Settings initialized
- Name generation words cannot be longer than 9 characters
- Dorm generation changes and fixes
- Added some settings keys
- Matchmaking additions
* Instances are not yet updated to be or not to be in-progress
- Instance fixes and logging
- Image operation fixes
- DisplayName route start
- Challenge route start
- Default Amplitude key (i can see althe Amplitude requests are ignored
- Rate limiting ease
- GameConfigs properly queried and sent
- Many 'bulk' endpoints were added in or around 20200306
- Objective routes started
- DormRoom redirection in v2/name
- Client doesn't care if it gets 200 when setting prefs
- Balance/storefronts started
- Matchmaking goto/room timer and fixes
- Selfhosted Photon addition on the client sends matchmaking /photonregionpings, ignore since Photon is only one server in one region
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -19,7 +19,7 @@ import { APIUtils } from "../apiutils.ts";
|
||||
import { route as AccountRoute } from "./account/account.ts";
|
||||
import { route as ParentalControlRoute } from "./account/parentalcontrol.ts";
|
||||
|
||||
export const route = APIUtils.createRouter("/accountservice");
|
||||
export const route = APIUtils.createRouter("/accounts");
|
||||
|
||||
route.router.use(AccountRoute.path, AccountRoute.router);
|
||||
route.router.use(ParentalControlRoute.path, ParentalControlRoute.router);
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -19,6 +19,7 @@ import { APIUtils } from "../../apiutils.ts";
|
||||
import express from "express";
|
||||
import UnifiedProfile, { Profile } from "../../data/profiles.ts";
|
||||
import { z } from "zod";
|
||||
import { AuthType } from "../../data/users.ts";
|
||||
|
||||
export const route = APIUtils.createRouter("/account");
|
||||
|
||||
@@ -28,7 +29,7 @@ const CreateAccountRequestBodySchema = z.object({
|
||||
deviceId: z.string()
|
||||
});
|
||||
|
||||
const rateLimit = new APIUtils.RateLimiter(25, 5);
|
||||
const rateLimit = new APIUtils.RateLimiter();
|
||||
|
||||
route.router.post("/create",
|
||||
|
||||
@@ -102,6 +103,15 @@ route.router.get("/me",
|
||||
|
||||
);
|
||||
|
||||
route.router.post("/me/displayname",
|
||||
|
||||
APIUtils.Authentication,
|
||||
APIUtils.AuthenticationType(AuthType.Game),
|
||||
|
||||
APIUtils.RecNetResponse(true, "DisplayName customization is not yet implemented."),
|
||||
|
||||
);
|
||||
|
||||
interface BioFetchParams {
|
||||
id?: string
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -16,7 +16,30 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
import { APIUtils } from "../../apiutils.ts";
|
||||
import { AuthType } from "../../data/users.ts";
|
||||
|
||||
export const route = APIUtils.createRouter("/challenge");
|
||||
|
||||
// create router for now
|
||||
// todo: challenges; all of it
|
||||
// will require a ChallengeBuilder to compile challenge configs
|
||||
route.router.get('/v2/getCurrent',
|
||||
|
||||
APIUtils.Authentication,
|
||||
APIUtils.AuthenticationType(AuthType.Game),
|
||||
|
||||
(_rq, rs) => {
|
||||
rs.json({
|
||||
ChallengeMapId: 0,
|
||||
StartAt: new Date().toISOString(),
|
||||
EndAt: new Date(Date.now() + 604_800_000).toISOString(), // 1 week
|
||||
ServerTime: new Date().toISOString(),
|
||||
Challenges: [],
|
||||
Gift: {
|
||||
GiftDropId: 0,
|
||||
Xp: 0,
|
||||
Level: 0
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
);
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -20,7 +20,7 @@ import { GameConfigs } from "../../data/config.ts";
|
||||
|
||||
export const route = APIUtils.createRouter("/config");
|
||||
|
||||
const rateLimit = new APIUtils.RateLimiter(60, 2);
|
||||
const rateLimit = new APIUtils.RateLimiter();
|
||||
|
||||
route.router.get("/v2", rateLimit.middle(), (_rq, rs) => {
|
||||
const config = GameConfigs.getConfig();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -27,4 +27,4 @@ route.router.get('/v2/getUnlocked',
|
||||
|
||||
APIUtils.emptyArrayResponse
|
||||
|
||||
)
|
||||
);
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -16,7 +16,12 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
import { APIUtils } from "../../apiutils.ts";
|
||||
import { GameConfigs } from "../../data/config.ts";
|
||||
|
||||
export const route = APIUtils.createRouter("/gameconfigs");
|
||||
|
||||
route.router.get("/v1/all", APIUtils.emptyArrayResponse);
|
||||
const rateLimit = new APIUtils.RateLimiter();
|
||||
|
||||
route.router.get("/v1/all", rateLimit.middle(), async (_rq, rs) => {
|
||||
rs.json((await GameConfigs.getAllGameConfigs()).entries().map(val => ({Key: val[0], Value: val[1]})).toArray());
|
||||
});
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -15,8 +15,10 @@ GNU Affero General Public License for more details.
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
import { APIUtils } from "../../apiutils.ts";
|
||||
import { z } from "zod";
|
||||
import { APIUtils, NoBody } from "../../apiutils.ts";
|
||||
import { AuthType } from "../../data/users.ts";
|
||||
import express from "express";
|
||||
|
||||
export const route = APIUtils.createRouter('/objectives');
|
||||
|
||||
@@ -32,4 +34,28 @@ route.router.get('/v1/myprogress',
|
||||
});
|
||||
},
|
||||
|
||||
);
|
||||
|
||||
interface ClearGroupRequestBody {
|
||||
Group: number
|
||||
}
|
||||
const ClearGroupRequestSchema = z.object({
|
||||
Group: z.number()
|
||||
});
|
||||
route.router.post('/v1/cleargroup',
|
||||
|
||||
APIUtils.Authentication,
|
||||
APIUtils.AuthenticationType(AuthType.Game),
|
||||
express.json(),
|
||||
APIUtils.logBody,
|
||||
APIUtils.validateRequestBody(ClearGroupRequestSchema),
|
||||
|
||||
(rq: express.Request<NoBody, NoBody, ClearGroupRequestBody>, rs: express.Response) => {
|
||||
rs.json({
|
||||
Group: rq.body.Group,
|
||||
IsCompleted: false,
|
||||
ClearedAt: new Date().toISOString() // todo: objectives; all of it
|
||||
});
|
||||
},
|
||||
|
||||
);
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -38,4 +38,16 @@ route.router.get('/v1/:id',
|
||||
rs.json(await UnifiedProfile.get(parsedPlayerId).Reputation.getReputation());
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
route.router.get('/v1/bulk',
|
||||
|
||||
APIUtils.Authentication,
|
||||
APIUtils.AuthenticationType(AuthType.Game),
|
||||
|
||||
express.urlencoded({ extended: true }),
|
||||
APIUtils.logBody,
|
||||
|
||||
APIUtils.emptyArrayResponse
|
||||
|
||||
);
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -19,10 +19,11 @@ import Logging from "@proxnet/undead-logging";
|
||||
import { APIUtils } from "../../apiutils.ts";
|
||||
import express from "express";
|
||||
import UnifiedProfile from "../../data/profiles.ts";
|
||||
import { AuthType } from "../../data/users.ts";
|
||||
|
||||
const log = new Logging("ProgressionRoute");
|
||||
|
||||
const rateLimit = new APIUtils.RateLimiter(60, 2);
|
||||
const rateLimit = new APIUtils.RateLimiter();
|
||||
|
||||
export const route = APIUtils.createRouter("/players");
|
||||
|
||||
@@ -48,4 +49,15 @@ route.router.get('/v1/progression/:id',
|
||||
rs.json(res);
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
route.router.post('/v1/progression/bulk',
|
||||
|
||||
APIUtils.Authentication,
|
||||
APIUtils.AuthenticationType(AuthType.Game),
|
||||
express.urlencoded({ extended: true }),
|
||||
APIUtils.logBody,
|
||||
|
||||
APIUtils.emptyArrayResponse
|
||||
|
||||
);
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -66,7 +66,7 @@ route.router.get('/v1/hot',
|
||||
async (_rq, rs) => {
|
||||
// temporary: return all public AG rooms for testing
|
||||
const rooms = await Rooms.getAllBuiltinRoomGenerations();
|
||||
rs.json(rooms.map(room => room.Room).filter(room => room.Accessibility !== RoomAccessibility.Private));
|
||||
rs.json(rooms.map(room => room.Room).filter(room => room.Accessibility == RoomAccessibility.Public));
|
||||
},
|
||||
|
||||
);
|
||||
@@ -98,11 +98,16 @@ route.router.get('/v2/name/:name',
|
||||
}
|
||||
|
||||
const room = await Rooms.getByName(rq.params.name.trim());
|
||||
if (!room || rq.params.name == 'DormRoom') {
|
||||
rs.sendStatus(404);
|
||||
if (room) {
|
||||
rs.json(room.Room);
|
||||
return;
|
||||
} else if (rq.params.name == 'DormRoom') {
|
||||
const dorm = await Rooms.getProfileDormDefault(rs.locals.profile);
|
||||
if (dorm) rs.json(dorm.Room);
|
||||
else rs.sendStatus(404);
|
||||
return;
|
||||
} else {
|
||||
rs.json(room.Room);
|
||||
rs.sendStatus(404);
|
||||
return;
|
||||
}
|
||||
},
|
||||
@@ -118,4 +123,4 @@ route.router.post('/v1/roomRolePermissions',
|
||||
rs.sendStatus(200);
|
||||
},
|
||||
|
||||
);
|
||||
);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -59,11 +59,8 @@ route.router.post('/v2/set',
|
||||
|
||||
(rq: express.Request<NoBody, NoBody, SettingsSetBody>, rs: express.Response) => {
|
||||
rs.locals.profile.Settings.setSettingRaw(rq.body.Key, rq.body.Value),
|
||||
rs.json({
|
||||
Succeeded: true,
|
||||
Error: "",
|
||||
ShouldRetry: false
|
||||
});
|
||||
rs.sendStatus(200);
|
||||
log.d(`${rs.locals.profile.getId()} set settings key '${rq.body.Key}' to '${rq.body.Value}'`);
|
||||
}
|
||||
|
||||
);
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -17,6 +17,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
import { APIUtils } from "../../apiutils.ts";
|
||||
import express from "express";
|
||||
import { AuthType } from "../../data/users.ts";
|
||||
import { CurrencyType, StorefrontBalanceType } from "../../data/content/storefronts.ts";
|
||||
|
||||
export const route = APIUtils.createRouter('/storefronts');
|
||||
|
||||
@@ -26,6 +28,7 @@ interface StorefrontFetchParams {
|
||||
route.router.get('/v3/giftdropstore/:id',
|
||||
|
||||
APIUtils.Authentication,
|
||||
APIUtils.AuthenticationType(AuthType.Game),
|
||||
|
||||
(rq: express.Request<StorefrontFetchParams>, rs: express.Response) => {
|
||||
if (!rq.params.id) {
|
||||
@@ -39,4 +42,28 @@ route.router.get('/v3/giftdropstore/:id',
|
||||
});
|
||||
},
|
||||
|
||||
);
|
||||
|
||||
interface BalanceParams {
|
||||
currencyType?: string
|
||||
}
|
||||
route.router.get('/v4/balance/:currencyType',
|
||||
|
||||
APIUtils.Authentication,
|
||||
APIUtils.AuthenticationType(AuthType.Game),
|
||||
|
||||
(rq: express.Request<BalanceParams>, rs: express.Response) => {
|
||||
const parsedCurrencyType = parseInt(rq.params.currencyType ? rq.params.currencyType : "2");
|
||||
if (isNaN(parsedCurrencyType)) {
|
||||
rs.sendStatus(400);
|
||||
} else {
|
||||
rs.json([{
|
||||
Balance: 0,
|
||||
BalanceType: StorefrontBalanceType.NonPurchasedNonP2P,
|
||||
CurrencyType: parsedCurrencyType
|
||||
}]);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
);
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -19,7 +19,9 @@ import { APIUtils } from "../../apiutils.ts";
|
||||
|
||||
export const route = APIUtils.createRouter("/versioncheck");
|
||||
|
||||
const validVersion = "20191120";
|
||||
export const validVersions = [
|
||||
"20200306"
|
||||
];
|
||||
|
||||
enum VersionStatus {
|
||||
ValidForPlay,
|
||||
@@ -35,10 +37,10 @@ route.router.get("/v4", (rq, rs) => {
|
||||
const requestedVer = rq.query["v"];
|
||||
const pQuery = rq.query["p"];
|
||||
|
||||
if (typeof requestedVer == "undefined" || typeof pQuery == "undefined") {
|
||||
if (typeof requestedVer == "undefined" || typeof pQuery == "undefined" || typeof requestedVer == 'object') {
|
||||
rs.statusCode = 400;
|
||||
rs.json(APIUtils.genericResponseFormat(true, "One or more query parameters were not found."));
|
||||
} else if (requestedVer !== validVersion) {
|
||||
rs.json(APIUtils.genericResponseFormat(true, "One or more query parameters were not found or invalid."));
|
||||
} else if (!validVersions.includes(requestedVer as string)) {
|
||||
const res: ValidVersionResponse = {
|
||||
VersionStatus: VersionStatus.UpdateRequired,
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -18,8 +18,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
import { APIUtils } from "../apiutils.ts";
|
||||
import { route as CachedLoginRoute } from "./auth/cachedlogin.ts";
|
||||
import { route as ConnectRoute } from "./auth/connect.ts";
|
||||
import { route as AccountRoute } from "./auth/account.ts";
|
||||
|
||||
export const route = APIUtils.createRouter("/authservice");
|
||||
export const route = APIUtils.createRouter("/auth");
|
||||
|
||||
route.router.use(CachedLoginRoute.path, CachedLoginRoute.router);
|
||||
route.router.use(ConnectRoute.path, ConnectRoute.router);
|
||||
route.router.use(AccountRoute.path, AccountRoute.router);
|
||||
41
src/routes/auth/account.ts
Normal file
41
src/routes/auth/account.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
import { APIUtils } from "../../apiutils.ts";
|
||||
import { AuthType } from "../../data/users.ts";
|
||||
|
||||
export const route = APIUtils.createRouter("/account");
|
||||
|
||||
route.router.post('/me/changepassword',
|
||||
|
||||
APIUtils.Authentication,
|
||||
APIUtils.AuthenticationType(AuthType.Game),
|
||||
|
||||
APIUtils.RecNetResponse(true, "Passwords are unsupported on Galvanic Corrosion.")
|
||||
|
||||
);
|
||||
|
||||
route.router.get('/me/haspassword',
|
||||
|
||||
APIUtils.Authentication,
|
||||
APIUtils.AuthenticationType(AuthType.Game),
|
||||
|
||||
(rq, rs) => {
|
||||
rs.json(true);
|
||||
},
|
||||
|
||||
);
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -24,6 +24,7 @@ import Logging from "@proxnet/undead-logging";
|
||||
import { z } from "zod";
|
||||
import { AuthType } from "../../data/users.ts";
|
||||
import { Redis } from "../../db.ts";
|
||||
import { validVersions } from "../api/versioncheck.ts";
|
||||
|
||||
const config = Config.getConfig();
|
||||
|
||||
@@ -116,7 +117,7 @@ route.router.post("/token",
|
||||
const conditionsMet = ![
|
||||
rq.body.client_id === "recroom",
|
||||
rq.body.platform === "0",
|
||||
rq.body.ver === '20191120',
|
||||
validVersions.includes(rq.body.ver),
|
||||
rq.body.device_class.length === 1,
|
||||
!isNaN(Number(rq.body.device_class)),
|
||||
!(rq.body.device_id.length > 96),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -36,6 +36,7 @@ interface ImageQueryOptions {
|
||||
cropSquare?: string;
|
||||
width?: string;
|
||||
height?: string;
|
||||
sig?: string;
|
||||
}
|
||||
|
||||
route.router.get(
|
||||
@@ -49,8 +50,6 @@ route.router.get(
|
||||
rq.path.substring(1, rq.path.length).replaceAll("%20", " "),
|
||||
);
|
||||
|
||||
// why does it think it is never reassigned? line 39
|
||||
// deno-lint-ignore prefer-const
|
||||
let image: Image;
|
||||
const imageSource = baseImages.includes(filename)
|
||||
? BaseImages.getBaseImage(filename)
|
||||
@@ -80,6 +79,23 @@ route.router.get(
|
||||
else height = num;
|
||||
}
|
||||
|
||||
if (cropSquare == 1) {
|
||||
if (image.width > image.height) {
|
||||
image.crop(
|
||||
Math.round(image.width / 2) - Math.round(image.height / 2),
|
||||
0,
|
||||
image.height,
|
||||
image.height,
|
||||
);
|
||||
} else {
|
||||
image.crop(
|
||||
0,
|
||||
Math.round(image.height / 2) - Math.round(image.width / 2),
|
||||
image.width,
|
||||
image.width,
|
||||
);
|
||||
}
|
||||
}
|
||||
if (width && height) {
|
||||
const targetWidth = width > image.width ? image.width : width;
|
||||
const targetHeight = height > image.height ? image.height : height;
|
||||
@@ -102,23 +118,8 @@ route.router.get(
|
||||
}
|
||||
} else if (width) image.resize(width, Image.RESIZE_AUTO);
|
||||
else if (height) image.resize(Image.RESIZE_AUTO, height);
|
||||
if (cropSquare == 1) {
|
||||
if (image.width > image.height) {
|
||||
image.crop(
|
||||
Math.round(image.width / 2) - Math.round(image.height / 2),
|
||||
0,
|
||||
image.height,
|
||||
image.height,
|
||||
);
|
||||
} else {image.crop(
|
||||
0,
|
||||
Math.round(image.height / 2) - Math.round(image.width / 2),
|
||||
image.width,
|
||||
image.width,
|
||||
);}
|
||||
}
|
||||
|
||||
rs.setHeader('content-signature', 'key-id=KEY:RSA:p1.rec.net; data=aGk='); // enable image signature patch on client
|
||||
if (rq.query.sig) rs.setHeader('content-signature', 'key-id=KEY:RSA:p1.rec.net; data=aGk=');
|
||||
rs.type("png").send(Buffer.from(await image.encode()));
|
||||
},
|
||||
);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -35,8 +35,9 @@ route.router.post('/room/:roomName',
|
||||
|
||||
APIUtils.Authentication,
|
||||
APIUtils.AuthenticationType(AuthType.Game),
|
||||
APIUtils.startTimer,
|
||||
|
||||
async (rq: express.Request<MatchmakingParams>, rs: express.Response) => {
|
||||
async (rq: express.Request<MatchmakingParams>, rs: express.Response, nxt: express.NextFunction) => {
|
||||
if (!rq.params.roomName) {
|
||||
log.d('Matchmake failed: No room specified');
|
||||
rs.json({
|
||||
@@ -45,22 +46,30 @@ route.router.post('/room/:roomName',
|
||||
return;
|
||||
}
|
||||
rs.json(await Matchmaking.matchmake({ profile: rs.locals.profile, roomName: rq.params.roomName }));
|
||||
nxt();
|
||||
},
|
||||
|
||||
APIUtils.stopTimer
|
||||
|
||||
);
|
||||
route.router.post('/room/:roomName/:subRoomName',
|
||||
|
||||
APIUtils.Authentication,
|
||||
APIUtils.AuthenticationType(AuthType.Game),
|
||||
APIUtils.startTimer,
|
||||
|
||||
async (rq: express.Request<MatchmakingParams>, rs: express.Response) => {
|
||||
async (rq: express.Request<MatchmakingParams>, rs: express.Response, nxt: express.NextFunction) => {
|
||||
if (!rq.params.roomName) {
|
||||
log.d('Matchmake failed: No room specified');
|
||||
rs.json({
|
||||
errorCode: MatchmakingErrorCode.NoSuchRoom
|
||||
});
|
||||
return;
|
||||
}
|
||||
rs.json(await Matchmaking.matchmake({ profile: rs.locals.profile, roomName: rq.params.roomName, subRoomName: rq.params.subRoomName }));
|
||||
nxt();
|
||||
},
|
||||
|
||||
)
|
||||
APIUtils.stopTimer
|
||||
|
||||
);
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -25,6 +25,7 @@ import Logging from "@proxnet/undead-logging";
|
||||
import UnifiedProfile from "../../data/profiles.ts";
|
||||
import { PlayerStatusVisibility, VRMovementMode } from "../../data/live/types.ts";
|
||||
import { SettingKey } from "../../data/content/settings.ts";
|
||||
import Instances from "../../data/live/instances.ts";
|
||||
|
||||
const log = new Logging("MatchPlayerRoute");
|
||||
|
||||
@@ -85,7 +86,7 @@ route.router.post('/logout',
|
||||
APIUtils.validateRequestBody(LoginSchema),
|
||||
|
||||
(_rq, rs) => {
|
||||
Matchmaking.deleteLoginLock(rs.locals.profile);
|
||||
Instances.removePlayerFromCurrentInstance(rs.locals.profile);
|
||||
rs.sendStatus(200);
|
||||
}
|
||||
|
||||
@@ -110,14 +111,14 @@ interface StatusVisibilityBody {
|
||||
statusVisibility: PlayerStatusVisibility
|
||||
}
|
||||
const StatusVisibilitySchema = z.object({
|
||||
statusVisibility: z.nativeEnum(PlayerStatusVisibility)
|
||||
statusVisibility: z.enum(Object.values(PlayerStatusVisibility).map(String) as [string, ...string[]])
|
||||
});
|
||||
|
||||
route.router.put('/statusvisibility',
|
||||
|
||||
APIUtils.Authentication,
|
||||
APIUtils.AuthenticationType(AuthType.Game),
|
||||
express.urlencoded({ extended: true }),
|
||||
APIUtils.logBody,
|
||||
APIUtils.validateRequestBody(StatusVisibilitySchema),
|
||||
|
||||
async (rq: express.Request<NoBody, NoBody, StatusVisibilityBody>, rs: express.Response) => {
|
||||
@@ -148,4 +149,15 @@ route.router.put('/vrmovementmode',
|
||||
rs.sendStatus(200);
|
||||
},
|
||||
|
||||
);
|
||||
|
||||
route.router.put('/photonregionpings',
|
||||
|
||||
APIUtils.Authentication,
|
||||
APIUtils.AuthenticationType(AuthType.Game),
|
||||
|
||||
(rq, rs) => {
|
||||
rs.sendStatus(200);
|
||||
}
|
||||
|
||||
);
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -24,6 +24,7 @@ const protocol = config.web.api.securepublichost ? "https" : "http";
|
||||
export const route = APIUtils.createRouter("/ns");
|
||||
|
||||
type NameserverHosts = {
|
||||
Accounts: string;
|
||||
Auth: string;
|
||||
API: string;
|
||||
WWW: string;
|
||||
@@ -38,6 +39,7 @@ type NameserverHosts = {
|
||||
};
|
||||
|
||||
const nameserver: NameserverHosts = {
|
||||
Accounts: `${protocol}://${config.web.api.publichost}/accounts`,
|
||||
Auth: `${protocol}://${config.web.api.publichost}/auth`,
|
||||
API: `${protocol}://${config.web.api.publichost}`,
|
||||
WWW: `${protocol}://${config.web.api.publichost}`,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -57,7 +57,7 @@ const AuthRequestRootSchema = z.object({
|
||||
pubkey: z.string(),
|
||||
});
|
||||
|
||||
const rateLimit = new APIUtils.RateLimiter(60, 2);
|
||||
const rateLimit = new APIUtils.RateLimiter();
|
||||
|
||||
route.router.post("/auth",
|
||||
|
||||
@@ -140,7 +140,7 @@ route.router.post("/auth",
|
||||
},
|
||||
);
|
||||
|
||||
const checkRateLimit = new APIUtils.RateLimiter(10, 3);
|
||||
const checkRateLimit = new APIUtils.RateLimiter();
|
||||
|
||||
route.router.get('/checkExpired', checkRateLimit.middle(), async (rq, rs) => {
|
||||
|
||||
@@ -152,7 +152,7 @@ route.router.get('/checkExpired', checkRateLimit.middle(), async (rq, rs) => {
|
||||
|
||||
try {
|
||||
const decodedToken = await decode<UserTokenFormat>(token, config.auth.secret, { algorithm: "HS512", leeway: 31536000 }); // 1 year leeway
|
||||
rs.json(decodedToken.exp < Math.round(Date.now() / 1000));
|
||||
rs.json(decodedToken.exp < Math.round(Date.now() / 1000)); // check it manually
|
||||
} catch {
|
||||
rs.json(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user