* - 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.
* Client can send/receive messages without id
* Server can send and receive messages without id
* Move message id to one common place
* Client use the new send method
* Obsolete the message ids
* Remove player uses the new api
* Refactor AddPlayer with new message api
* Provide a Pack method that gets the message id
* Convert ready message to new api
* Use new api for ObjectDestroy and ObjectHide
* Refactored ready message to new API
* Refactored SpawnSceneObjectMessage to new api
* Convert local authority message to new api
* Convert spawn started message to new api
* Convert spawn finished message to new api
* Convert upate vars message to new api
* Convert owner message to new api
* Convert pong message to new api
* Convert RPC message to new api
* Convert SyncEvent rpc to new api
* Refactor Command to new api
* Refactor Ping to new api
* Convert ErrorMessage to new api
* Convert ErrorMessage to new api
* Use int instead of short for message id to avoid collisions
* Keep only 16 bit hash for message id
* Converted Disconnect Message to new api
* Convert Connect to new message api
* Convert not ready message to new api
* Convert scene message to new api
* the Enum is no longer used for message id
* Add non obsolete version of SendToClient
* Document how to use new API
With this PR, we no longer use Message id, document the proper use of the api
* use C# syntax highlight
* Update NetworkMessages.md (#5)
Punctuation changes, added `cs` to code blocks.
* Write message id in short instead of packed int
* Use packer method with id
* Pass the NetworkConnection to the client message handlers
* removed workaround from previous cecil version that now causes sharing violation console warning
* fixed language feature error -- null prop op is C#4 but .sln target is net35
* separated editor logging (required) from console logging (optional)
* fix issue introduced by flipping boolean property meaning in 9895bff
* added updated weaver assembly
* updated to release assembly - wrong assembly in ef0c903
* commenting weave target debug log to retain prev behaviour (oops)
* Added modified version of Paul's 2018 WebSockets transport, modifications include:
- Basic support for WSS
- Event format converted to master event format (UnityEvents)
* Fixed indentation and added support for Available()
* Manually merged in Paul's changes for latest version of Transport
* Added comment to CertVerificationCallback to reflect new research done in live environment.
* Added NoDelay option and merged in some minor renames from 2018 branch version
* This doesn't sync slow rotating objects
The function sets lastRotation to the current rotation every frame, regardless of whether or not it detected a change. Because comparing two similar, but different Quaternions return true, only quickly rotating objects will return true; slow turning objects will return false, and the rotation will not be synced. By not updating lastRotation until a difference is spotted, any rotation will be synced.
This fix allowed my slow rotating spaceship to sync rotation.
TL;DR
lastRotation should be the last time this function returned true, not the rotation last frame.
* Update NetworkTransformBase.cs
* Created Transport.activeTransport to decrease NetworkManager god status.
* Fixed NetworkManagerHUD. (I forgot I had deleted it temporarily for testing)
* Protocol.UnpackMessage returns reader instead of content to avoid manually extracting content, just to create a reader from it in all callers
* Create NetworkReader outside of Protocol.Unpack
* Fixed 1 link to be relative
Removed Wiki link from ReadMe
* Made ClientLoadedScene virtual
Updates to scene object references
Scene and vsync handling improvements
Minor cleanup.
* removed all use of vSyncCount
* Fixed bug with ReadyToBegin being incorrectly set
* Initial Commit with Unity's Network Lobby Components
* Lobby Components WIP
* Massive simplifications and structural changes to NetworkLobbyManager and NetworkLobbyPlayer
* Replaced more default messages with Command structure resulting in further simplification and less LOC
* Completed removal of messages
* Code Formatting and GUI Layout
* Fixed bugs and finished Remove feature in UI
* Added Network Lobby Manager Doc
* Network Lobby Docs
* Network Lobby Player Doc
* Updated doc and image about Offline Scene
* changed to PNG
* Added Lobby components to navigation
* Conformed to naming convention
Removed some leftover cruft
Removed maxPlayers (redundant to maxConnections)
Trapped and killed null ref in OnServerDisconnect
* Fixed mistake in OnServerDisconnect
* Fix Active Scene check
* Alow clean switch to Offline scene
* Add Help URL attributes to components
* Added Help URL Attributes
* Fixed OnGUI logic error.
* Added Example and README
* Fixed Disconnect handler
* Updated Docs
* Added Header for Inspector
* Finished Lobby Example Minigame
* Minor cleanup
* Set targetFramerates
* Code Cleanup
Changed to extended Lobby Manager for player Indexes & colors
* Minor changes to align with Mirror's NetworkManager
* Fixed logic error
* SyncVar Hook Workaround
Random Start Positions
* Revert making CallOnClientEnterLobby public
* Added documentation to the extension
* Minor code rearrangement
* Made OnGUI virtual so it can be overridden.
Added AllPlayersReady bool for convenience to extenders
Start Game enhancement to example.
* added comments
* Corrected namespaces and usings
* Reworked DontDestroyOnLoad
LobbyPlayer: Moved code from OnStartClient to Start
Added LobbyPlayerExt to Lobby Example
Code cleanup, added regions
Fixed Start Game button bug
* Final push of Lobby example to make sure it's complete.
* Improved Lobby Example
* Code cleanup
* Added ground texture
Set player camera angle
Adjusted lighting angle
* Updated ReadMe
Cleaned up privates
Fixed example to use SetParent
Changed to 5 max connections in example
* Prefab name fixes due to Mirror master's changes
Changed camera handling and GamePlayer Prefab
Two more SetParent fixes
Demoted two warnings to information
Added more comments to example scripts
* Revisions based on Vis2K review...more to come.
* Added f's where assigning literals to floats
* Removed manual calls to SyncVar Hooks because the bug is now fixed.
* Changed to GUILayout
* wrapped in namespace
* Changed to GUILayout
* All changes per peer review
* Renamed folder to Lobby.
* Fix due to change in Mirror 1691
* Renamed Scenes
Added LobbyScene property to OfflineGUI script.
* Example for weaver issue
* Fix#314, weave assemblies built before the weaver
* Don't need the example anymore
* Update CompilationFinishedHook.cs
* Dont try to load assemblies while they are being modified
* Revert "Weave dll again. Plan B for #314 (#323)"
This reverts commit b20cb4280c.
* BUG: Fix issue where setting this.enabled = false doesn't get honored when transitioning from Local Offline Host to Connected Server.
* Update TelepathyTransport.cs
* position magic instead of allocating writers
* premature optimizations here we come
* simplify. less magic.
* better logging
* fix ondeserialize bugs caused by readpacketuint32 instead of readint32
Immediately after the deleted lines is a call to `OnClientDisconnect(netMsg.conn);` which calls `StopClient();` which has the exact same code on line 344 as what I'm proposing be deleted here.
In some transports (Ignorance), when the player clicks "Connect", the transport goes in Connecting state. If the player clicks Disconnect
the transport remains in Connecting state.
This gives the transport a chance to cancel the Connecting process. This fix has been tested for quite some time in 2018 branch
* Assign transport in inspector
* Update NetworkManager.cs
* Update NetworkManager.cs
* Update NetworkManager.cs
* Update NetworkManager.cs
* Move transport under NetworkInfo
* Updated scene with new properties
* Convert Transport to component; remove websockets property
* Improve warning
* Automatically add default Transport if needed
* Added Transports to scenes
* Move port to Transport
* Detected too late
* Interface
* Virtual transport property just in case
* HUD shows transport.tostring
* LLAPITransport UseWebsockets option
* Remove bindToIp and ServerStart(ip) parameter. let transport handle it if needed.
* TelepathyTransport.ToString
* Remove unused function
* LLAPITransport.ToString
* Don't duplicate ports
remote endpoint already has the port.
If you have ipv6, it will show like this:
```[::]:7777```
[::] is localhost in IPv6
If you have ipv4, it will show like this:
```127.0.0.1:7777```
* Removed unused labels
* Syntax
* Updated Telepathy to latest version
* localendpoint
syncInterval resets back to 0.1f (Value that is set in the NetworkBehaviour class) if changed using the editor. The issue is present when changing both, scene objects as well as prefabs.
* fix
* Test file
* Syntax
* NetworkBehaviour.Set/GetSyncVarNetworkIdentity functions added
* add definitions to weaver
* Use them
* add NetworkIdentity cases everywhere else too
* ProcessInstructionSetter/GetterField replaces for OnDeserialize too, so that [SyncVar]GameObjects/NetworkIdentities work with custom On(De)Serialize as well
* Custom on(De)serialize test
* Weaver.ProcessSiteMethod doesn't ignore OnDeserialize anymore either
* [SyncVar] GameObject/NetworkIdentity hooks work again
* testscene
* public gameobject field test
* pass gameobject field to getsyncvargameobject etc.
* GetSyncVarGameObject/NetworkIdentity always returns the field if server, looks up netId otherwise; functions aren't static anymore.
* Use original OnSerialize generation again, so it simply calls writer.Write(go) on server, which sends the netId internally anyway.
* fixed hooks not using 'this.' because getter function isn't static anymore.
* add scene referencing test
* remove tests
* Fix additive scene loading causing duplicate sceneIds by using an offset per scene.
* TEST: moved SpawnableObjects to NetworkIdentity. OnDisable adds it to the dict. SpawnObject removes it.
* Log if we don't find the spawn scene object
* Fix compilation issues
* Make PrepareToSpawnSceneObjects public
* 2018.3 warning fix. The old way to check if something is a porefab is depricated so needs replacing with new code.
* 2018.3 warning fix. The old way to check if something is a porefab is depricated so needs replacing with new code.
* Bug fix for 2018.3+ where NetworkIdentity GUIDs are set to blank in prefab files and shown as blank in the editor.
* Another 2018.3 warning fix. The old way to check if something is a porefab is depricated so needs replacing with new code.
* Make sure it works in 2017.4
* Change not needed
* Revert "Change not needed"
This reverts commit 13747739df.
* Mark LLAPI as obsolete
* Don't use obsolete api
* Suppress obsolete LLAPI warning for now
* Remove warning
* Make conditional a little clearer
* Ignore unity generated files and folders
* Import mirror as source
* Source based does not build dlls anymore
* nuget packages not used in source based
* Produce an archive with the release
* generate archive with Mirror folder to avoid accidents
* Deploy to github releases
* Document new installation procedures