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
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user