In our 0.2.5 SDK release we’re happy to announce peer connectivity events, and better support for system resolution changes, alongside general bugfixes and improvements.

Peer Connectivity Events

Historically, the Rainway SDK has always supported raising events when Peers connect or disconnect. With this release, the full set of connectivity changes is now supported via onPeerStateChange.

We’ve removed onPeerConnect and onPeerDisconnect which can now be handled by listening for states New and Failed, respectively.

For instance, the following logic can be used to log all connectivity state changes:

RainwayRuntime.initialize({
  // This callback notifies you when a peer connection is created or when its connectivity state changes
  onPeerStateChange: (peer: RainwayPeer, state: RainwayPeerState) => {
    console.log(`Peer ${peer} experienced a connectivity change to state ${state}`);
  }
  // ... Other callbacks
})

You can find more details on our new documentation site.

Improved Resolution Change Support

The support for system resolution changes during a stream has been improved. The Rainway SDK will now monitor these system changes, and adapt the stream resolution when they occur. For streams using app isolation, this means the isolated area will automatically update during resolution changes.

Breaking Changes

These changes are not backward compatible, and require all Peers to be upgraded to 0.2.5 for use.

  • Fixed Gamepad input handling to allow multiple buttons to be pressed at the same time.
  • Replaced Configuration callbacks onPeerConnect and onPeerDisconnect with onPeerStateChange.

Web SDK Cleanup

  • Removed deprecated connectToGateway function.
  • Removed deprecated disconnectFromGateway function.
  • Added host to RainwayStream to make it easier to determine which Peer a given stream belongs to.

Bug Fixes and Improvements

  • [Documentation] Published our new documentation site with several new features.
  • [Examples] Added a C++ example repository to our set of examples.
  • [Native SDKs] Fixed registration issue that may have led to Attempted to deregister a Peer we have no record of! warnings when disconnecting peers.
  • [.NET SDK] Converted RainwayRuntime.Peers to a Dictionary indexed by Peer ID, rather than a list of RainwayPeer objects.
  • [Node.js SDK] Added Runtime.peers, exposing a Map of Peer objects indexed by Peer ID.