* Made dirty bits not rely on NetworkWriter position manipulation hackery.
* Renamed GetDirtyBits to NextDirtyBits, as discussed with Paul.
* Expanded one line ifs.
* Added basic SyncDictionary support, no support for structs yet
* Fixed TryGetValue usage
* Removed extraneous hardcoded SyncDictionary type
* Added a couple basic tests, more coming
* Added 4 more tests
* Added two tests and SyncDictionary now bubbles item to Callback on Remove (both Remove cases)
* Added the remainder of tests
* Added basic documentation about SyncDictionaries on StateSync.md page
* Simplify test syntax
Co-Authored-By: Katori <znorth@gmail.com>
* Simplify test syntax
Co-Authored-By: Katori <znorth@gmail.com>
* Simplify test syntax
Co-Authored-By: Katori <znorth@gmail.com>
* Simplify test syntax
Co-Authored-By: Katori <znorth@gmail.com>
* Remove null-check when setting value directly (and updated expected test behaviour)
* fix: Provide default implementation for SyncDictionary serializers
* feat: Add Weaver support for syncdictionary
* Fix minor issue with Set code and made test use Weaved serialization instead of manual
* Added a new test for bare set (non-overwrite)
* Added another test for BareSetNull and cleaned up some tests
* Updated SyncDictionary documentation on StateSync.md
* Update docs with SyncDictionary info
* Update SyncDictionary docs wording
* docs: document the types and better example
* Add two SyncDictionary constructors
* Removed unnecessary initialization
* Style fixes
* - Merged many operation cases
- Fixed Contains method
- Added new test to test contains (and flag its earlier improper usage)
- Use PackedUInt32 instead of int for Changes and Counts
* - Simplify "default" syntax
- Use Rodol's remove method (faster)
- Don't use var
* Removed unnecessary newline, renamed <B, T> to <K, V> per vis2k, corrected wording of InvalidOperationException on ReadOnly AddOp
* Code simplification, style fixes, docs example style fixes, newly improved implementation for CopyTo that fails gracefully
* feature(synclist): allow SyncList of primitive types
As it turns out this never really worked:
```cs
class SyncListByte : SyncList<byte> {};
```
You had to write your own serializeItem / deserialize item for native types.
This change lifts the restriction, now you can use a synclist of anything that mirror can serialize/deserialize
* fix: fix unit tests error messages
* - Added a `IMessageBase` as an interface to `MessageBase`. Existing messages which inherit `MessageBase` (including ones which do not implement Serialize/Deserialize and rely on the weaver) will continue to work in exactly the same way as before!
- Modified any methods which were generic `T where T : MessageBase` to be `T where T : IMessageBase`. this does not change things at all for all existing usages of the method.
These two changes allow end users to implement IMessageBase as a `struct` instead of `MessageBase` as a `class`, so they are no longer forced to allocate message objects in their own code.
* Update .gitignore
* Update Messages.cs
* Update MessageBaseTests.cs
* Update MessageBaseTests.cs
* Update MessageBaseTests.cs
Previously, if you wanted a synclist of structures, you would do: SyncListSTRUCT<MyStruct>
Now you can use SyncList<MyStruct>
SyncListSTRUCT is left there, but obsolete
This allows you to leave rotation out of the NetworkTransform if you only need position.
Right now if you don't need sync rotation and set compression to Lots, it can move your object in ways not expected. This forces you to use no compression as a fix. Using more bandwidth for something you don't need. I think this is all that is needed, tested it in my game and it works.
The name SyncObjectProcessor is confusing because it does not process syncobjects. Instead it initializes syncobjects in a NetworkBehaviour.
this avoids the confusion with SyncListStructProcessor, that does process synclists to add serialization methods
SyncListProcessor is a very confusing name, it does not process synclists at all, instead it initializes synclists in the network behaviour.
This is more confusing especially since SyncListStructProcessor does process the synclists to add serialization methods, and both of them normally work
in tandem in different parts of the code
* Fix Scene Handling
Line 361: Passing false prevents the switch to offline scene...pass true instead to forceReload paramater.
Line 588: Never assume Network Manager is in Scene 0 of Build Settings...it often is not.
* Reverted GetActiveScene
Will make separate PR
* Added code to unwind DontDestroyOnLoad
* Fixed typo in comment
* Removed the unwinding of DDOL
* [TargetRPC] optional connection parameter for easier usage while still allowing for previous usage
* allow for parameterless targetrpc too
* syntax
* Add Helpers.ReaderParameters change from HLAPI 2019.2 package just to be sure
* move weaver into assets folder
* disable tests for now
* asmdef
* add logs
* Use UNET's WeaverRunner code, slightly modified to find Mirror assembly
* Use UNET's 2019.2 package Weave function changes
* compiler messages error checked moved into separate function
* fix typo
* syntax
* replace 'var'
* rename
* replace var
* fix log
* update comment
* syntax
* rename to assemblyPath. no need for an extra variable.
* remove extra variable
* fix typo
* remove old code
* don't use .Contains to find Mirror dll. that's crazy. would fail for all DLLs in Mirror folder.
* look for 'this' assembly separately
* separate unityEngine assembly search
* add comment
* move null check up
* move null check upwards
* move outputDirectory down
* check process result properly
* use our previous way to find unity engine dll
* rename to unityEngineCoreModuleDLL again
* improve output directory construction
* move unityengine dll finding upwards
* move foundThisAssembly down, where it is used
* add comments
* split dependency code into separate functions
* add TODO
* store this assembly in a variable
* split dependency search depending on if we found assembly or not
* move usesMirror logic into if and out of 'not found' else
* syntax
* improve order
* GetNonDynamicAssemblyDirectories helper function
* check File.Exists instead of exception
* improve comment
* rename HlapiRuntimeAssemblyName to MirrorAssemblyName
* reuse MirrorAssemblyName
* remove telepathy check
* rename to MirrorRuntimeAssemblyName
* add MirrorWeaverAssemblyName
* reuse name consts
* don't use contains to check if assembly depends on Mirror
* add actions for testing again
* make CompilationFinishedHook public so it can be used by tests
* fix typo
* Mirror.Tests.asmdef references weaver asmdef
* reenable tests
* pass error handlers to Weaver Processing for tests to work
* add empty line
* persistent scene ids
* never assign scene ids at runtime
* fix warning
* fix 'sceneid is never assigned to' warning in play mode
* simplify bitwise operation
* set dirty even if only scene index byte changed
* improve log message
* assign build index byte in OnPostProcessScene to also work with unopened scenes and build index changes
* add comment
* improve log
* Add sceneid not set check
* Only PostProcess the objects from this scene.
* Interrupt build if there is an unopened scene that still needs sceneId assignments. This makes it 100% fail safe.
* improve comment and error message
* clear build index byte before or-ing into it
* Fixed animator bandwidth problem.
* Renamed xShadowCopy to lastXParamters, renamed val to be consistent with the reading value names, renamed newValue to newIntValue to be consistent with newFloatValue and newBoolValue.
* Removed Debug.log which slipped by.