πMMO Server
Setup
VITE_API_URL=https://api-dev.sunflower-land.com
VITE_ROOM_URL=wss://mmo-dev.sunflower-land.comConnect to Server
// Join the MMO Server
let mmoServer: Room<PlazaRoomState> | undefined;
const serverName = getServer();
const mmoUrl = CONFIG.ROOM_URL;
if (serverName && mmoUrl) {
const client = new Client(mmoUrl);
mmoServer = await client?.joinOrCreate<PlazaRoomState>(serverName, {
jwt: context.jwt,
bumpkin: game?.bumpkin,
farmId,
x: SPAWNS.portal_example.default.x,
y: SPAWNS.portal_example.default.y,
sceneId: "portal_example",
experience: game.bumpkin?.experience ?? 0,
});
}Last updated