I am trying to start a teamtest server using RoZod like this (some stuff is redacted)
Script (index.js):
import { setTimeout } from "node:timers/promises";
import { configureServer, fetchApi, isAnyErrorResponse } from 'rozod';
import { deleteTeamtestPlaceid, getAssetsIdVersions } from 'rozod/lib/endpoints/developv2.js';
import { getJoinTeamTest } from 'rozod/lib/endpoints/gamejoinv1.js';
configureServer({
cookies: "<REDACTED>",
});
async function getAssetVersion(id) {
return (await fetchApi(getAssetsIdVersions, { id })).data?.[0].assetVersionNumber ?? 0;
};
async function joinTeamTest(PlaceId, PlaceVersion) {
const result = await fetchApi(getJoinTeamTest, { PlaceId, PlaceVersion });
return JSON.parse(result.split("\n", 2)[1]);
}
async function endTeamTest(placeId, gameId) {
return fetchApi(deleteTeamtestPlaceid, { placeId, gameId });
}
let lastGameId = null;
const TEAM_TEST_RUNNING = 2;
const TEAM_TEST_CREATING = 0;
async function newTeamTestSession(PlaceId, PlaceVersion) {
{
const { status, settings } = await joinTeamTest(PlaceId, PlaceVersion);
const GameId = settings?.GameId;
if (status === TEAM_TEST_RUNNING && GameId) {
await endTeamTest(PlaceId, GameId);
};
}
while (true) {
const json = await joinTeamTest(PlaceId, PlaceVersion);
const GameId = json.settings?.GameId;
const { status, message } = json;
// If session already exists
switch (status) {
case TEAM_TEST_CREATING: {
await setTimeout(1000);
continue; // Still creating
};
case TEAM_TEST_RUNNING: {
if (GameId) {
const newSession = GameId !== lastGameId;
if (newSession) {
lastGameId = GameId;
return json;
} else {
// Wait until previous session is deleted
await setTimeout(1000);
continue;
};
};
// No break so we can go to default
};
default: throw new Error(`Something went wrong, status ${status}, message ${message}, GameId ${GameId}`);
};
}
};
const placeId = 13584113212;
const placeVersion = await getAssetVersion(placeId);
const teamTestSession = await newTeamTestSession(placeId, placeVersion);
const gameId = teamTestSession.settings.GameId;
(function() {
let cleaningUp = false;
async function cleanup() {
if (cleaningUp) return;
cleaningUp = true;
await endTeamTest(placeId, gameId);
// await setTeamCreateEnabled(universeId, teamCreateEnabled);
}
process.on("SIGINT", async () => {
await cleanup();
process.exit(0);
});
process.on("SIGTERM", async () => {
await cleanup();
process.exit(0);
});
process.on("beforeExit", cleanup);
})();
console.log(JSON.stringify(teamTestSession, null, 2));
Console:
{
"status": 2,
"settings": {
"ClientPort": 0,
"MachineAddress": "10.186.12.41",
"ServerPort": 53928,
"ServerConnections": [{
"Address": "10.186.12.41",
"Port": 53928
}],
"UdmuxEndpoints": [{
"Address": "128.116.48.33",
"Port": 53928
}],
"DirectServerReturn": true,
"PepperId": 1776353748,
"TokenValue": "<REDACTED>",
"PingUrl": "",
"PingInterval": 120,
"UserName": "ChatGGPT",
"DisplayName": "Chat GPT",
"HasVerifiedBadge": false,
"SeleniumTestMode": false,
"UserId": 4656429295,
"DomainUserId": -1,
"UserIdMode": 0,
"RobloxLocale": "en_us",
"GameLocale": "en_us",
"UgcLocale": "en_us",
"SuperSafeChat": false,
"FlexibleChatEnabled": false,
"CharacterAppearance": "https://api.roblox.com/v1.1/avatar-fetch/?placeId=13584113212&userId=4656429295",
"ClientTicket": "<REDACTED>",
"GameId": "89924573-d189-4499-8702-150868c5d601",
"PlaceId": 13584113212,
"BaseUrl": "http://gamejoin.roblox.com/",
"ChatStyle": "Classic",
"CreatorId": 4656429295,
"CreatorTypeEnum": "User",
"MembershipType": "None",
"HasRobloxSubscription": false,
"AccountAge": 1055,
"CookieStoreFirstTimePlayKey": "rbx_evt_ftp",
"CookieStoreFiveMinutePlayKey": "rbx_evt_fmp",
"CookieStoreEnabled": true,
"IsUnknownOrUnder13": false,
"GameChatType": "Enabled",
"WhoCanWhisperChatWithMeInExperiences": "AllUsers",
"SessionId": "<REDACTED>",
"AnalyticsSessionId": "<REDACTED>",
"DataCenterId": 468,
"UniverseId": 4719412288,
"FollowUserId": 0,
"characterAppearanceId": 4656429295,
"CountryCode": "US",
"AlternateName": "",
"RandomSeed1": "<REDACTED>",
"ClientPublicKeyData": "{\"creationTime\":\"11:55 12/6/2022\",\"applications\":{\"RakNetEarlyPublicKey\":{\"versions\":[{\"id\":5,\"value\":\"Jy0uXN86HFuODRudIzEzZeLfCd8/z+ER6CMO0wAa5XY=\",\"allowed\":true}],\"send\":5,\"revert\":5}}}",
"RccVersion": "0.717.0.7170982",
"ChannelName": "",
"VerifiedAMP": 0,
"PrivateServerOwnerID": 0,
"PrivateServerID": "",
"EphemeralEarlyPubKey": "<REDACTED>",
"PartyId": "",
"ServerDMRecording": false,
"ShowRobloxTranslations": false,
"MatchmakingAttributes": "{\"ServerAttributes\":[]}",
"TranslationDisplayMode": "Production",
"ImageTranslationContentVariantType": "Production",
"NetStackPort": 54115,
"NetStackConfig": "<REDACTED>",
"NetStackTokenValue": "<REDACTED>"
}
}
There is literally nothing about how to connect to TeamTest ROBLOX RakNet Server, only about how to decode the packets (which are 99% outdated), so this could be a little more challenging than I thought.
Please help, feedback would be appreciated ![]()
