INNER CODE UNIT · TypeScript
index
voxelize/voxelize · packages/core/src/core/network/index.ts:221
let index = Math.floor(Math.random() * MAX).toString();
index =
new Array(MAX.toString().length - index.length).fill("0").join("") +
index;
this.clientInfo.username = `Guest ${index}`;
}
connect = async (
serverURL: string,
options: NetworkConnectionOptions = {},
) => {
if (!serverURL) {
throw new Error("No server URL provided.");
}
if (typeof serverURL !== "string") {
throw new Error("Server URL must be a string.");
}