* WIP first draft
* Much closer now
* Whoop! There it is!
* Added comment
* Restore Player
* Moved WeaveFailed back where it was
* Restore delegate wireup
* Moved the delegate wireup and added comments
* Formatted comment and error message
* Added comment
* Use a separate session bool
* Code formatting
* Delete Mirror.Editor.asmdef
* Add Debug
* No WeaveExistingAssemblies
* Revert "No WeaveExistingAssemblies"
This reverts commit 50d4790ee4.
* Revert "Add Debug"
This reverts commit 185b403361.
* Revert "Delete Mirror.Editor.asmdef"
This reverts commit f7647cce3f.
* Update Assets/Mirror/Editor/Mirror.Editor.asmdef
* Update Assets/Mirror/Editor/Mirror.Editor.asmdef
* reverted changes to Mirror.Editor.asmdef
* Re-applied change to Mirror.Editor.asmdef
* commented Debug line
* feat: supports scriptable objects
Now you can pass scriptable objects in commands, rpcs and syncvars
For example:
```cs
class Weapon: ScriptableObject
{
public string name;
public string description;
public int damage;
...
}
class Player : NetworkBehaviour
{
[SyncVar]
Weapon equipped;
...
}
```
Scriptable objects will be created in the client using
ScriptableObject.CreateInstance. If users want something else
they can provide a custom serializer (that has not changed)
* fix: remove scriptableobject error Tests
The test that checks that scrscriptableobjects give error is no
longer valid
* fix#1475: isClient is true in OnDestroy on host/client mode again. Reverts commit d00c95bb55
* add comment
* ClientScene.InternalAddPlayer doesn't need to set isClient anymore
When the callback for SyncDictionary is called in the server
for set or add
it is getting called before the syncdictionary is updated.
In the client this happens after.
Example:
```cs
public void OnScoreUpdatedCallback(ScoreSyncDict.Operation op, uint ident, int score)
{
if (op == ScoreSyncDict.Operation.OP_SET)
Debug.Log($"The value in the dictionary is {scoreDict[ident]}");
}
```
In host mode this prints the previous value. In client mode this prints the current value. This PR fixes this problem and makes both print the current value
* Fix typo
* Updated Changelog
* first commit
* Add example for discovery
* NetworkDiscovery component should be added
* fixed UI
* Fix some warnings
* refactor: network discovery reimplemented
* Remove unused GUIstyle
* Fix namespaces
* Just send to the broadcast address
* Fix indentation
* Log errors in ClientListen
* Code formatting cleanup, HelpURL's fixed, comments revised. (#38)
* Transport can now provide server uri
* work with any transport by passing uri
* Move discovery initialization to start
* feat: Discovery can now be easily customized per game
* Use generics to simplify api
* Renamed ServerInfo -> ServerResponse
* Rename method
* Moved up one folder
* Move ServerId to NetworkDiscovery
* tests now reference Mirror.Discovery
* Cleaned up blank space
* Disable GUID apparently fixes it
* Use UnityEvents for ease of use
* Remove noisy log
* remove blank spaces
* Process request receives the client endpoint
* use consistent name for parameters
* Remove white space
* Keep it minimalistic, we don't need age or totalPlayers
* Comment non obvious property
* Don't break transports
* Documentation and image
* Code formatting
* removed privates
* Added Range attribute
* Rename ActiveDiscoverySecondInterval
* Revised NetworkDiscovery doc
* Swapped field order (Cosmetics)
* Added ScriptTemplate
* Update ProjectSettings/ProjectVersion.txt
* Updated ScriptTemplate
* Updated xml comment and ScriptTemplate
* Updated ScriptTemplate
* Improve xmldocs
* Improve xmldocs
* Remove leftover comment
* Renamed event
* Moved discovery inside components
* Keep parameter names consistent
* Provide a guide for network discovery
* XML Comments and ScriptTemplate
* Moved Credits
* fixed template
* Removed comment
* removed comment
* xml comments and template
* fixed method name
* fixed method and template
* removed semicolon
* fixed template
* fixed method and template
* fixed template
* fixed template
* Fix copypasta error
* Show error if no url is available
Network Discovery now shows an error if the transport does not support
providing Url
* Grammar fix
* Extended Template
* fixed template
* Added guide link to template
* New image
* Update NetworkDiscovery.md
* Updated Guid Doc and Template
* fixed bullets
* Remove unnecessary using
* Make it like Mirror's
* Update ScriptTemplates Image & Zip
* Removed from Deprecations
* Updated ChangeLog
* Updated ChangeLog
* Update NetworkDiscovery.md
Remove last line...this was copied to the paragraph above the code block
Co-authored-by: MrGadget <chris@clevertech.net>
* Fix typo
* Updated Changelog
* first commit
* Add example for discovery
* NetworkDiscovery component should be added
* fixed UI
* Fix some warnings
* refactor: network discovery reimplemented
* Remove unused GUIstyle
* Fix namespaces
* Just send to the broadcast address
* Fix indentation
* Log errors in ClientListen
* Code formatting cleanup, HelpURL's fixed, comments revised. (#38)
* Transport can now provide server uri
* work with any transport by passing uri
* Move discovery initialization to start
* feat: Discovery can now be easily customized per game
* Use generics to simplify api
* Renamed ServerInfo -> ServerResponse
* Rename method
* Moved up one folder
* Move ServerId to NetworkDiscovery
* tests now reference Mirror.Discovery
* Cleaned up blank space
* Disable GUID apparently fixes it
* Use UnityEvents for ease of use
* Remove noisy log
* remove blank spaces
* Process request receives the client endpoint
* use consistent name for parameters
* Remove white space
* Keep it minimalistic, we don't need age or totalPlayers
* Comment non obvious property
* Don't break transports
* Documentation and image
* Code formatting
* removed privates
* Added Range attribute
* Rename ActiveDiscoverySecondInterval
* Revised NetworkDiscovery doc
* Swapped field order (Cosmetics)
* Added ScriptTemplate
* Update ProjectSettings/ProjectVersion.txt
* Updated ScriptTemplate
* Updated xml comment and ScriptTemplate
* Updated ScriptTemplate
* Improve xmldocs
* Improve xmldocs
* Remove leftover comment
* Renamed event
* Moved discovery inside components
* Keep parameter names consistent
* Provide a guide for network discovery
* XML Comments and ScriptTemplate
* Moved Credits
* fixed template
* Removed comment
* removed comment
* xml comments and template
* fixed method name
* fixed method and template
* removed semicolon
* fixed template
* fixed method and template
* fixed template
* fixed template
* Fix copypasta error
* Show error if no url is available
Network Discovery now shows an error if the transport does not support
providing Url
* breaking: Make server uri mandatory
BREAKING CHANGE: Make the server uri method mandatory in transports
Co-authored-by: MrGadget <chris@clevertech.net>
* Create Network Scene Checker Component
* Move objects to subscene in client
* Remove OnStartClient
* Rewritten with static dictionary
* Updated doc
* renamed image
* Replaced image
* fixed image name
* Changed to short-circuit return in Update
* Changed to using string for key since additive scenes may be unloaded
* Added null check
* Removed commented line
* Update Assets/Mirror/Components/NetworkSceneChecker.cs
Co-Authored-By: vis2k <info@noobtuts.com>
* Moved initializer to declaration
* Removed [Scene, SerializeField]
Co-authored-by: vis2k <info@noobtuts.com>
* Remove m_sceneId
* remove commented code
* copied comment from removed field
* made it full public
* Added FormerlySerializedAs
* Added HideInInspector
* Updated example
* test
* new docs
* adjust CheckForHookFunction to expect two hooks
* update example
* update example
* update example
* update test
* update example
* SyncVar.set: store value in oldValue variable
* SyncVar.set: pass old value to hook too
* TODO
* SyncVar deserialize store value in oldValue variable (for simple types)
* SyncVar deserialize: pass old value to hook too (for simple types)
* add test for GameObject type
* fix comment
* SyncVar deserialize: set value before calling hook
* add TODO
* SyncVar.set: set value before calling hook
* replace tests
* GO test
* SyncVar deserialize: move oldvalue code higher up so it applies to GO/NI too
* syntax
* SyncVar deserialize: pass oldValue to hook (GO/NI types)
* SyncVar deserialize: set netid before calling hook (GO/NI types)
* update comment
* update comment
* update comment
* shorter
* comment, TODO
* put oldValue code into separate cases again
* fix SyncVarEqual comparing the same two __goNetId values
* get rid of tmpValue
* fix weaver tests
* remove TODO
* SyncVar deserialize simple types: get rid of tmpValue here too
* remove tests
* move comment
* add comment
* fix: #1278 - only call initial state SyncVar hooks on clients if the SyncVar value is different from the default one.
* initialState test for an if
* !initialstate
* getting there
* closer
* works but incompatible stack heights message
* better comments
* better
* not needed
* syntax
* rename
* incompatible stack height fixed
* update comment
* remove first todo
* SAVE PROGRESS
* compare go/ni too
* whitespace
* update comments
This allows non-player objects that have been assigned authority to the client to be moved around by the client and their positions updated from that client appropriately when clientAuthority is also true.