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
* Round trip time bool and tooltip.
I've added this RTT boolean and a tooltip, might clear up some confusion for future users.
Many believe ping is time to server, and rtt is ping pong.
* Round trip time bool and tooltip.
I've added this RTT boolean and a tooltip, might clear up some confusion for future users.
Many believe ping is time to server, and rtt is ping pong.
* Round trip time bool and tooltip.
I've added this RTT boolean and a tooltip, might clear up some confusion for future users.
Many believe ping is time to server, and rtt is ping pong.
* Round trip time bool and tooltip.
I've added this RTT boolean and a tooltip, might clear up some confusion for future users.
Many believe ping is time to server, and rtt is ping pong.
Changed the default 100ms to 10ms
Double checked with Vis in Discord "tooltip is meant to say 10ms."
Already seen one screenshot of a Discord user that set this from 10 to 100, due to the typo, believing 100 was meant to be default and not 10.
* NetworkWriter consistency: Write(U)Ints moved to static extension methods for consistency with all the other writer functions like WriteUInt16.
This makes life easier because weaver looks for all Write(U)Int functions in the same place. Otherwise packed writes can't be removed in a later PR without breaking weaver (which is also evidence for being bad design before)
* NetworkReader consistency: removed redundant Read(U)Ints
* breaking: Obsolete Read/WritePacked functions and use the regular ones everywhere. We are not bandwidth limited but CPU limited, so this is good. Those were overly complex and worst of all they cause non deterministic packet sizes. a player packet might spawn fine in editor, but 1 month into production it might very well hit the 1200 MTU limit if health is suddenly >241 or the Vector2Int position is somewhere else. This was insanity.
* NetworkWriter consistency: Write(U)Ints moved to static extension methods for consistency with all the other writer functions like WriteUInt16.
This makes life easier because weaver looks for all Write(U)Int functions in the same place. Otherwise packed writes can't be removed in a later PR without breaking weaver (which is also evidence for being bad design before)
* NetworkReader consistency: removed redundant Read(U)Ints
* Return and log warning on start already started client or server
* Apply suggestions from code review, Always check for client and server active state
Co-authored-by: MrGadget <9826063+MrGadget1024@users.noreply.github.com>
* Update Assets/Mirror/Runtime/NetworkManager.cs
* Update Assets/Mirror/Runtime/NetworkManager.cs
* Update Assets/Mirror/Runtime/NetworkManager.cs
* Update Assets/Mirror/Runtime/NetworkManager.cs
* Update Assets/Mirror/Runtime/NetworkManager.cs
* Update Assets/Mirror/Runtime/NetworkManager.cs
Co-authored-by: MrGadget <9826063+MrGadget1024@users.noreply.github.com>
Co-authored-by: vis2k <info@noobtuts.com>
* adding kcp2k asmdef
marked with allowUnsafeCode
* adding reference to new kcp2k asmdef, and unmarking allowUnsafeCode
* adding public gettings for list/queue count
* Update Assets/Mirror/Runtime/Transport/KCP/MirrorTransport/KcpTransport.cs
Co-authored-by: vis2k <info@noobtuts.com>
Adding compression methods for Quaternion and floats. These methods can be used to decrease size of Quaternions before sending the value over the network.
ScaleToUInt method can be used to compress float from 32 bits to the range given to the method. This can be used to compress Vector3 if the bounds of the world are known and fixed before runtime.
* fix: fixing sceneId when using BuildPipeline.BuildPlayer with incorrect case in path
BuildPipeline.BuildPlayer takes an array of strings for scene paths. Unity will find the scene with the path case insensitive but path case is case sensitive.
This change would make it so that these 2 paths have the same hash
```
Assets/Scenes/Forest.unity
Assets/Scenes/forest.unity
```
* Adding full comment for ToLower
* Update NetworkIdentity.cs
Co-authored-by: vis2k <info@noobtuts.com>
* Making ReaderWriterProcessor return if it found custom functions (not counting ones in mirror.dll)
* Always writing generateContainerClass if modified
* processing PropertySiteProcessor if either ReaderWriterProcessor or WeaveModule are successful
* creating generateContainerClass in WeaverList constructor
* Moving new WeaverList to after WeaverTypes.SetupTargetTypes
* feat: adding MiddlewareTransport
* Allows Middleware to be created at the transport layer
* Middleware can choice which methods they want to override and which to let inner handle
* using expression bodies
* fix: improving errors in SendTargetRPCInternal
* now give error when connection is null
* updating error message to accurately explain what went wrong
* clientOwnedObjects is a hash set which doesn't need to be disposed
* DestroyOwnedObjects already clears list which is called by networkmanager when connection disconnects
Co-authored-by: vis2k <info@noobtuts.com>
* moving check to base connection because it could be used for either
* renaming to IsAlive
* passing in timeout so it doesn't need to check NetworkServer
* updating doc comment
The code to serialize lists, arrays, and array segments is now in the runtime instead of generated in the weaver.
removes about 300 LOC of weaver witchcraft
* perf: use built in == instead of unity one
should be the same performance as #2325 without the complexity
* more readable version
* more readable version
* Intial commit
see https://github.com/MirrorNetworking/SimpleWebTransport for full git histroy
* Update main.yml
Adding SimpleWebTransport to coverage exclusions
* fully ignoring SimpleWebTransport from sonarcloud
SimpleWebTransport has sonarcloud running on its own repo
* using Buffer.BlockCopy
* SimpleWebTransport v0.4.1
* making error messages use LogError (MirrorNetworking/SimpleWebTransport@5f0096c)
* messages with length of 1 can be recieved by the client (MirrorNetworking/SimpleWebTransport@4237fc4)
* stopping un-needed error logs after disconnect (MirrorNetworking/SimpleWebTransport@25ff190)
* updating readme
* SimpleWebTransport v0.5.0
* adding missing warn level to Log.Levels (MirrorNetworking/SimpleWebTransport@0f68498)
* Allowing multiple instances of javascript client (MirrorNetworking/SimpleWebTransport#14) (MirrorNetworking/SimpleWebTransport@cc6e513)
* SimpleWebTransport v0.5.8
* Stopping send error when client disconnects
* Adding buffer pool
* Using ArrayBuffer for receive
* Removing info and verbose logging by default so performance isnt effected in editor or development builds.
* Making WebSocketClientStandAlone use timeouts from inspector
* Removing incorrect header from inspector
* Removing readonly from logger so that it can be set
* Fixing use of Interlocked in buffer pools
* using ManualResetEventSlim
* making Log.Exception always be logged
* SimpleWebTransport v0.6.0
* Trying to fix error when connection is closed
* Increase arraybuffer speed
* Removing shared buffers from server handshake
* Improving debug logging
* fixing code smells
* SimpleWebTransport v0.6.1
* making sure pending connection work when stop serve is called
* removing exception that isnt directly thrown by this method
this breaks docfx for some reason
* Adding new websocket transport soon that doesn't depend on library
* Code for old transport can now be found here https://github.com/MirrorNetworking/NinjaWebSocketsTransport
* We shouldn't need to replace with empty files from store as having this in project should not break things
* perf: NetworkIdentity DirtyComponentsMask code removed entirely. OnSerialize now includes the component index as byte before serializing each component. Faster because we avoid GetDirtyComponentsMask() and GetSyncModeObserversMask() calculations. Increases allowed NetworkBehaviour components from 64 to 255. Bandwidth is now smaller if <8 components, and larger if >8 components. Code is significantly more simple.
* Update Assets/Mirror/Runtime/NetworkIdentity.cs
Co-authored-by: James Frowen <jamesfrowendev@gmail.com>
Co-authored-by: James Frowen <jamesfrowendev@gmail.com>
* Users must initialize syncobjects (#391)
Previously we initialized syncobjects, so this is valid:
```cs
public class Pepe : NetworkBehavior {
public SyncList<int> mylist;
}
```
With this change, users must initialize their own fields:
```cs
public class Pepe : NetworkBehavior {
public SyncList<int> mylist = new SyncList<int>();
}
```
BREAKING CHANGE: You must initialize all your SyncLists
* Add null check
* This is no longer a weaver error
* Update Assets/Mirror/Runtime/NetworkBehaviour.cs
Co-authored-by: James Frowen <jamesfrowendev@gmail.com>
* Remove unnecesary using
Co-authored-by: James Frowen <jamesfrowendev@gmail.com>