Static
Readonly
ANSWER_Static
Readonly
ROOM_Sends a request to create a new room.
Creates a WebSocket connection to the given URL.
The WebSocket server URL.
Disconnects from the WebSocket server.
Sends a request to join an existing room.
The room ID to join.
The player's ID.
Called when a WebRTC data channel is closed with a remote participant.
The remote participant's ID.
Called when a WebRTC data channel is opened with a remote participant.
The remote participant's ID.
Called when a remote participant sends an update.
The participant's ID.
The action type.
The data payload.
Sends a WebRTC answer to a remote participant via the signaling server.
The remote participant's ID.
The RTC session description answer.
Sends an ICE candidate to a remote participant via the signaling server.
The remote participant's ID.
The ICE candidate.
Sends a WebRTC offer to a remote participant via the signaling server.
The remote participant's ID.
The RTC session description offer.
Sends a game update to all remote participants via their data channels.
The action type.
The data payload.
Sets the observer for network events.
The observer to notify of network events.
Static
getReturns the singleton instance of NetworkManager.
NetworkManager handles all networking for multiplayer, including:
Implements the singleton pattern: use NetworkManager.getInstance() to get the instance.