* fix(weaver): Warning for multiple write/read functions for the same type
Adding warning message when trying to register a write or read function for a type that is already in dictionary. Previously weaver would be silent about this making it hard to know when an extension method overrides another one.
* test for warnings
Empty commit for d3d3113f7b
* Actions perform a lot better than UnityEvents.
* This allows callbacks to be passed into classes within the transports without depending on unity
BREAKING CHANGE: Transports now uses callbacks instead of UnityEvents
Mirror side:
old: transport.OnClientConnected.addListener(OnConnect)
new: transport.OnClientConnected = OnConnect;
Transports side:
callbacks have same name has the events so they can still be called using `OnClientConnected.Invoke`
* checking buffer length is atleast 2
disconnect if invalid message
* using const instead of magic number
Adding test to make sure that writing id is the same size as IdSize
* adding comment
* renaming to HeaderSize
* delegate and callbacks instead of unityevent
* using callbacks in Mirror
* Using new callbacks instead of events
* moving methods next to each other in NetworkClient
* moving add/remove to methods in NetworkServer
* replacing uses of events within transports and tests
* fixing tests
* fixing more tests
* replacing delegates with actions
* adding comments to show what action variable's are
* removing extra function created in rebase
* renaming callbacks
* adding reset methods so that actions arn't null
* fixing rename
* breaking defines
* Update Assets/Mirror/Runtime/Transport/KCP/MirrorTransport/KcpTransport.cs
* Update KcpTransport.cs
* Update Transport.cs
* removing ResetHandlers methods
transports can now call events after stop is called
Co-authored-by: vis2k <info@noobtuts.com>
* adding try/catch to hanlder
user code can throw errors.
* Update Assets/Mirror/Runtime/MessagePacker.cs
* Update Assets/Mirror/Runtime/MessagePacker.cs
* test for command that throws
* disconnecting client after Exception in message handler
Co-authored-by: vis2k <info@noobtuts.com>
Generating readers and writers for structs in other assemblies
could sometimes cause a
```
System.ArgumentException: Member 'xxx' is declared in another module and needs to be imported
```
This in particular affected unity mathematics.
fixes#2406