Sessions

The Game Session module enables developers to create and manage multiplayer game sessions. This feature allows real-time synchronization between players.

3.1 Creating a Game Session

createSession(callback)

Creates a new multiplayer session.

BananaClip.createSession(sessionData => {
    console.log("Game session created:", sessionData);
});

3.2 Joining a Game Session

joinSession(sessionId, callback)

Allows a player to join an existing game session.

BananaClip.joinSession("session-123", success => {
    console.log("Joined session successfully:", success);
});

3.3 Leaving a Game Session

leaveSession(callback)

Allows a player to leave the current session.

BananaClip.leaveSession(success => {
    console.log("Left session:", success);
});

Last updated