- can't unparent camera in OnDisable
- Player may be in a subscene so put camera in active scene after unparenting so it's not lost if additive is unloaded.
- Moving player object between subscenes unexpectedly fires OnDisable & OnEnable...who knew?
- Now uses Network Authenticator
- ChatUI is now a networked object with Cmd/Rpc
- Player is much simplified
- LoginUI is a separate canvas
- Login and server HUD combined into one panel
* feat: Support Fast Enter Playmode
- Uses [RuntimeInitializeOnLoadMethod] to reset statics
* fixed namespace
* Added comment
* Don't clear cmdHandlerDelegates
* Don't set aoi null
* renamed Init to Reset in static classes
* renamed method to ResetStatics
* renamed one too many
* marked NetworkServer.Shutdown with RuntimeInitializeOnLoadMethod
* Added RuntimeInitializeOnLoadMethod to NetworkClient.Shutdown
* renamed NetworkTime.Reset to ResetStatics
* reverted changes to Player
- Will be changing Chat example in master
* Renamed NetworkManager.Shutdown to ResetStatics
* fixed comment
* NetworkServer now calls NetworkIdentity.ResetStatics from its Shutdown
* Updated NetworkManagerTest::ShutdownTest
* Updated NetworkServerTest::ShutdownCleanup
* Updated NetworkServerTest::ShutdownCleanup
* Updated NetworkClientTest::ShutdownCleanup
* comments
* Call NetworkIdentity.ResetStatics from NetworkClient.Shutdown
- No longer passes `NetworkConnection` on Client
- Use `NetworkClient.connection` within your event hanlder
This is only breaking for users that assigned their own events to OnClientAuthenticated in the inspector. Everything else related to an Authenticator works the same with no changes needed because nearly all Authenticator mechanisms are private.
Deprecating would be worse than not in this case, since custom user-made handers would be the far uncommon case as far as I know.
* Obsoletes NetworkConnection param in client callbacks
- Use NetworkClient.connection instead
* fixed comments
* fixed more comments
* fixed more comments
* Restored original calls to virtuals with pragmas
* Call both old and new methods where possible
* added comments
* updated deprecated date
* fix parameters
* fixed examples
* comments
* NetworkTransform Improvements Reeeeesubmission
1: Optional boolean to allow onlySyncOnChange.
2: Checks if pos/rot/scale changed, if not, sends the value as null (1byte)
* NetworkTransform Improvements +defines
1: Optional boolean to allow onlySyncOnChange.
2: Checks if pos/rot/scale changed, if not, sends the value as null (1byte)
Contains the bundle of latest NT adjustments from the squad.
#3013#3021#3019#3018
Along with a fix for applying latest snapshot, if it exists, before applying local data.
#3024
* NetworkTransform smart sync.
Checks if pos/rot/scale changed, if not, sends the value as null (1byte)
So if someone has rotation and position turned on, but just rotates around Y, they save almost an entire pointless Vector3 position being sent.
- Again, majority of credits to Ninja.
* NetworkTransform smart sync. B
Adjusted to default(Vector3?)/Quat as requested.
Checks if pos/rot/scale changed, if not, sends the value as null (1byte)
So if someone has rotation and position turned on, but just rotates around Y, they save almost an entire pointless Vector3 position being sent.
- Again, majority of credits to Ninja.
* NetworkTransform smart sync. C
Line break added at end of file? as requested.
Adjusted to default(Vector3?)/Quat as requested.
Checks if pos/rot/scale changed, if not, sends the value as null (1byte)
So if someone has rotation and position turned on, but just rotates around Y, they save almost an entire pointless Vector3 position being sent.
- Again, majority of credits to Ninja.
Added NetworkTransformChild, set target as Turret
Adjust NTC and NT variables
Dragged ProjectileMount and Spot Light into Turret, so they all move together.
Added RotateTurret code
Updated current CmdFire to use projectileMount.rotation
* onlySendOnMove for new NetworkTransform
Majority of credits to Ninja.
Check comments, tooltips, and messages us if further clarification needed.
* onlySendOnMove for new NetworkTransform B
Majority of credits to Ninja.
Check comments, tooltips, and messages us if further clarification needed.
* onlySendOnMove for new NetworkTransform C
- added defines by request, to easier revert or disable new addition.
Majority of credits to Ninja.
Check comments, tooltips, and messages us if further clarification needed.
* onlySendOnMove for new NetworkTransform D
- added defines by request, to easier revert or disable new addition.
- added cachedSnapshotComparison by request.
- adjusted default variable and buffer check + thoroughly tested.
Majority of credits to Ninja.
Check comments, tooltips, and messages us if further clarification needed.
* onlySendOnMove for new NetworkTransform E
- code style => && adjusted as requested
- added defines by request, to easier revert or disable new addition.
- added cachedSnapshotComparison by request.
- adjusted default variable and buffer check + thoroughly tested.
Majority of credits to Ninja.
Check comments, tooltips, and messages us if further clarification needed.
* Optimised example game textures.
The 6 skyboxes for AdditiveLevels
Lowered from 4k .png (50 mb per image)
to 1k .jpg (70 kb per image)
* Delete .vsconfig
Co-authored-by: MrGadget <9826063+MrGadget1024@users.noreply.github.com>
* feat: Added Reset to Interest Management
- Used in Distance and Spatial to reset `lastRebuildTime`.
* Updated Template
* Update Assets/Mirror/Runtime/NetworkServer.cs
Co-authored-by: vis2k <info@noobtuts.com>
- fix: Send() now throws an exception for messages which require > 255 fragments
- fix: ReliableMaxMessageSize is now limited to messages which require <= 255 fragments
* feat: Support more nullable types
- NetworkWriter was also slightly rearraged to match NetworkReader
* fixed code smells
* fixed WriteVector4Nullable
* Got some of them working
* Couple more
* Couple more
* Added the rest
* reverted accidental change
Calling RemovePlayerForConnection followed by AddPlayerForConnection with the same player object fails to call OnStartLocalPlayer again because previousLocalPlayer was't properly reset to null.
* fix: NT checks NetworkClient.ready
NT should not be calling Cmd's when client isn't ready.
* Update Assets/Mirror/Components/NetworkTransform2k/NetworkTransformBase.cs
Co-authored-by: vis2k <info@noobtuts.com>
* Pass connection when spawning scene objects so that authority is not lost
* Update Assets/Mirror/Runtime/NetworkServer.cs
Co-authored-by: vis2k <info@noobtuts.com>
* feature: SyncVar<T>
* remove unused import
* SyncVarNetworkBehaviour<T> to support explicit hooks of <T> and to prepare for Weaver [SyncVar] internal replacement
* only call hook on client for compatibility with original [SyncVar]
* show SyncVar<T> label to make it obvious what type it is. useful to distinguish weaver replacements later
- Moved `ChangeOwner` down below `OnChangeOwner`
- Added `isLocalPlayer` bool to `ChangeOwnerMessage`
- Added handling for `isLocalPlayer to `ChangeOwner`
- Added call to `SendChangeOwnerMessage` to `ReplacePlayerForConnection` for when `keepAuthority` is true
- Fixes#2968
* fix: Prevent StopClient from running twice
- Fixes#2940
* Added comments
* Fixed stupid mistake
* moved check to OnClientDisconnect
Still need to fire that virtual so it can be overridden.
* Added check to StopClient itself too
* breaking: SyncObject as class instead of interface
* classes inheriting from SyncObject don't all need to implement obsoleted Flush() anymore
* IsRecording default moved to base class
* OnDirty default moved to base class
* comment
* IsRecording simplified now that it's a class
* OnDirty simplified now that it's a class
* fix: Eliminate potential NRE's in MatchInterestMgmt
- Scene objects with no NetworkMatch component
- Key not found in lastObjectMatch Dictionary
* Added comment, combined if's
* Added comments
* refactor Match Int Mgmt
* removed unused parameter
* removed unused parameter
* fix: Eliminate potential NRE's in MatchInterestMgmt
- Scene objects with no NetworkMatch component
- Key not found in lastObjectMatch Dictionary
* Added comment, combined if's
* Added comments
* Use String Interpolation
* Update Assets/Mirror/Editor/Weaver/EntryPointILPostProcessor/ILPostProcessorFromFile.cs
* Proper case in comments
* Add a constructor overload for creating a SyncDictionary from an IDictionary (#2933)
* Add a constructor overload for creating SyncDictionary from Dictionary
* Use IDictionary and directly use the passed in value
* Use passed in value directly
* Nope: SyncDictionary should specifically use a Dictionary under the hood
Reread the docs
* comment
* syntax
* Weaver: PropertySiteProcessor renamed to SyncVarAccessReplacer and updated comments/syntax to make it easier to understand
* Weaver: WeaverLists renamed to SyncVarAccessLists because that's what it's for
* comment
* Weaver: GetSyncVarStart simplified
* comment
* fix: Obsolete SyncObject Flush method (#2931)
* fix: Obsolete SyncObject Flush method
* fixed test
Co-authored-by: vis2k <info@noobtuts.com>
Co-authored-by: Gabriel Elkind <pixelpax@users.noreply.github.com>
* Add a constructor overload for creating SyncDictionary from Dictionary
* Use IDictionary and directly use the passed in value
* Use passed in value directly
* Nope: SyncDictionary should specifically use a Dictionary under the hood
Reread the docs
* change test to add observer
* perf: NetworkServer.Broadcast O(N) 'remove dirty bits for all spawned entities without observers' loop removed. AddObserver clears them instead if we had no observers before.
* don't need this anymore
* set syncobj.recording
* oops
* not a TODO anymore
* fix test
* fix test
* fix test
* fix tests
* fix test
* fix tests
* feature: SyncObject IsRecording() to prepare for NetworkServer.Update not calling ClearAllComponentsDirtyBits on all spawned entities with no observers.
* fix test
* breaking: Remove Obsoletes
- MIRROR_47_0_OR_NEWER symbol added
- A few obsoletes with Network Visibility remain...not ready to remove just yet.
* fixed test
* Weaver uses NetworkClient.connection instead of NetworkClient.readyConnection for client targetrpcs
* Update weaver tests to not use obsoletes
* Update test to expect SyncList<int> instead of SyncListInt
- Old default variables are for 'worst case connection' types, or fine for casual social game movement.
- It should be set as minimum delay, whilst still containing some smooth buffer data by default.
- Tool tip suggests what users can change it to for non-ideal connections from the new default value.
- First impressions are vital.
* WeaverTypes: make imported ReaderExtensions public
* WeaverTypes: import WriterExtensions too
* process reader/writer extensions
* rebase squashed previous ilpostprocessor branch
* adjust to weaver preparations changes
* fix: show strack trace
* better
* readability
* fix file not found cecilx exception
* fix rocks nto found exception
* syntax
* pass Mirror.dll to Weave()
* ILPostProcessorAssemblyResolver from paul
* comments, ifdef, syntax
* ILPostProcessorAssemblyResolver: add logging
* ILPostProcessorAssemblyResolver: add warnings on why Resolve() failed
* comments
* better warning
* rename
* use the custom resolver
* fix: ILPostProcessorReflectionImporter to fix System.Private.CoreLib not being found in Resolver
* add TODO
* comment
* fix Mirror.dll Resolve() issues in ReaderWriterProcessor when resolving from the passed Mirror.dll.
DefaultAssemblyResolver doesn't work with ILPostProcessor.
* fix comment
* check mirror assembly resolve result
* pass resolver to weaver
* fix Mirror.dll resolving Mirror.dll types NullReferenceException
* comments
* syntax
* comments
* readability
* syntax
* forgot to save
* rebase
* write
* fix self referencing Mirror.dll assembly
* disable log
* make tests work again
* comment
* comment
* fix rebase
* fix rebase
* comment
* fix: WeaverAssembler: only invoke weaver manually on mac. ILPP is invoked on windows automatically.
* this too
* remove comment
* ifdef out CompilationFinishedHook
* CompiledAssemblyFromFile
* comments
* tests assembly renamed to access compilationpipeline
* wip
* comments
* handle logs
* move file
* use WeaverTests error handling functions
* ILPP hook: don't log weaving failed errors for consistency with old method, and so that tests still work
* ILPPLogger: don't log prefix
* disable weaving succeeded log
* remove comment
* WeaverAssembly: save result to file
* move
* Weaver tests: compilationpipeline dependencies moved into Unity.Mirror.Weaver.CodeGen assembly.
so Tests assembly is actually weaved.
* disable self reference warning
* CompiledAssemblyFromFile simplified
* remove unused
* comments; run ILPP in all cases not just on mac
* ignore compilermessages on 2020+.
fixes windows tests not running.
* comment
* fix: ILPostProcessor ignore define added so WeaverAssembler can tell it not to run after being invoked by Unity after AssemblyBuilder.Build(). fixes SyncVarSyncList test failing on windows because ILPP was ran on it twice.
* typo
* comment
* comment
* static
* ifdef for 2019 support
* ifdef for 2019
* Fix - From !isLocalPlayer to !hasAuthority
Changed !isLocalPlayer to !hasAuthority because object might not be player object.
* Update Assets/Mirror/Components/NetworkTransform2k/NetworkTransformBase.cs
* Fix - delayed movement in clients in ClientAuthority mode - NetworkTransformBase.cs
Fixed issue where clients experience delayed movement in client authority mode.
Problem: Clients update the server first, server builds buffer then moves object, and then sends server's current snapshot to all the other clients who then build their buffers first before moving. This results in delayed movement in clients.
Changed the process to pass on the snapshot which the authoritative client updates the server onwards to other clients immediately instead and added checks to ensure server only broadcasts when object is on server authority or on host client authority.
* Update Assets/Mirror/Components/NetworkTransform2k/NetworkTransformBase.cs
* Update Assets/Mirror/Components/NetworkTransform2k/NetworkTransformBase.cs
* Update Assets/Mirror/Components/NetworkTransform2k/NetworkTransformBase.cs
Co-authored-by: vis2k <info@noobtuts.com>
* breaking: Weaver: [InitializeOnLoad] attribute is now added without using Reflection.
(possibly a breaking change according to the comment, although it's not obvious why it would break)
* breaking: Weaver: [RuntimeInitializeOnLoad] attribute is now added without using Reflection.
(possibly a breaking change according to the comment, although it's not obvious why it would break)
* comments
* fix builds