In our 0.2.6
SDK release we’ve added the runtime instance to all callbacks, stream fit options for web, and general bugfixes and improvements.
Breaking Changes
All SDKs must be updated so that they include these changes.
- [Rainway Services] Added mandatory headers to identify response payload types.
Runtime callbacks
Based on feedback, we’ve added the active RainwayRuntime
instance as the first parameter to
all RainwayConfig
callbacks.
We think this will allow developers to simplify their logic when accessing the instance.
RainwayRuntime.initialize({
// This callback notifies you when a remote peer wishes to connect to this peer.
onConnectionRequest: (
runtime: RainwayRuntime,
request: RainwayConnectionRequest
) => {
console.log(
`The peerId of the local runtime is ${runtime.getPeerId()}`
);
},
});
Stream Fit Options
In the Web SDK, we’ve added the ability to adjust how App-Isolated streams are sized.
In the past, the stream size would always match the streamed application window dimensions.
Now, that behavior is configurable using RainwayStreamFit
.
RainwayRuntime.initialize({
// This callback notifies you when a new peer-to-peer connection is initiated, or when it's connectivity state changes
onPeerStateChange: async (runtime, peer, state) => {
if (state == RainwayPeerState.New) {
// request a stream for the newly connected peer
const stream = await peer.requestStream(InputLevel.Keyboard);
// ensure that the stream is always sized to match the full desktop
stream.setStreamFit(RainwayStreamFit.FullDesktop);
}
},
});
Bug Fixes and Improvements
- [Native SDKs] Improved Gamepad driver installation logic to handle additional edge cases.
- [Web SDK] Added a
RainwayPeer.send
method to automatically encode and send UTF-8 strings. - [Web SDK] Added
RainwayPeer.disconnected
to indicate when a peer is in a disconnected state. - [Web SDK] Refactored
RainwayPeer.state
type to better represent all peer states. - [Node.js SDK] Corrected the built-in DLL path so developers need not use
RAINWAYSDK_DLL_PATH
. - [Node.js SDK] Fixed an issue with streaming when
isolateProcessIds
was missing that led to no video. - [Node.js SDK] Fixed an issue with programatically accessing connected peers that led to a crash.
- Added
InputLevel.All
to all SDKs, to simplify granting peers access to all input methods.