* feat: logging api
Provide a ILogger (from unity framework) per class
it can track loggers per class and use Debug.unityLogger by default
* Logger field should never change
* Support loggers for static classes
Unfortunately we can't have generics with static classes.
Thus we can keep the loggers in a Dictionary instead indexed by name
if you need a logger for a static class, you can just do:
private static readonly ILogger logger = LogFactory.GetLogger(nameof(MyClass));
* Remove unused using
* Better tests by providing a mock handler
* using array in NetworkWriterPool instead of stack
* Using property
adding debug warning if pool is full
* adding tests for NetworkWriterPool
* Update NetworkWriterPool.cs
* Update NetworkWriterPoolTest.cs
Co-authored-by: vis2k <info@noobtuts.com>
* perf: use byte[] directly instead of MemoryStream
* Optimize writing int32 and int64
* Update Assets/Mirror/Runtime/NetworkWriter.cs
Co-Authored-By: vis2k <info@noobtuts.com>
* Update Assets/Mirror/Runtime/NetworkWriter.cs
Co-Authored-By: vis2k <info@noobtuts.com>
* Update Assets/Mirror/Runtime/NetworkWriter.cs
* Start with bigger buffer
* Woops, should have double checked suggestion
* Removed invalid Test
We should not require NetworkWriter to behave in certain way when Position
is set to out of bounds.
That is an invalid use of NetworkWriter, so NW should be free to do any behavior
* smells
* Update NetworkWriter.cs
Co-authored-by: vis2k <info@noobtuts.com>
* fix: #1515 - StopHost now invokes OnServerDisconnected for the host client too
* avoid NullReferenceException when calling StopHost without StartHost
* test WIP
* test
* feat: now you can assign scenes even if not in Editor
Instead of using scene name, scenes are now identified by path.
This fixes a couple problems:
1) In the room example, now you can assign the scenes even if they have
not been added to the editor. This was a constant pain because if you
open the offlinescene, all the scenes got wiped. You had to add the
scenes to the editor and reassign them all again. With this PR you
will still need to add them to the editor, but they will remain
assigned.
2) It is possible for multiple scenes to have the same name, but it is
not possible for multiple scenes to have the same path. So this is
a more robust way to identify scenes
This also greatly simplifies the scene SceneDrawer
BREAKING CHANGE: You will need to reassign your scenes after upgrade
* Automatically fix properties that were using name
If you open a NetworkManager or other gameobject that uses a scene name
it now gets converted to scene path by the SceneDrawer
* Use get scene by name
* Scene can never be null
* Update Assets/Mirror/Examples/AdditiveScenes/Scenes/MainScene.unity
* Issue warning if we drop the scene
* Issue error if scene is lost
* Add suggestion on how to fix the error
* Keep backwards compatibility, check for scene name
* cache the active scene
* Update Assets/Mirror/Editor/SceneDrawer.cs
Co-Authored-By: James Frowen <jamesfrowendev@gmail.com>
* GetSceneByName only works if scene is loaded
* Remove unused using
Co-authored-by: James Frowen <jamesfrowendev@gmail.com>
* NetworkTransform rotation compression removed. Gets rid of endless discussions, optimizations and issues. Sending a quaternion is never going to fail.
* keep empty file
* keep empty file
* fix: #1593 - NetworkRoomManager.ServerChangeScene destroys the world player after replacing the connection, not before. previously ReplacePlayerForConnection would operate on dead data.
* remove it entirely
* NetworkIdentity.isServer simplified via one flag instead of helper variable + netId check
* simplify teardowns
* NetworkIdentityTests can set isServer directly now
* networkbehaviourtests simplified
* NetworkServerTests can set isServer directly now
* remove comment
* fix#1484: revert isServer simplifiy. Fixes a bug where isServer was already false in OnDestroy, but we need sometimes still need it there to save skillbars etc.
* update comment