com.unity.transport 0.3.0-preview.6
Notes: processedReleased February 24, 2020
Unity Compatibility
Minimum Unity: 2019.3 (0b11)
Package Dependencies
✨ Features
🔄 Changes
- Pipelines are now registered by calling `NetworkPipelineStageCollection.RegisterPipelineStage` before creating a `NetworkDriver`. The built-in pipelines do not require explicit registration. The interface for implementing pipelines has been changed to support this.
- NetworkDriver is no longer a generic type. You pass it an interface when creating the `NetworkDriver`, which means you can switch between backends without modifying all usage of the driver. There is a new `NetworkDriver.Create` which creates a driver with the default `NetworkInterface`. It is also possible to create a `new NetworkDriver` by passing a `NetworkInterface` instance as the first argument.
- `NetworkDriver.Send` is replaced by `BeginSend` and `EndSend`. This allows us to do less data copying when sending messages. The interface for implementing new netowrk interfaces has been changed to support this.
- `DataStreamReader` and `DataStreamWriter` no longer owns any memory. They are just reading/writing the data of a `NativeArray`.
- `DataStreamWriter` has explicit types for all Write methods.
- `DataStreamReader.Context` has been removed.
- Error handling for `DataStreamWriter` has been improved, on failure it returns false and sets `DataStreamWriter.HasFailedWrites` to true. `DataStreamReader` returns a default value and sets `DataStreamReader.HasFailedReads` to true. `DataStreamReader` will throw an excpetion instead of returning a default value in the editor.
- IPCManager is no longer public, it is still possible to create a `NetworkDriver` with a `IPCNetworkInterface`.
- Added `NetworkDriver.ScheduleFlushSend` which must be called to guarantee that messages are send before next call to `NetworkDriver.ScheduleUpdate`.
- Added `NetworkDriver.LastUpdateTime` to get the update time the `NetworkDriver` used for the most recent update.
- Removed the IPC address family, use a IPv4 localhost address instead.
🔧 Bug Fixes
- Fixed a memory overflow in the reliability pipeline.
- Made the soaker report locale independent.
- ### Upgrade guide
- Creation and type of `NetworkDriver` has changed, use `NetworkDriver.Create` or pass an instance of a `NetworkInterface` to the `NetworkDriver` constructor.
- `NetworkDriver.Send` has been replaced by a pair of `NetworkDriver.BeginSend` and `NetworkDriver.EndSend`. Calling `BeginSend` will return a `DataStreamWriter` to which you write the data. The `DataStreamWriter` is then passed to `EndSend`.
- All write calls in `DataStreamWriter` need an explicit type, for example `Write(0)` should be replaced by `WriteInt(0)`.
- `DataStreamWriter` no longer shares current position between copies, if you call a method which writes you must pass it by ref for the modifications to apply.
- `DataStreamWriter` no longer returns a DeferedWriter, you need to take a copy of the writer at the point you want to make modifications and use the copy to overwrite data later.
- `DataStreamWriter` is no longer disposable. If you use the allocating constructor you need to use `Allocator.Temp`, if you pass a `NativeArray` to the constructor the `NativeArray` owns the memory.
- `DataStreamReader.Context` no longer exists, you need to pass the `DataStreamReader` itself by ref if you read in a different function.
- The interface for network pipelines has been changed.
- The interface for network interfaces has been changed.
