We are very excited for our first release since making Rainway publicly accessible!

Custom Data Channels

Our biggest change for v0.2.3 is adding support for multiple user data channels with either reliable or unreliable transport. This is how you create and use channels now:

RainwayRuntime.initialize({
    // The on message callback now notifies you of the channel the messsage was received on.
    onPeerMessage: (peer, channel, data) => {},
    // This callback notifies you of new channels which are created by remote peers.
    onPeerDataChannel: (peer, channel, mode) => {
        console.log(
            `New data channel '${channel}' create by remote peer ${peer}`
        );
    },
    // ... Other callbacks
});

// ... Connect to peer or received connection

// Create a new data channel iff we initiated the connection with the peer.
// May also specify reliable/unreliable
peer.createDataChannel("Messages", RainwayChannelMode.Reliable);

// Sending messages now requires the channel name data is being sent on.
peer.send("Messages", new Uint8Array([1, 2, 3]));
  • More than one data channel is now supported
  • Data channels may opt to use reliable or unreliable transport
  • Internal datagram re-forming system now supports cleaning old data for unreliable connections

You can see more details on the exchanging messages tutorial page.

Data Channel Name Refactor

To support the custom channel names, Rainway channels are now prefixed with RW_. This means old clients will not work with v0.2.2.

API cleanup

  • Removed deprecated rainway_set_peer_message_callback function
  • Removed deprecated RainwayPeerMessageCallback
  • Node wrapper now requires Node >=17 (this is to improve N-API reliability - see node-clangffi#2 for more information)

Bug Fixes

  • enhanced mouse pointer precision