Multiplayer
Loki issues the code.
createRoom() does not take a player-typed room key. joinRoom takes { inviteCode } only.
await client.authenticate(token);
const created = await client.createRoom();
showCode(created.inviteCode);
const joined = await client.joinRoom({ inviteCode: "123456" });
New rooms get a 6-digit code. Older 16-character hex codes still resolve.
Matchmaking
const room = await client.matchmake({
minPlayers: 2,
maxPlayers: 8,
teamSize: 2,
});
Fill-N / team matchmaking creates the same Loki room type. There are no public global pools in Layer 1.
Resolve and leave
const { roomId, inviteCode } = await client.resolveInvite("123456");
await client.leaveRoom();
Call leave() only from Leave / End Game. Invalid codes fail with INVITE_INVALID. A full room returns ROOM_FULL.